Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
medapp_eksad
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qorri_di
medapp_eksad
Commits
163106e3
Commit
163106e3
authored
Sep 05, 2022
by
rizky ramadhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forget
parent
3736c03c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
29 deletions
+86
-29
forget_password.dart
lib/auth/forget_password.dart
+86
-29
No files found.
lib/auth/forget_password.dart
View file @
163106e3
import
'
package:flutter/material.da
rt'
;
import
'
dart:conve
rt'
;
import
'package:flutter/material.dart'
;
import
'package:http/http.dart'
as
http
;
import
'package:medapp_eksad/widget/button_color.dart'
;
class
ForgotPassword
extends
StatefulWidget
{
const
ForgotPassword
({
Key
?
key
})
:
super
(
key:
key
);
...
...
@@ -9,9 +12,13 @@ class ForgotPassword extends StatefulWidget {
}
class
_ForgotPasswordState
extends
State
<
ForgotPassword
>
{
final
formKey
=
GlobalKey
<
FormState
>();
final
_formKey
=
GlobalKey
<
FormState
>();
String
email
=
''
;
final
nameController
=
TextEditingController
();
final
phoneController
=
TextEditingController
();
final
emailController
=
TextEditingController
();
final
messageController
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
return
Stack
(
...
...
@@ -24,39 +31,89 @@ class _ForgotPasswordState extends State<ForgotPassword> {
),
Padding
(
padding:
const
EdgeInsets
.
all
(
21.0
),
child:
ElevatedButton
(
onPressed:
(){
Navigator
.
pushNamed
(
context
,
'/login'
);
},
child:
Icon
(
Icons
.
arrow_back
)),
child:
ElevatedButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'/login'
);
},
child:
Icon
(
Icons
.
arrow_back
)),
),
Center
(
child:
AlertDialog
(
title:
Text
(
'Find your account'
),
content:
Form
(
key:
formKey
,
child:
TextFormField
(
textAlign:
TextAlign
.
start
,
decoration:
InputDecoration
(
labelText:
"Enter your email address"
,
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
)),
),
onChanged:
(
value
)
=>
email
=
value
,
child:
AlertDialog
(
title:
Text
(
'Find your account'
),
content:
Form
(
key:
formKey
,
child:
TextFormField
(
textAlign:
TextAlign
.
start
,
controller:
emailController
,
decoration:
InputDecoration
(
labelText:
"Enter your email address"
,
hintStyle:
const
TextStyle
(),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
5.0
)),
),
// onChanged: (value) => email = value,
),
actions:
<
Widget
>[
),
actions:
<
Widget
>[
TextButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'dashboard'
);
},
child:
const
Text
(
'Send'
),
TextButton
(
onPressed:
()
{
Navigator
.
pushNamed
(
context
,
'dashboard'
);
},
child:
const
Text
(
'Send'
),
),
],
)
),
// onPressed: () async {
// if (_formKey.currentState!.validate()) {
// final response = await SendEmail(
// nameController.value.text,
// phoneController.value.text,
// emailController.value.text,
// messageController.value.text);
// ScaffoldMessenger.of(context).showSnackBar(
// response == 200
// ? const SnackBar(
// content: Text('Message Sent!'),
// backgroundColor: Colors.green)
// : const SnackBar(
// content: Text('Failed to send message!'),
// backgroundColor: Colors.red),
// );
// nameController.clear();
// phoneController.clear();
// emailController.clear();
// messageController.clear();
// }
// },
// child: const Text('Send'),
),
],
)),
],
);
}
}
// Future SendEmail(
// String name, String phone, String email, String message) async {
// final url = Uri.parse('https://api.emailjs.com/api/v1.0/email/send');
// const serviceId = 'service_wava70j';
// const templateId = 'template_koc73cj';
// const userId = 'h4BmDnyWlm3OziBDx';
// final response = await http.post(url,
// headers: {
// 'Content-Type': 'application/json'
// }, //This line makes sure it works for all platforms.
// body: json.encode({
// 'service_id': serviceId,
// 'template_id': templateId,
// 'user_id': userId,
// 'template_params': {
// 'from_name': name,
// 'from_phone': phone,
// 'to_email': email,
// 'message': message
// }
// }));
// return response.statusCode;
// }
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment