address_search_text_field 0.0.1 address_search_text_field: ^0.0.1 copied to clipboard
A text field that displays an address search bar that finds a location from a reference and gets nearby addresses. Selecting the desired address returns an object with the latitude, longitude, and ful [...]
import 'package:flutter/material.dart';
import 'package:address_search_text_field/address_search_text_field.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
final SearchAddressTextField searchAddress = SearchAddressTextField();
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Scaffold(
appBar: AppBar(),
body: Center(
child: Container(
width: size.width * 0.80,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SearchAddressTextField.widget(
context: context,
country: "Ecuador",
exceptions: [
"Esmeraldas, Ecuador",
"Esmeraldas Province, Ecuador",
"Ecuador"
],
),
SizedBox(
height: 15.0,
),
FlatButton(
child: Text("get data"),
color: Colors.blue,
onPressed: () {
AddressPoint point = searchAddress.values;
print(point.toString());
}
)
]
)
)
)
);
}
}