notify
continuous-integration/drone/push Build is passing Details

messagerie_lucas_test
Lucas DELANIER 3 years ago
parent af850b03ad
commit ba51e73079

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

@ -32,4 +32,9 @@ class Controller{
this.currentUser?.usernameDafl = newName;
}
}
void changePasswordCourant(String newPass){
if(newPass !=null){
this.currentUser?.passwDafl = newPass;
}
}
}

@ -385,91 +385,166 @@ class _SplashState extends State<Splash> {
);
}
}
Object errorNotify(int index, context){
Object Notify(int index, context, {bool isError = true}){
String message;
switch(index){
case 0: {
message = "Ce nom d'utilisateur existe déjà ! Veuillez réessayer.";
break;
}
case 1: {
message = "Mots de passe différents ! Veuillez réessayer.";
break;
}
case 2: {
message = "Identifiant incorrect ! Veuillez réessayer.";
break;
}
case 3: {
message = "Mot de passe incorrect ! Votre mot de passe doit contenir 8 caractères minimum.";
break;
}
case 4: {
message = "Mot de passe incorrect ! Veuillez réessayer.";
break;
if(isError == true){
switch(index){
case 0: {
message = "Ce nom d'utilisateur existe déjà ! Veuillez réessayer.";
break;
}
case 1: {
message = "Mots de passe différents ! Veuillez réessayer.";
break;
}
case 2: {
message = "Identifiant incorrect ! Veuillez réessayer.";
break;
}
case 3: {
message = "Mot de passe incorrect ! Votre mot de passe doit contenir 8 caractères minimum.";
break;
}
case 4: {
message = "Mot de passe incorrect ! Veuillez réessayer.";
break;
}
default:
message = "Une erreur est survenue pendant l'inscription. Veuillez réessayer.";
break;
}
default:
message = "Une erreur est survenue pendant l'inscription. Veuillez réessayer.";
break;
return ScaffoldMessenger.of(context).showSnackBar( SnackBar(
dismissDirection: DismissDirection.down,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
elevation: 0,
content: Stack(
clipBehavior: Clip.none,
children: [
Container(
padding: EdgeInsets.all(16),
height: 90,
child: Row(
children: [
Container(
height: 48,
width: 48,
),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Oh oh !", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
Text(message,style: TextStyle(
),
overflow: TextOverflow.ellipsis,
maxLines: 2,),
],
),),
],
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/backgroundNotify.png"),
fit: BoxFit.cover),
gradient: LinearGradient(colors: [Color(0xFF81052a),Color(0xFF810548)],begin: Alignment.topLeft, end: Alignment.bottomRight),
borderRadius: BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 10,
offset: Offset(4, 8), // Shadow position
),
],
),
),
Positioned(
top: -50,
left: -20,
child: Container(
color: Colors.transparent,
height: 110,
width: 110,
child: riv.RiveAnimation.asset("assets/images/error_icon.riv"),)),
],
)
));
}
return ScaffoldMessenger.of(context).showSnackBar( SnackBar(
dismissDirection: DismissDirection.down,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
elevation: 0,
content: Stack(
clipBehavior: Clip.none,
children: [
else{
switch(index){
case 0: {
message = "Vous avez changer votre identifiant avec succès";
break;
}
case 1: {
message = "Vous avez changer votre mot de passe avec succès";
break;
}
default:
message = "L'opération a bien été éxécutée";
break;
Container(
padding: EdgeInsets.all(16),
height: 90,
child: Row(
children: [
Container(
height: 48,
width: 48,
),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Oh oh !", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
Text(message,style: TextStyle(
),
overflow: TextOverflow.ellipsis,
maxLines: 2,),
],
),),
],
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/backgroundNotify.png"),
fit: BoxFit.cover),
gradient: LinearGradient(colors: [Color(0xFF81052a),Color(0xFF810548)],begin: Alignment.topLeft, end: Alignment.bottomRight),
borderRadius: BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 10,
offset: Offset(4, 8), // Shadow position
),
],
}
return ScaffoldMessenger.of(context).showSnackBar( SnackBar(
dismissDirection: DismissDirection.down,
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.transparent,
elevation: 0,
content: Stack(
clipBehavior: Clip.none,
children: [
Container(
padding: EdgeInsets.all(16),
height: 90,
child: Row(
children: [
Container(
height: 48,
width: 48,
),
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Super !", style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),),
Text(message,style: TextStyle(
),
overflow: TextOverflow.ellipsis,
maxLines: 2,),
],
),),
],
),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/valid_background.png"),
fit: BoxFit.cover),
gradient: LinearGradient(colors: [Color(0xFF81052a),Color(0xFF810548)],begin: Alignment.topLeft, end: Alignment.bottomRight),
borderRadius: BorderRadius.all(Radius.circular(20)),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 10,
offset: Offset(4, 8), // Shadow position
),
],
),
),
),
Positioned(
top: -50,
left: -20,
child: Container(
color: Colors.transparent,
height: 110,
width: 110,
child: riv.RiveAnimation.asset("assets/images/error_icon.riv"),)),
],
)
));
Positioned(
top: -50,
left: -20,
child: Container(
color: Colors.transparent,
height: 110,
width: 110,
child: riv.RiveAnimation.asset("assets/images/valid_icon.riv"),)),
],
)
));
}
}

@ -83,7 +83,10 @@ class _DiscoveryListState extends State<DiscoveryList> {
itemBuilder: (context, index){
int itemCount = MyApp().controller.currentUser.Discovery.length ?? 0;
int reversedIndex = itemCount - 1 - index;
return Dismissible(key: Key(MyApp().controller.currentUser.Discovery[reversedIndex].name), child: Container(
return Dismissible(
key: Key(MyApp().controller.currentUser.Discovery[reversedIndex].name),
direction: DismissDirection.startToEnd,
child: Container(
margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
padding: EdgeInsets.fromLTRB(30, 0, 30, 0),
child: Column(
@ -124,9 +127,12 @@ class _DiscoveryListState extends State<DiscoveryList> {
)
), onDismissed: (direction) {
MyApp().controller.currentUser.Discovery.removeAt(reversedIndex);
if(direction == DismissDirection.startToEnd)
MyApp().controller.currentUser.Discovery.removeAt(reversedIndex);
},
background: Container(color: Colors.red,),);
background: Container(decoration: BoxDecoration(
image: DecorationImage(image: AssetImage("assets/images/delete_background.png"), fit: BoxFit.cover),
)),);
}
), onRefresh: () async {
refreshList();

@ -74,8 +74,8 @@ class _SettingsWidgetState extends State<SettingsWidget> {
Spacer(),
GestureDetector(
onTap: () {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
MyApp().controller.changeUsernameCourant(userNameTextField.text);
Notify(0,context,isError: false);
},
child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
child: Text('modifier',
@ -128,6 +128,8 @@ class _SettingsWidgetState extends State<SettingsWidget> {
Spacer(),
GestureDetector(
onTap: () {
MyApp().controller.changePasswordCourant(passwordTextField.text);
Notify(1,context,isError: false);
},
child: Padding(padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
child: Text('modifier',

@ -230,10 +230,10 @@ class _SignInPageState extends State<SignInPage> {
void checkInformations(String username,String password){
if(username ==""){
errorNotify(2, context);
Notify(2, context);
}
else if(password ==""){
errorNotify(4, context);
Notify(4, context);
}
else{
MyApp().controller.changeCurrentUser(MyApp().controller.createUser(userNameTextField.text, passwordTextField.text));

@ -299,16 +299,16 @@ class _SignUpPageState extends State<SignUpPage> {
void checkInformations(String username,String password, String confirmPassword){
if(username ==""){
errorNotify(2, context);
Notify(2, context);
}
else if(password =="" || confirmPassword == ""){
errorNotify(4, context);
Notify(4, context);
}
else if(password.length <8){
errorNotify(2, context);
Notify(2, context);
}
else if(password != confirmPassword){
errorNotify(1, context);
Notify(1, context);
}
else{
MyApp().controller.createUser(userNameTextField.text, passwordConfirmTextField.text);

Loading…
Cancel
Save