@@ -4,7 +4,7 @@ import 'package:flutter_template/di/injectable.dart';
4
4
import 'package:flutter_template/styles/theme_dimens.dart' ;
5
5
import 'package:flutter_template/util/keys.dart' ;
6
6
import 'package:flutter_template/viewmodel/login/login_viewmodel.dart' ;
7
- import 'package:flutter_template/widget/general/status_bar .dart' ;
7
+ import 'package:flutter_template/widget/general/simple_screen/base_screen .dart' ;
8
8
import 'package:flutter_template/widget/general/styled/flutter_template_button.dart' ;
9
9
import 'package:flutter_template/widget/general/styled/flutter_template_input_field.dart' ;
10
10
import 'package:flutter_template/widget/general/styled/flutter_template_progress_indicator.dart' ;
@@ -26,57 +26,46 @@ class LoginScreenState extends State<LoginScreen> {
26
26
Widget build (BuildContext context) {
27
27
return ProviderWidget <LoginViewModel >(
28
28
create: () => getIt ()..init (),
29
- consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => StatusBar .animated (
30
- isDarkStyle: theme.isDarkTheme,
31
- child: Scaffold (
32
- backgroundColor: theme.colorsTheme.background,
33
- body: SafeArea (
34
- child: Container (
35
- width: double .infinity,
36
- padding: const EdgeInsets .all (ThemeDimens .padding16),
37
- child: Column (
38
- children: [
39
- Container (height: ThemeDimens .padding16),
40
- Text (
41
- 'Login' ,
42
- style: theme.coreTextTheme.titleNormal,
43
- textAlign: TextAlign .center,
44
- ),
45
- Container (height: ThemeDimens .padding32),
46
- Text (
47
- 'Just fill in some text. There is no validator for the login' ,
48
- style: theme.coreTextTheme.labelButtonSmall,
49
- ),
50
- Container (height: ThemeDimens .padding32),
51
- FlutterTemplateInputField (
52
- key: Keys .emailInput,
53
- enabled: ! viewModel.isLoading,
54
- onChanged: viewModel.onEmailUpdated,
55
- hint: 'Email' ,
56
- ),
57
- Container (height: ThemeDimens .padding16),
58
- FlutterTemplateInputField (
59
- key: Keys .passwordInput,
60
- enabled: ! viewModel.isLoading,
61
- onChanged: viewModel.onPasswordUpdated,
62
- hint: 'Password' ,
63
- ),
64
- Container (height: ThemeDimens .padding16),
65
- if (viewModel.isLoading) ...[
66
- const FlutterTemplateProgressIndicator .light (),
67
- ] else ...[
68
- FlutterTemplateButton (
69
- key: Keys .loginButton,
70
- isEnabled: viewModel.isLoginEnabled,
71
- text: 'Login' ,
72
- onClick: viewModel.onLoginClicked,
73
- ),
74
- ],
75
- ],
76
- ),
77
- ),
29
+ consumerWithThemeAndLocalization: (context, viewModel, child, theme, localization) => BaseScreen (
30
+ showHeader: false ,
31
+ children: [
32
+ Container (height: ThemeDimens .padding16),
33
+ Text (
34
+ 'Login' ,
35
+ style: theme.coreTextTheme.titleNormal,
36
+ textAlign: TextAlign .center,
37
+ ),
38
+ Container (height: ThemeDimens .padding32),
39
+ Text (
40
+ 'Just fill in some text. There is no validator for the login' ,
41
+ style: theme.coreTextTheme.labelButtonSmall,
42
+ ),
43
+ Container (height: ThemeDimens .padding32),
44
+ FlutterTemplateInputField (
45
+ key: Keys .emailInput,
46
+ enabled: ! viewModel.isLoading,
47
+ onChanged: viewModel.onEmailUpdated,
48
+ hint: 'Email' ,
78
49
),
79
- ),
50
+ Container (height: ThemeDimens .padding16),
51
+ FlutterTemplateInputField (
52
+ key: Keys .passwordInput,
53
+ enabled: ! viewModel.isLoading,
54
+ onChanged: viewModel.onPasswordUpdated,
55
+ hint: 'Password' ,
56
+ ),
57
+ Container (height: ThemeDimens .padding16),
58
+ if (viewModel.isLoading) ...[
59
+ const FlutterTemplateProgressIndicator .light (),
60
+ ] else ...[
61
+ FlutterTemplateButton (
62
+ key: Keys .loginButton,
63
+ isEnabled: viewModel.isLoginEnabled,
64
+ text: 'Login' ,
65
+ onClick: viewModel.onLoginClicked,
66
+ ),
67
+ ],
68
+ ],
80
69
),
81
70
);
82
71
}
0 commit comments