diff --git a/lib/screens/main_screen/annotation_dialog.dart b/lib/screens/main_screen/annotation_dialog.dart index 954253f..7fa6c7a 100644 --- a/lib/screens/main_screen/annotation_dialog.dart +++ b/lib/screens/main_screen/annotation_dialog.dart @@ -43,12 +43,14 @@ class _AnnotationDialogState extends State { style: getBodyTextTextStyle(context), ), const SizedBox(height: MEDIUM_SPACE), - TextField( + PlatformTextField( controller: controller, autofocus: true, - decoration: InputDecoration( - labelText: localizations - .mainScreenAnnotationDialogAnnotationFieldLabel, + material: (_, __) => MaterialTextFieldData( + decoration: InputDecoration( + labelText: localizations + .mainScreenAnnotationDialogAnnotationFieldLabel, + ), ), onSubmitted: (value) { Navigator.of(context).pop(value); diff --git a/lib/screens/memory_map_screen.dart b/lib/screens/memory_map_screen.dart index 0053048..a8e352f 100644 --- a/lib/screens/memory_map_screen.dart +++ b/lib/screens/memory_map_screen.dart @@ -43,10 +43,18 @@ class _MemoryMapScreenState extends State with Loadable { longitude: widget.location.longitude, ); + if (!mounted) { + return; + } + setState(() { address = foundAddress; }); } catch (error) { + if (!mounted) { + return; + } + setState(() { address = null; }); diff --git a/lib/widgets/help_sheet/help_sheet_form.dart b/lib/widgets/help_sheet/help_sheet_form.dart index 3c4e817..b0cb004 100644 --- a/lib/widgets/help_sheet/help_sheet_form.dart +++ b/lib/widgets/help_sheet/help_sheet_form.dart @@ -27,45 +27,47 @@ class _HelpSheetFormState extends State { final localizations = AppLocalizations.of(context)!; return ModalSheet( - child: Column( - children: [ - Text( - widget.title, - textAlign: TextAlign.center, - style: getTitleTextStyle(context), - ), - const SizedBox(height: MEDIUM_SPACE), - widget.helpContent, - const SizedBox(height: LARGE_SPACE), - PlatformElevatedButton( - child: Text(localizations.generalUnderstoodButtonLabel), - onPressed: () => Navigator.pop(context, dontShowSheetAgain), - ), - const SizedBox(height: SMALL_SPACE), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - PlatformSwitch( - value: dontShowSheetAgain, - activeColor: platformThemeData( - context, - material: (data) => data.colorScheme.primary, - cupertino: (data) => data.primaryColor, + child: SingleChildScrollView( + child: Column( + children: [ + Text( + widget.title, + textAlign: TextAlign.center, + style: getTitleTextStyle(context), + ), + const SizedBox(height: MEDIUM_SPACE), + widget.helpContent, + const SizedBox(height: LARGE_SPACE), + PlatformElevatedButton( + child: Text(localizations.generalUnderstoodButtonLabel), + onPressed: () => Navigator.pop(context, dontShowSheetAgain), + ), + const SizedBox(height: SMALL_SPACE), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + PlatformSwitch( + value: dontShowSheetAgain, + activeColor: platformThemeData( + context, + material: (data) => data.colorScheme.primary, + cupertino: (data) => data.primaryColor, + ), + onChanged: (value) { + setState(() { + dontShowSheetAgain = value; + }); + }, ), - onChanged: (value) { - setState(() { - dontShowSheetAgain = value; - }); - }, - ), - const SizedBox(width: SMALL_SPACE), - Text( - localizations.helpSheetDontShowAgain, - style: getBodyTextTextStyle(context), - ) - ], - ), - ], + const SizedBox(width: SMALL_SPACE), + Text( + localizations.helpSheetDontShowAgain, + style: getBodyTextTextStyle(context), + ) + ], + ), + ], + ), ), ); } diff --git a/lib/widgets/platform_widgets/memory_material_maps.dart b/lib/widgets/platform_widgets/memory_material_maps.dart index 81473d8..2758419 100644 --- a/lib/widgets/platform_widgets/memory_material_maps.dart +++ b/lib/widgets/platform_widgets/memory_material_maps.dart @@ -1,6 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:flutter_osm_plugin/flutter_osm_plugin.dart'; +import 'package:quid_faciam_hodie/constants/spacing.dart'; import 'package:quid_faciam_hodie/foreign_types/memory_location.dart'; +import 'package:quid_faciam_hodie/utils/theme.dart'; class MemoryMaterialMaps extends StatefulWidget { final MemoryLocation location; @@ -70,8 +73,31 @@ class _MemoryMaterialMapsState extends State { @override Widget build(BuildContext context) { + final localizations = AppLocalizations.of(context)!; + return OSMFlutter( controller: controller, + mapIsLoading: Container( + color: getSheetColor(context), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox( + width: LARGE_SPACE, + height: LARGE_SPACE, + child: CircularProgressIndicator(), + ), + const SizedBox(height: MEDIUM_SPACE), + Text( + localizations.generalLoadingLabel, + style: getBodyTextTextStyle(context), + ), + ], + ), + ), + ), initZoom: widget.initialZoom, maxZoomLevel: widget.lockZoom ? widget.initialZoom : 19, minZoomLevel: widget.lockZoom ? widget.initialZoom : 2,