diff --git a/lib/src/google_map_location_picker.dart b/lib/src/google_map_location_picker.dart index b06dfda0..a0efaff7 100644 --- a/lib/src/google_map_location_picker.dart +++ b/lib/src/google_map_location_picker.dart @@ -40,6 +40,7 @@ class LocationPicker extends StatefulWidget { this.countries, this.language, this.desiredAccuracy, + this.buttonMargin, }); final String apiKey; @@ -66,6 +67,7 @@ class LocationPicker extends StatefulWidget { final String language; final LocationAccuracy desiredAccuracy; + final EdgeInsets buttonMargin; @override LocationPickerState createState() => LocationPickerState(); @@ -425,6 +427,7 @@ class LocationPickerState extends State { key: mapKey, language: widget.language, desiredAccuracy: widget.desiredAccuracy, + buttonMargin: widget.buttonMargin, ), ); }), @@ -462,6 +465,8 @@ Future showLocationPicker( Decoration resultCardDecoration, String language = 'en', LocationAccuracy desiredAccuracy = LocationAccuracy.best, + EdgeInsets buttonMargin = + const EdgeInsets.only(top: kToolbarHeight + 50, right: 8), }) async { final results = await Navigator.of(context).push( MaterialPageRoute( @@ -487,6 +492,7 @@ Future showLocationPicker( countries: countries, language: language, desiredAccuracy: desiredAccuracy, + buttonMargin: buttonMargin, ); }, ), diff --git a/lib/src/map.dart b/lib/src/map.dart index eca20b2c..6ccf8e06 100644 --- a/lib/src/map.dart +++ b/lib/src/map.dart @@ -38,6 +38,7 @@ class MapPicker extends StatefulWidget { this.resultCardPadding, this.language, this.desiredAccuracy, + this.buttonMargin, }) : super(key: key); final String apiKey; @@ -64,6 +65,8 @@ class MapPicker extends StatefulWidget { final LocationAccuracy desiredAccuracy; + final EdgeInsets buttonMargin; + @override MapPickerState createState() => MapPickerState(); } @@ -202,6 +205,7 @@ class MapPickerState extends State { layersButtonEnabled: widget.layersButtonEnabled, onToggleMapTypePressed: _onToggleMapTypePressed, onMyLocationPressed: _initCurrentLocation, + buttonMargin: widget.buttonMargin, ), pin(), locationCard(), @@ -452,6 +456,7 @@ class _MapFabs extends StatelessWidget { @required this.layersButtonEnabled, @required this.onToggleMapTypePressed, @required this.onMyLocationPressed, + @required this.buttonMargin, }) : assert(onToggleMapTypePressed != null), super(key: key); @@ -460,12 +465,12 @@ class _MapFabs extends StatelessWidget { final VoidCallback onToggleMapTypePressed; final VoidCallback onMyLocationPressed; - + final EdgeInsets buttonMargin; @override Widget build(BuildContext context) { return Container( alignment: Alignment.topRight, - margin: const EdgeInsets.only(top: kToolbarHeight + 24, right: 8), + margin: buttonMargin, child: Column( children: [ if (layersButtonEnabled)