Compare commits
No commits in common. "0f40c3e225cc806c9b54b0fd1e71441cd8bfd666" and "83c65be6107f98fa398a59939706fc79de489cd2" have entirely different histories.
0f40c3e225
...
83c65be610
@ -3,7 +3,6 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import '../pages/EditProfile.dart';
|
import '../pages/EditProfile.dart';
|
||||||
import '../pages/ListItemMenu.dart';
|
|
||||||
import 'alert.dart';
|
import 'alert.dart';
|
||||||
|
|
||||||
import '../variable/globals.dart' as globals;
|
import '../variable/globals.dart' as globals;
|
||||||
@ -95,10 +94,7 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog {
|
|||||||
leading: Icon(Icons.home),
|
leading: Icon(Icons.home),
|
||||||
title: Text('Home'),
|
title: Text('Home'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushReplacement(
|
Navigator.pop(context); // Close the drawer
|
||||||
context, MaterialPageRoute(builder: (_) => ListItemMenu()));
|
|
||||||
|
|
||||||
/// Close the drawer
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -96,12 +96,10 @@ class _EditProfileState extends State<EditProfile>
|
|||||||
var confirmedPassword = inputPasswordConfirmed.text;
|
var confirmedPassword = inputPasswordConfirmed.text;
|
||||||
var birth = DateTime.parse(formatDate(inputBirth.text));
|
var birth = DateTime.parse(formatDate(inputBirth.text));
|
||||||
|
|
||||||
if ((password.isNotEmpty) && (confirmedPassword.isNotEmpty)) {
|
|
||||||
if (password != confirmedPassword) {
|
if (password != confirmedPassword) {
|
||||||
showAlertDialog(context, "Erreur", "Mot de passe different");
|
showAlertDialog(context, "Erreur", "Mot de passe different");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var urlPut = Uri.parse("${globals.api}/users/me");
|
var urlPut = Uri.parse("${globals.api}/users/me");
|
||||||
|
|
||||||
@ -120,14 +118,11 @@ class _EditProfileState extends State<EditProfile>
|
|||||||
'firstName': firstName,
|
'firstName': firstName,
|
||||||
'password': password,
|
'password': password,
|
||||||
'email': email,
|
'email': email,
|
||||||
'roles': '',
|
'birth': birth
|
||||||
'birth': birth.toString()
|
|
||||||
}));
|
}));
|
||||||
print(responsePut.statusCode);
|
print(responsePut.statusCode);
|
||||||
if (responsePut.statusCode == 200) {
|
if (responsePut.statusCode == 200) {
|
||||||
showEventDialog(context, "Votre utilisateur a été modifié");
|
showEventDialog(context, "Votre utilisateur a été modifié");
|
||||||
Navigator.pushReplacement(
|
|
||||||
context, MaterialPageRoute(builder: (_) => EditProfile()));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +321,7 @@ class _EditProfileState extends State<EditProfile>
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Modifier le profil',
|
'Ajouter',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 25),
|
style: TextStyle(color: Colors.white, fontSize: 25),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user