Skip to content

Commit af3381a

Browse files
committed
loading indicator
1 parent 1baf41a commit af3381a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

lib/widgets/app_drawer.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ class _AppDrawerState extends State<AppDrawer> {
7878
} else {
7979
return InkWell(
8080
splashColor: Colors.red,
81-
onTap: () {
82-
signOut();
81+
onTap: () async {
82+
showDialog(
83+
context: context,
84+
builder: (context) => const Center(
85+
child: CircularProgressIndicator(),
86+
),
87+
);
88+
await signOut();
89+
Navigator.of(context).popUntil((route) => route.isFirst);
8390
Provider.of<AppStateProvider>(context, listen: false)
8491
.updateUserID("");
8592
},

lib/widgets/login_form.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,16 @@ class LoginForm extends StatelessWidget {
8383
"Login",
8484
),
8585
onPressed: () async {
86+
showDialog(
87+
context: context,
88+
builder: (context) => const Center(
89+
child: CircularProgressIndicator(),
90+
),
91+
);
8692
final res = await signIn(
8793
emailController.text, passwordController.text);
94+
Navigator.of(context)
95+
.popUntil((route) => route.isFirst);
8896
if (res == 'Signed In') {
8997
Provider.of<AppStateProvider>(context,
9098
listen: false)

0 commit comments

Comments
 (0)