Skip to content

Commit

Permalink
Merge pull request #4 from jspmic/development
Browse files Browse the repository at this point in the history
Major fixes
  • Loading branch information
jspmic authored Nov 8, 2024
2 parents dcb49f8 + 776ddc5 commit eb68a78
Show file tree
Hide file tree
Showing 36 changed files with 468 additions and 98 deletions.
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ android {
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_17
}

defaultConfig {
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:label="Soft"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Binary file added android/app/src/main/ic_launcher-playstore.png
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 android/app/src/main/res/mipmap-hdpi/ic_launcher.png
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 android/app/src/main/res/mipmap-mdpi/ic_launcher.png
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 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
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 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
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 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions android/gradle.properties
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
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
186 changes: 186 additions & 0 deletions bin/soft.dart
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 ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
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
}
}
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 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 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 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 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 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 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 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.
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 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 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

0 comments on commit eb68a78

Please sign in to comment.