Last active
November 27, 2020 23:10
-
-
Save JosLuna98/656f647dc7ad77878c133e0fc0882d4b to your computer and use it in GitHub Desktop.
simple implementation of address search field plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:address_search_field/address_search_field.dart'; | |
class Example extends StatelessWidget { | |
final _geoMethods = GeoMethods( | |
googleApiKey: 'GOOGLE_API_KEY', | |
language: 'es-419', | |
countryCode: 'ec', | |
country: 'Ecuador', | |
city: 'Esmeraldas', | |
); | |
final _controller = TextEditingController(); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
child: Center( | |
child: TextField( | |
controller: _controller, | |
onTap: () => showDialog( | |
context: context, | |
builder: (_) => AddressSearchBuilder.deft( | |
geoMethods: _geoMethods, | |
controller: _controller, | |
builder: AddressDialogBuilder(), | |
onDone: (Address address) { | |
print(address); | |
}, | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment