Merge branch 'development' into feature/129-neues-popup-design

# Conflicts:
#	lib/presentation/views/main_menu/settings_view/settings_view.dart
This commit is contained in:
2026-01-13 22:57:19 +01:00
2 changed files with 208 additions and 182 deletions

View File

@@ -39,7 +39,9 @@ class _SettingsViewState extends State<SettingsView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
return ScaffoldMessenger( return ScaffoldMessenger(
child: Scaffold( child: Builder(
builder: (scaffoldMessengerContext) {
return Scaffold(
appBar: AppBar(backgroundColor: CustomTheme.backgroundColor), appBar: AppBar(backgroundColor: CustomTheme.backgroundColor),
backgroundColor: CustomTheme.backgroundColor, backgroundColor: CustomTheme.backgroundColor,
body: SingleChildScrollView( body: SingleChildScrollView(
@@ -59,7 +61,11 @@ class _SettingsViewState extends State<SettingsView> {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 16, top: 10, bottom: 10), padding: const EdgeInsets.only(
left: 16,
top: 10,
bottom: 10,
),
child: Text( child: Text(
textAlign: TextAlign.start, textAlign: TextAlign.start,
loc.data, loc.data,
@@ -75,13 +81,18 @@ class _SettingsViewState extends State<SettingsView> {
suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16), suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16),
onPressed: () async { onPressed: () async {
final String json = final String json =
await DataTransferService.getAppDataAsJson(context); await DataTransferService.getAppDataAsJson(
scaffoldMessengerContext,
);
final result = await DataTransferService.exportData( final result = await DataTransferService.exportData(
json, json,
'game_tracker-data', 'game_tracker-data',
); );
if (!context.mounted) return; if (!scaffoldMessengerContext.mounted) return;
showExportSnackBar(context: context, result: result); showExportSnackBar(
context: scaffoldMessengerContext,
result: result,
);
}, },
), ),
SettingsListTile( SettingsListTile(
@@ -89,9 +100,14 @@ class _SettingsViewState extends State<SettingsView> {
icon: Icons.download, icon: Icons.download,
suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16), suffixWidget: const Icon(Icons.arrow_forward_ios, size: 16),
onPressed: () async { onPressed: () async {
final result = await DataTransferService.importData(context); final result = await DataTransferService.importData(
if (!context.mounted) return; scaffoldMessengerContext,
showImportSnackBar(context: context, result: result); );
if (!scaffoldMessengerContext.mounted) return;
showImportSnackBar(
context: scaffoldMessengerContext,
result: result,
);
}, },
), ),
SettingsListTile( SettingsListTile(
@@ -129,7 +145,11 @@ class _SettingsViewState extends State<SettingsView> {
}, },
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 16, top: 10, bottom: 10), padding: const EdgeInsets.only(
left: 16,
top: 10,
bottom: 10,
),
child: Text( child: Text(
textAlign: TextAlign.start, textAlign: TextAlign.start,
loc.legal, loc.legal,
@@ -178,7 +198,9 @@ class _SettingsViewState extends State<SettingsView> {
GestureDetector( GestureDetector(
child: const Icon(Icons.language), child: const Icon(Icons.language),
onTap: () => { onTap: () => {
launchUrl(Uri.parse('https://liquid-dev.de')), launchUrl(
Uri.parse('https://liquid-dev.de'),
),
}, },
), ),
GestureDetector( GestureDetector(
@@ -227,6 +249,8 @@ class _SettingsViewState extends State<SettingsView> {
], ],
), ),
), ),
);
},
), ),
); );
} }
@@ -287,10 +311,11 @@ class _SettingsViewState extends State<SettingsView> {
Duration duration = const Duration(seconds: 3), Duration duration = const Duration(seconds: 3),
VoidCallback? action, VoidCallback? action,
}) { }) {
if (!context.mounted) return;
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);
final messenger = ScaffoldMessenger.of(context); ScaffoldMessenger.of(context).hideCurrentSnackBar();
messenger.hideCurrentSnackBar(); ScaffoldMessenger.of(context).showSnackBar(
messenger.showSnackBar(
SnackBar( SnackBar(
content: Text(message, style: const TextStyle(color: Colors.white)), content: Text(message, style: const TextStyle(color: Colors.white)),
backgroundColor: CustomTheme.onBoxColor, backgroundColor: CustomTheme.onBoxColor,

View File

@@ -295,6 +295,7 @@ class _PlayerSelectionState extends State<PlayerSelection> {
/// [message] - The message to display in the snackbar. /// [message] - The message to display in the snackbar.
void showSnackBarMessage(String message) { void showSnackBarMessage(String message) {
if (!context.mounted) return; if (!context.mounted) return;
ScaffoldMessenger.of(context).hideCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar( SnackBar(
backgroundColor: CustomTheme.boxColor, backgroundColor: CustomTheme.boxColor,