-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot.dart
37 lines (31 loc) · 977 Bytes
/
forgot.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
class Forgot extends StatefulWidget {
const Forgot({super.key});
@override
State<Forgot> createState() => _ForgotState();
}
class _ForgotState extends State<Forgot> {
TextEditingController email=TextEditingController();
reset()async{
await FirebaseAuth.instance.sendPasswordResetEmail(email: email.text);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Forgot password"),),
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
TextField(
controller: email,
decoration: const InputDecoration(hintText: "enter email"),
),
ElevatedButton(onPressed: (()=>reset()), child: const Text("Send Link"))
],
),
),
);
}
}