File tree Expand file tree Collapse file tree 4 files changed +32
-32
lines changed
Expand file tree Collapse file tree 4 files changed +32
-32
lines changed Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
22
33class LoadingScreen extends StatelessWidget {
4- final bool isLoading;
54 final Color ? color;
65
76 const LoadingScreen ({
87 super .key,
9- required this .isLoading,
108 this .color,
119 });
1210
1311 @override
1412 Widget build (BuildContext context) {
15- return Positioned .fill (
16- child: isLoading
17- ? Container (
18- color: Colors .transparent,
19- child: Center (
20- child: SizedBox (
21- width: 24 ,
22- height: 24 ,
23- child: CircularProgressIndicator (
24- color: color,
25- ),
26- ),
27- ),
28- )
29- : const SizedBox .shrink (),
13+ return Container (
14+ color: Theme .of (context).colorScheme.primaryContainer.withAlpha (50 ),
15+ child: Center (
16+ child: SizedBox (
17+ width: 24 ,
18+ height: 24 ,
19+ child: CircularProgressIndicator (
20+ color: color,
21+ ),
22+ ),
23+ ),
3024 );
3125 }
3226}
Original file line number Diff line number Diff line change @@ -18,17 +18,14 @@ class LoginPage extends StatelessWidget {
1818
1919 @override
2020 Widget build (BuildContext context) {
21- return Stack (
22- children: [
23- Scaffold (
24- appBar: AppBar (),
25- backgroundColor: context.theme.colorScheme.surface,
26- body: Padding (
21+ return Scaffold (
22+ body: Stack (
23+ children: [
24+ Padding (
2725 padding: EdgeInsets .all (spacing.m),
2826 child: Column (
2927 mainAxisAlignment: MainAxisAlignment .center,
3028 children: [
31- const _Loading (),
3229 const AppThemeSwitch (),
3330 SizedBox (height: spacing.m),
3431 SizedBox (
@@ -50,8 +47,9 @@ class LoginPage extends StatelessWidget {
5047 ],
5148 ),
5249 ),
53- ),
54- ],
50+ const _Loading (),
51+ ],
52+ ),
5553 );
5654 }
5755}
@@ -63,8 +61,15 @@ class _Loading extends StatelessWidget {
6361 Widget build (BuildContext context) {
6462 return BlocBuilder <AuthCubit , Resource >(
6563 builder: (context, state) {
66- return LoadingScreen (
67- isLoading: state is RLoading ,
64+ if (state is ! RLoading ) {
65+ return const SizedBox .shrink ();
66+ }
67+
68+ return Container (
69+ color: Colors .black.withAlpha (50 ),
70+ width: double .maxFinite,
71+ height: double .maxFinite,
72+ child: const LoadingScreen (),
6873 );
6974 },
7075 );
Original file line number Diff line number Diff line change @@ -5,9 +5,6 @@ packages:
55 - modules/*
66
77scripts :
8- run:web :
9- exec : cd app && flutter run -t lib/main.dart --dart-define-from-file=env/.dev -d chrome
10- description : Run the app in development mode for web.
118 lint:all :
129 run : melos run analyze && melos run format
1310 description : Run all static analysis checks.
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ packages:
55 - modules/*
66
77scripts :
8+ run:web :
9+ description : Run the app in development mode for web.
10+ run : melos exec --scope="app" -- \
11+ flutter run -t lib/main.dart --dart-define-from-file=env/.dev -d chrome
812 lint:all :
913 run : melos run analyze && melos run format
1014 description : Run all static analysis checks.
@@ -38,4 +42,4 @@ scripts:
3842 description : Run `dart doctor` in selected or all packages. Includes prompt for packages.
3943 packageFilters :
4044 dirExists :
41- - lib
45+ - lib
You can’t perform that action at this time.
0 commit comments