diff --git a/lib/views/settings_view.dart b/lib/views/settings_view.dart index 79e13b1..1704557 100644 --- a/lib/views/settings_view.dart +++ b/lib/views/settings_view.dart @@ -110,6 +110,37 @@ class _SettingsViewState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ + CupertinoButton( + color: CustomTheme.primaryColor, + sizeStyle: CupertinoButtonSize.medium, + child: Text( + 'Daten importieren', + style: + TextStyle(color: CustomTheme.backgroundColor), + ), + onPressed: () async { + final success = + await LocalStorageService.importJsonFile(); + if (!success && context.mounted) { + showCupertinoDialog( + context: context, + builder: (context) => CupertinoAlertDialog( + title: const Text('Fehler'), + content: const Text( + 'Datei konnte nicht importiert werden.'), + actions: [ + CupertinoDialogAction( + child: const Text('OK'), + onPressed: () => + Navigator.pop(context), + ), + ], + )); + } + }), + const SizedBox( + width: 20, + ), CupertinoButton( color: CustomTheme.primaryColor, sizeStyle: CupertinoButtonSize.medium, @@ -119,7 +150,6 @@ class _SettingsViewState extends State { TextStyle(color: CustomTheme.backgroundColor), ), onPressed: () async { - print('Export pressed'); final success = await LocalStorageService.exportJsonFile(); if (!success && context.mounted) { @@ -140,38 +170,6 @@ class _SettingsViewState extends State { } }, ), - const SizedBox( - width: 20, - ), - CupertinoButton( - color: CustomTheme.primaryColor, - sizeStyle: CupertinoButtonSize.medium, - child: Text( - 'Daten importieren', - style: - TextStyle(color: CustomTheme.backgroundColor), - ), - onPressed: () async { - print('Import pressed'); - final success = - await LocalStorageService.importJsonFile(); - if (!success && context.mounted) { - showCupertinoDialog( - context: context, - builder: (context) => CupertinoAlertDialog( - title: const Text('Fehler'), - content: const Text( - 'Datei konnte nicht importiert werden.'), - actions: [ - CupertinoDialogAction( - child: const Text('OK'), - onPressed: () => - Navigator.pop(context), - ), - ], - )); - } - }), ], )), ) diff --git a/pubspec.yaml b/pubspec.yaml index 4b57278..2261f6d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.2.8+201 +version: 0.2.8+202 environment: sdk: ^3.5.4