-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a proper registration method implemented
- Loading branch information
Showing
4 changed files
with
49 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'package:cleanifi/constants/routes.dart'; | ||
import 'package:firebase_auth/firebase_auth.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
class VerifyEmailView extends StatefulWidget { | ||
const VerifyEmailView({super.key}); | ||
|
||
@override | ||
State<VerifyEmailView> createState() => _VerifyEmailViewState(); | ||
} | ||
|
||
class _VerifyEmailViewState extends State<VerifyEmailView> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text("Verify your email"), | ||
), | ||
body: Column( | ||
children: [ | ||
const Text( | ||
"We've send a verifiction email to email address. Please check your email and verify your account"), | ||
const Text( | ||
"Not received any email yet, press the button below to send the email again"), | ||
TextButton( | ||
onPressed: () async { | ||
final user = FirebaseAuth.instance.currentUser; | ||
await user?.sendEmailVerification(); | ||
}, | ||
child: const Text("Send email verification"), | ||
), | ||
TextButton( | ||
onPressed: () async { | ||
await FirebaseAuth.instance.signOut(); | ||
Navigator.of(context).pushNamedAndRemoveUntil( | ||
registerRoute, | ||
(route) => false, | ||
); | ||
}, | ||
child: const Text("Restart"), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |