1
1
import 'package:flutter/material.dart' ;
2
- import 'package:flutter/services.dart' ;
3
2
import 'package:flutter_navigation_generator_annotations/flutter_navigation_generator_annotations.dart' ;
4
3
import 'package:flutter_template/di/injectable.dart' ;
5
4
import 'package:flutter_template/util/keys.dart' ;
@@ -8,6 +7,7 @@ import 'package:flutter_template/viewmodel/global/global_viewmodel.dart';
8
7
import 'package:flutter_template/widget/debug/debug_row_item.dart' ;
9
8
import 'package:flutter_template/widget/debug/debug_row_title.dart' ;
10
9
import 'package:flutter_template/widget/debug/debug_switch_row_item.dart' ;
10
+ import 'package:flutter_template/widget/general/simple_screen/base_screen.dart' ;
11
11
import 'package:flutter_template/widget/provider/provider_widget.dart' ;
12
12
import 'package:provider/provider.dart' ;
13
13
@@ -25,73 +25,68 @@ class DebugScreenState extends State<DebugScreen> {
25
25
Widget build (BuildContext context) {
26
26
return ProviderWidget <DebugViewModel >(
27
27
create: () => getIt ()..init (),
28
- consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => Scaffold (
29
- backgroundColor: theme.colorsTheme.background,
30
- appBar: AppBar (
31
- systemOverlayStyle: SystemUiOverlayStyle .light,
32
- title: Text (localization.settingsTitle),
33
- backgroundColor: theme.colorsTheme.primary,
34
- ),
35
- body: ListView (
36
- children: [
37
- DebugRowTitle (title: localization.debugAnimationsTitle),
38
- DebugRowSwitchItem (
39
- key: Keys .debugSlowAnimations,
40
- title: localization.debugSlowAnimations,
41
- value: viewModel.slowAnimationsEnabled,
42
- onChanged: viewModel.onSlowAnimationsChanged,
43
- ),
44
- DebugRowTitle (title: localization.debugThemeTitle),
45
- DebugRowItem (
46
- key: Keys .debugTargetPlatform,
47
- title: localization.debugTargetPlatformTitle,
48
- subTitle: localization.debugTargetPlatformSubtitle (localization.getTranslation (Provider .of <GlobalViewModel >(context).getCurrentPlatform ())),
49
- onClick: viewModel.onTargetPlatformClicked,
50
- ),
51
- DebugRowItem (
52
- key: Keys .debugThemeMode,
53
- title: localization.debugThemeModeTitle,
54
- subTitle: localization.debugThemeModeSubtitle,
55
- onClick: viewModel.onThemeModeClicked,
56
- ),
57
- DebugRowTitle (title: localization.debugLocaleTitle),
58
- DebugRowItem (
59
- key: Keys .debugSelectLanguage,
60
- title: localization.debugLocaleSelector,
61
- subTitle: localization.debugLocaleCurrentLanguage (Provider .of <GlobalViewModel >(context).getCurrentLanguage ()),
62
- onClick: viewModel.onSelectLanguageClicked,
63
- ),
64
- DebugRowSwitchItem (
65
- key: Keys .debugShowTranslations,
66
- title: localization.debugShowTranslations,
67
- value: Provider .of <GlobalViewModel >(context, listen: false ).showsTranslationKeys,
68
- onChanged: (_) => Provider .of <GlobalViewModel >(context, listen: false ).toggleTranslationKeys (),
69
- ),
70
- DebugRowTitle (title: localization.debugLicensesTitle),
71
- DebugRowItem (
72
- key: Keys .debugLicense,
73
- title: localization.debugLicensesGoTo,
74
- onClick: viewModel.onLicensesClicked,
75
- ),
76
- DebugRowTitle (title: localization.debugDatabase),
77
- DebugRowItem (
78
- key: Keys .debugDatabase,
79
- title: localization.debugViewDatabase,
80
- onClick: viewModel.goToDatabase,
81
- ),
82
- DebugRowTitle (title: localization.debugPermissionsTitle),
83
- DebugRowItem (
84
- key: Keys .debugPermissionAnalytics,
85
- title: localization.debugPermissionsShowAnalyticsPermission,
86
- onClick: viewModel.goToAnalyticsPermissionScreen,
87
- ),
88
- DebugRowItem (
89
- key: Keys .debugPermissionAnalyticsReset,
90
- title: localization.debugPermissionResetAnalytics,
91
- onClick: viewModel.resetAnalyticsPermission,
92
- ),
93
- ],
94
- ),
28
+ consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen (
29
+ title: localization.settingsTitle,
30
+ padding: EdgeInsets .zero,
31
+ isScrollable: true ,
32
+ children: [
33
+ DebugRowTitle (title: localization.debugAnimationsTitle),
34
+ DebugRowSwitchItem (
35
+ key: Keys .debugSlowAnimations,
36
+ title: localization.debugSlowAnimations,
37
+ value: viewModel.slowAnimationsEnabled,
38
+ onChanged: viewModel.onSlowAnimationsChanged,
39
+ ),
40
+ DebugRowTitle (title: localization.debugThemeTitle),
41
+ DebugRowItem (
42
+ key: Keys .debugTargetPlatform,
43
+ title: localization.debugTargetPlatformTitle,
44
+ subTitle: localization.debugTargetPlatformSubtitle (localization.getTranslation (Provider .of <GlobalViewModel >(context).getCurrentPlatform ())),
45
+ onClick: viewModel.onTargetPlatformClicked,
46
+ ),
47
+ DebugRowItem (
48
+ key: Keys .debugThemeMode,
49
+ title: localization.debugThemeModeTitle,
50
+ subTitle: localization.debugThemeModeSubtitle,
51
+ onClick: viewModel.onThemeModeClicked,
52
+ ),
53
+ DebugRowTitle (title: localization.debugLocaleTitle),
54
+ DebugRowItem (
55
+ key: Keys .debugSelectLanguage,
56
+ title: localization.debugLocaleSelector,
57
+ subTitle: localization.debugLocaleCurrentLanguage (Provider .of <GlobalViewModel >(context).getCurrentLanguage ()),
58
+ onClick: viewModel.onSelectLanguageClicked,
59
+ ),
60
+ DebugRowSwitchItem (
61
+ key: Keys .debugShowTranslations,
62
+ title: localization.debugShowTranslations,
63
+ value: Provider .of <GlobalViewModel >(context, listen: false ).showsTranslationKeys,
64
+ onChanged: (_) => Provider .of <GlobalViewModel >(context, listen: false ).toggleTranslationKeys (),
65
+ ),
66
+ DebugRowTitle (title: localization.debugLicensesTitle),
67
+ DebugRowItem (
68
+ key: Keys .debugLicense,
69
+ title: localization.debugLicensesGoTo,
70
+ onClick: viewModel.onLicensesClicked,
71
+ ),
72
+ DebugRowTitle (title: localization.debugDatabase),
73
+ DebugRowItem (
74
+ key: Keys .debugDatabase,
75
+ title: localization.debugViewDatabase,
76
+ onClick: viewModel.goToDatabase,
77
+ ),
78
+ DebugRowTitle (title: localization.debugPermissionsTitle),
79
+ DebugRowItem (
80
+ key: Keys .debugPermissionAnalytics,
81
+ title: localization.debugPermissionsShowAnalyticsPermission,
82
+ onClick: viewModel.goToAnalyticsPermissionScreen,
83
+ ),
84
+ DebugRowItem (
85
+ key: Keys .debugPermissionAnalyticsReset,
86
+ title: localization.debugPermissionResetAnalytics,
87
+ onClick: viewModel.resetAnalyticsPermission,
88
+ ),
89
+ ],
95
90
),
96
91
);
97
92
}
0 commit comments