show static method
Future<LocationData?>
show({
- required BuildContext context,
- void onError()?,
- String? language = 'en',
- List<
String> ? countryCodes, - Color? searchBarBackgroundColor,
- Color? searchBarTextColor = Colors.black87,
- String? searchBarHintText = 'Search location',
- String? currentPositionButtonText = 'Use current location',
- Color? searchBarHintColor = Colors.black87,
- bool? lightAdress = false,
- Color? iconColor = Colors.grey,
- Widget? loadingWidget,
- Mode mode = Mode.fullscreen,
- int historyMaxLength = 5,
Implementation
static Future<LocationData?> show({
required BuildContext context,
void Function(Exception e)? onError,
String? language = 'en',
List<String>? countryCodes,
Color? searchBarBackgroundColor,
Color? searchBarTextColor = Colors.black87,
String? searchBarHintText = 'Search location',
String? currentPositionButtonText = 'Use current location',
Color? searchBarHintColor = Colors.black87,
bool? lightAdress = false,
Color? iconColor = Colors.grey,
Widget? loadingWidget,
Mode mode = Mode.fullscreen,
int historyMaxLength = 5,
}) {
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,
lightAdress: lightAdress,
iconColor: iconColor,
loadingWidget: loadingWidget,
mode: mode,
historyMaxLength: historyMaxLength,
);
if (mode == Mode.overlay) {
return showDialog(context: context, builder: builder);
}
return Navigator.push(context, MaterialPageRoute(builder: builder));
}