diff --git a/lib/app/modules/map/view/map.dart b/lib/app/modules/map/view/map.dart index 7a6a6d3..0053870 100644 --- a/lib/app/modules/map/view/map.dart +++ b/lib/app/modules/map/view/map.dart @@ -76,6 +76,16 @@ class _MapWeatherState extends State with TickerProviderStateMixin { super.dispose(); } + void _resetMapOrientation({LatLng? center, double? zoom}) { + _animatedMapController.animateTo( + dest: center, + zoom: zoom, + rotation: 0, + duration: const Duration(milliseconds: 500), + curve: Curves.easeInOut, + ); + } + void _onMarkerTap(WeatherCard weatherCard) { setState(() { _selectedWeatherCard = weatherCard; @@ -262,6 +272,7 @@ class _MapWeatherState extends State with TickerProviderStateMixin { _buildMapTileLayer(cacheStore), RichAttributionWidget( animationConfig: const ScaleRAWA(), + alignment: AttributionAlignment.bottomLeft, attributions: [ TextSourceAttribution( 'OpenStreetMap contributors', @@ -289,6 +300,24 @@ class _MapWeatherState extends State with TickerProviderStateMixin { markers: [mainMarker, ...cardMarkers], ); }), + Positioned( + bottom: 15, + right: 15, + child: FloatingActionButton( + child: const Icon(IconsaxPlusLinear.gps), + onPressed: () => _resetMapOrientation( + center: LatLng(mainLocation.lat!, mainLocation.lon!), + zoom: 12), + ), + ), + Positioned( + bottom: 15, + right: 85, + child: FloatingActionButton( + child: const Icon(IconsaxPlusLinear.refresh_square_2), + onPressed: () => _resetMapOrientation(), + ), + ), Positioned( left: 0, right: 0, diff --git a/pubspec.lock b/pubspec.lock index 6d6e3f2..ef0bbd2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1267,10 +1267,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" watcher: dependency: transitive description: @@ -1368,5 +1368,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.5.0 <4.0.0" + dart: ">=3.5.1 <4.0.0" flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index 53f3cc1..7606d7f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: "none" version: 1.3.4+37 environment: - sdk: ">=3.5.0 <4.0.0" + sdk: ">=3.5.1 <4.0.0" dependencies: flutter: