-
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.
Merge pull request #4 from jspmic/development
Major fixes
- Loading branch information
Showing
36 changed files
with
468 additions
and
98 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
org.gradle.parallel=false | ||
org.gradle.download.parallel=false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:soft/custom_widgets.dart'; | ||
import 'package:soft/rest.dart'; | ||
import 'package:soft/screen2.dart' as screen2; | ||
import 'package:soft/movements.dart' as movements; | ||
import 'package:soft/transfert.dart' as transfert; | ||
import 'package:soft/livraison.dart' as livraison; | ||
import 'package:soft/final_page.dart' as final_page; | ||
|
||
void main() => runApp(const Login()); | ||
|
||
class Login extends StatefulWidget { | ||
const Login({super.key}); | ||
|
||
@override | ||
State<Login> createState() => _LoginState(); | ||
} | ||
|
||
class _LoginState extends State<Login> { | ||
@override | ||
void initState() { | ||
initialize(); | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
initialRoute: '/', | ||
routes: { | ||
'/second': (context) => const screen2.Screen2(), | ||
'/movements': (context) => const movements.Movements(), | ||
'/transfert': (context) => const transfert.TransfertScreen(), | ||
'/livraison': (context) => const livraison.LivraisonScreen(), | ||
'/final': (context) => const final_page.Final(), | ||
}, | ||
title: "Soft", | ||
theme: ThemeData( | ||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.lightGreen), | ||
useMaterial3: true, | ||
primarySwatch: Colors.lightGreen), | ||
home: LoginPage() | ||
); | ||
} | ||
} | ||
class LoginPage extends StatefulWidget{ | ||
const LoginPage({super.key}); | ||
|
||
@override | ||
State<LoginPage> createState() => _LoginPageState(); | ||
} | ||
|
||
class _LoginPageState extends State<LoginPage> { | ||
Color? background = Colors.grey[900]; | ||
String username = ""; | ||
|
||
String pssw = ""; | ||
|
||
bool passwordVisible = false; | ||
|
||
Color? fieldColor = Colors.grey[300]; | ||
bool changeTheme = false; | ||
|
||
bool isLoading = false; | ||
bool isaUser = false; | ||
String errormssg = ""; | ||
|
||
final _uname = TextEditingController(); | ||
|
||
final _pssw = TextEditingController(); | ||
|
||
Transfert objTransfert = Transfert(); | ||
Livraison objLivraison = Livraison(); | ||
|
||
void authenticate() async{ | ||
setState(() { | ||
isLoading = false; | ||
errormssg = ""; | ||
}); | ||
isLoading = true; | ||
bool isValidUser = await isUser(_uname.text, _pssw.text); | ||
//bool isValidUser = true; | ||
setState(() { | ||
isLoading = false; | ||
}); | ||
|
||
if (mounted && isValidUser) { | ||
objTransfert.user = _uname.text; | ||
objLivraison.user = _uname.text; | ||
_uname.text = ""; | ||
_pssw.text = ""; | ||
Navigator.pushNamed(context, '/second', | ||
arguments: screen2.ScreenTransition(backgroundColor: background, FieldColor: fieldColor, | ||
changeThemes: changeTheme, objtransfert: objTransfert, objlivraison: objLivraison | ||
) | ||
); | ||
} | ||
else { | ||
setState(() { | ||
errormssg = "Utilisateur non existant !"; | ||
}); | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context){ | ||
return | ||
SizedBox( | ||
width: double.infinity, | ||
height: double.infinity, | ||
child: Scaffold( | ||
appBar: AppBar(title: Align( | ||
alignment: Alignment.topRight, | ||
child: IconButton(onPressed: (){ | ||
setState(() { | ||
background = changeTheme ? Colors.grey[900] : Colors.white; | ||
fieldColor = changeTheme ? Colors.grey[300] : Colors.black; | ||
changeTheme = !changeTheme; | ||
});}, icon: Icon(background == Colors.white ? Icons.dark_mode_outlined | ||
: Icons.light_mode,), style: IconButton.styleFrom( | ||
backgroundColor: Colors.lightGreen)),), | ||
backgroundColor: background, | ||
), | ||
resizeToAvoidBottomInset: true, | ||
backgroundColor: background, | ||
body: Container( | ||
padding: const EdgeInsets.all(20.0), | ||
margin: const EdgeInsets.all(20.0), | ||
child: SingleChildScrollView( | ||
child: Column(children: [ | ||
SizedBox( | ||
height: 40.0, | ||
), | ||
ClipRRect( | ||
borderRadius: BorderRadius.circular(20), | ||
child: Image.asset("assets/icon/drawer2.png", | ||
fit: BoxFit.cover, width: 200, height: 200), | ||
), | ||
SizedBox( | ||
height: 25.0, | ||
), | ||
Text(errormssg, style: TextStyle(color: Colors.red),), | ||
SizedBox(height: 25,), | ||
TextField( | ||
style: TextStyle(color: fieldColor), | ||
controller: _uname, | ||
decoration: InputDecoration( | ||
hintText: "Nom d'utilisateur...", | ||
suffixIcon: Icon(Icons.person_2_rounded)), | ||
cursorColor: Colors.amber, | ||
cursorHeight: 15.0, | ||
cursorWidth: 1.0, | ||
), | ||
const SizedBox(height: 30.0), | ||
TextField( | ||
obscureText: !passwordVisible, | ||
style: TextStyle(color: fieldColor), | ||
controller: _pssw, | ||
decoration: InputDecoration( | ||
hintText: "Mot de passe...", | ||
suffixIcon: IconButton( | ||
icon: Icon(passwordVisible | ||
? Icons.visibility | ||
: Icons.visibility_off), | ||
onPressed: () { | ||
setState(() { | ||
passwordVisible = !passwordVisible; | ||
}); | ||
}, | ||
)), | ||
cursorColor: Colors.amber, | ||
cursorHeight: 15.0, | ||
cursorWidth: 1.0, | ||
), | ||
const SizedBox( | ||
height: 60.0, | ||
), | ||
isLoading ? CircularProgressIndicator() | ||
: ElevatedButton(onPressed: authenticate, | ||
style: ElevatedButton.styleFrom(backgroundColor: Colors.lightGreen), | ||
child: Text("Se connecter", style: TextStyle(color: Colors.black),),), | ||
|
||
])))), | ||
); | ||
} | ||
} |
121 changes: 120 additions & 1 deletion
121
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
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 |
---|---|---|
@@ -1 +1,120 @@ | ||
{"images":[{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"20x20","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"1x"},{"size":"57x57","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"2x"},{"size":"60x60","idiom":"iphone","filename":"[email protected]","scale":"3x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"20x20","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"29x29","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"40x40","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"50x50","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"72x72","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"1x"},{"size":"76x76","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"83.5x83.5","idiom":"ipad","filename":"[email protected]","scale":"2x"},{"size":"1024x1024","idiom":"ios-marketing","filename":"[email protected]","scale":"1x"}],"info":{"version":1,"author":"xcode"}} | ||
{ | ||
"images": [ | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "20x20", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "20x20", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "29x29", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "29x29", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "38x38", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "38x38", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "40x40", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "40x40", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "60x60", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "60x60", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "64x64", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "3x", | ||
"size": "64x64", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "68x68", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "76x76", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "2x", | ||
"size": "83.5x83.5", | ||
"platform": "ios" | ||
}, | ||
{ | ||
"filename": "[email protected]", | ||
"idiom": "universal", | ||
"scale": "1x", | ||
"size": "1024x1024", | ||
"platform": "ios" | ||
} | ||
], | ||
"info": { | ||
"author": "icons_launcher", | ||
"version": 1 | ||
} | ||
} |
Binary file modified
BIN
-16.9 KB
(90%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-176 Bytes
(92%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-294 Bytes
(92%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-252 Bytes
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-435 Bytes
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-409 Bytes
(92%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-587 Bytes
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-587 Bytes
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.06 KB
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-898 Bytes
(92%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-984 Bytes
(93%)
ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.