show static method
Future<LocationData?>
show({
- required BuildContext context,
- void onError()?,
- String language = 'en',
- List<
String> ? countryCodes, - Color? searchBarBackgroundColor,
- required UserAgent userAgent,
- Color searchBarTextColor = Colors.black87,
- String searchBarHintText = 'Search location',
- String currentPositionButtonText = 'Use current location',
- Color searchBarHintColor = Colors.black87,
- bool lightAddress = false,
- Color iconColor = Colors.grey,
- Widget? loadingWidget,
- Widget upperWidget(
- BuildContext context
- String? googlePlacesSearchKey,
- Mode mode = Mode.fullscreen,
- int historyMaxLength = 5,
- bool showAddressNumberOption = true,
- String addressNumberButtonText = "Add number",
- IconData? addressNumberButtonIcon = Icons.add,
- Color? addressNumberButtonColor,
- Color? addressNumberButtonBackground,
- double addressNumberButtonTextSize = 12,
Implementation
static Future<LocationData?> show({
required BuildContext context,
void Function(Exception e)? onError,
String language = 'en',
List<String>? countryCodes,
Color? searchBarBackgroundColor,
required UserAgent userAgent,
Color searchBarTextColor = Colors.black87,
String searchBarHintText = 'Search location',
String currentPositionButtonText = 'Use current location',
Color searchBarHintColor = Colors.black87,
bool lightAddress = false,
Color iconColor = Colors.grey,
Widget? loadingWidget,
Widget Function(BuildContext context)? upperWidget,
String? googlePlacesSearchKey,
Mode mode = Mode.fullscreen,
int historyMaxLength = 5,
bool showAddressNumberOption = true,
String addressNumberButtonText = "Add number",
IconData? addressNumberButtonIcon = Icons.add,
Color? addressNumberButtonColor,
Color? addressNumberButtonBackground,
double addressNumberButtonTextSize = 12,
}) {
LocationSearchWidget builder(BuildContext ctx) => LocationSearchWidget(
onPicked: (data) => Navigator.pop(context, data),
onError: onError,
language: language,
countryCodes: countryCodes,
searchBarBackgroundColor: searchBarBackgroundColor,
searchBarTextColor: searchBarTextColor,
searchBarHintText: searchBarHintText,
currentPositionButtonText: currentPositionButtonText,
searchBarHintColor: searchBarHintColor,
lightAddress: lightAddress,
iconColor: iconColor,
upperWidget: upperWidget,
googlePlacesSearchKey: googlePlacesSearchKey,
loadingWidget: loadingWidget,
mode: mode,
historyMaxLength: historyMaxLength,
userAgent: userAgent,
showAddressNumberOption: showAddressNumberOption,
addressNumberButtonText: addressNumberButtonText,
addressNumberButtonIcon: addressNumberButtonIcon,
addressNumberButtonColor: addressNumberButtonColor,
addressNumberButtonBackground: addressNumberButtonBackground,
addressNumberButtonTextSize: addressNumberButtonTextSize,
);
if (mode == Mode.overlay) {
return showDialog(context: context, builder: builder);
}
return Navigator.push(context, MaterialPageRoute(builder: builder));
}