- séparation des taches faite et non,

- rapettisage de la taille des taches
This commit is contained in:
2023-10-10 20:20:27 +02:00
parent 979fcfa2a1
commit 7d391194f5
13 changed files with 141 additions and 42 deletions

1
.gitignore vendored
View File

@@ -32,7 +32,6 @@
/build/ /build/
# Web related # Web related
lib/generated_plugin_registrant.dart
# Symbolication related # Symbolication related
app.*.symbols app.*.symbols

View File

@@ -21,6 +21,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0'
} }
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
@@ -43,18 +49,41 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.todo" applicationId "com.kaelstudio.todo"
minSdkVersion flutter.minSdkVersion minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
ndk {
debugSymbolLevel 'FULL'
}
} }
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build.
ndk {
debugSymbolLevel 'FULL'
}
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
} }
} }
} }

View File

@@ -1,12 +1,12 @@
buildscript { buildscript {
ext.kotlin_version = '1.3.50' ext.kotlin_version = '1.6.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }

View File

@@ -4,3 +4,4 @@ distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
org.gradle.jvmargs=-Xmx1536M --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED

21
deployment_cert.der Normal file
View File

@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDizCCAnOgAwIBAgIELKNhuDANBgkqhkiG9w0BAQsFADB1MQswCQYDVQQGEwJm
cjETMBEGA1UECBMKdmFsIGQnb2lzZTEYMBYGA1UEBxMPdmlsbGllcnMgbGUgYmVs
MRMwEQYDVQQKEwprYWVsc3R1ZGlvMRMwEQYDVQQLEwprYWVsc3R1ZGlvMQ0wCwYD
VQQDEwRrYWVsMCAXDTIzMDkyOTE2MTcwM1oYDzIwNTEwMjE0MTYxNzAzWjB1MQsw
CQYDVQQGEwJmcjETMBEGA1UECBMKdmFsIGQnb2lzZTEYMBYGA1UEBxMPdmlsbGll
cnMgbGUgYmVsMRMwEQYDVQQKEhttps://developer.android.com/studio/publish/app-signing?hl=frwprYWVsc3R1ZGlvMRMwEQYDVQQLEwprYWVsc3R1
ZGlvMQ0wCwYDVQQDEwRrYWVsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
AQEAhdixS6ZRPbsJFZX19VwZVCYZMcNgPHOmCHm1F/08ULTEzHImjCswgZhgfLey
oB5h9vgOFXw8nzlj9/8/RnQMhUNv90rL28aRpG4qOqkpnKztjCA2rrcaYuXA3l82
3IQFO1FUKIZ2FnAL8h1P31OvBrAOTbgdKeOAClYF0h5NvYfQAeBYayKpQz2cQQ5C
K5nX3HbBeTIw3z6nQHnY85DA2BJPclR3ZBPGPppDbNFos6TSZpQk9Ro5Dk8NbKRY
J8B0aFY6VMTz3danpdZvK9oJQ2KK/EiX9UoRxjIykexxF5C5U2szoEQmHwKkcOMO
hIW91qFhH7ymHvByz/HI/29gDQIDAQABoyEwHzAdBgNVHQ4EFgQUTzO7LFDHBN8a
4YFu/sWgXgvBpdcwDQYJKoZIhvcNAQELBQADggEBAGYargwG85QwN6TWAuiV3gjs
/F2Axoe2rMYkg4mqh53M0qbqOZagY5cCzOShTe7wnd5+VXZ1yYr3M/PliGbzXald
gf8LpJb8LvpR8z3/EcO9FnsJAREncU4DYIzUynzfReAekOPizP4yL0XBPChf6jtk
C5EkFm0u2vAMgHkt6pGsWGynvPi/S8JILb09uyye5xBtBrTB8j0MIJ85/3Qfv8t0
7x+KDkQ7qx9tu17PM+rF+XO9O0h4/giWsZJmVXIR/DBDNhXy+8RaqWKOjgLgG4vo
Q3tCtivp7ywDmSIQRgk2N8heLgRFJZb/3TB8kHTnUQqG9i8pemeAgXRRmqhyByo=
-----END CERTIFICATE-----

View File

@@ -6,7 +6,7 @@ void main() async {
//init hive //init hive
await Hive.initFlutter(); await Hive.initFlutter();
//open the box //open the box
var box = await Hive.openBox('todoBox'); await Hive.openBox('todoBox');
runApp(const MyApp()); runApp(const MyApp());
} }
@@ -23,11 +23,12 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: 'Todo', title: 'Tody',
debugShowCheckedModeBanner: false,
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.red, primarySwatch: Colors.red,
), ),
home: const MyHomePage(title: 'Ma liste de tache'), home: const MyHomePage(title: 'Tody'),
); );
} }
} }

View File

@@ -23,7 +23,6 @@ class _MyHomePageState extends State<MyHomePage> {
@override @override
void initState() { void initState() {
// TODO: implement initState
// first time // first time
if (_myBox.get('todos') == null) { if (_myBox.get('todos') == null) {
db.createInitialData(); db.createInitialData();
@@ -74,17 +73,43 @@ class _MyHomePageState extends State<MyHomePage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text(widget.title), title: Text(widget.title),
centerTitle: true,
), ),
body: ListView.builder( body: Column(
children: [
Expanded(
child: ListView.builder(
itemCount: db.todoList.length, itemCount: db.todoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ToDoTile( return db.todoList[index][1] == false
? ToDoTile(
taskName: db.todoList[index][0], taskName: db.todoList[index][0],
taskCompleted: db.todoList[index][1], taskCompleted: db.todoList[index][1],
onChanged: (value) => checkBoxChanged(value, index), onChanged: (value) => checkBoxChanged(value, index),
deleteFunction: (context) => deleteTask(index), deleteFunction: (context) => deleteTask(index),
); )
: SizedBox.shrink();
}), }),
),
Text(
"Tache complété : ${db.todoList.where((element) => element[1] == true).length}"),
//task completed
Expanded(
child: ListView.builder(
itemCount: db.todoList.length,
itemBuilder: (context, index) {
return db.todoList[index][1] == true
? ToDoTile(
taskName: db.todoList[index][0],
taskCompleted: db.todoList[index][1],
onChanged: (value) => checkBoxChanged(value, index),
deleteFunction: (context) => deleteTask(index),
)
: Container();
}),
),
],
),
floatingActionButton: FloatingActionButton( floatingActionButton: FloatingActionButton(
onPressed: createNewTask, onPressed: createNewTask,
tooltip: 'Increment', tooltip: 'Increment',

View File

@@ -2,39 +2,54 @@ import 'package:flutter/material.dart';
import 'package:todo/utils/my_button.dart'; import 'package:todo/utils/my_button.dart';
class DialogBox extends StatelessWidget { class DialogBox extends StatelessWidget {
DialogBox( const DialogBox(
{Key? key, {Key? key,
required this.controller, required this.controller,
required this.onSave, required this.onSave,
required this.onCancel}) required this.onCancel})
: super(key: key); : super(key: key);
final controller; final TextEditingController controller;
VoidCallback onSave; final VoidCallback onSave;
VoidCallback onCancel; final VoidCallback onCancel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AlertDialog( return AlertDialog(
backgroundColor: Theme.of(context).primaryColor, backgroundColor: Theme.of(context).primaryColor,
title: Text("New Task"), title: const Text(
content: Container( "Nouvelle tache",
style: TextStyle(color: Colors.white),
),
content: SizedBox(
height: 120, height: 120,
child: Column( child: Column(
children: [ children: [
TextField( TextField(
controller: controller, controller: controller,
decoration: InputDecoration( autofocus: true,
border: OutlineInputBorder(), hintText: "Add new task"), style: const TextStyle(color: Colors.white),
decoration: const InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white),
), ),
SizedBox( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white),
),
border: OutlineInputBorder(
gapPadding: 4, borderSide: BorderSide(color: Colors.white)),
hintText: "Ajouter une tache",
hintStyle: TextStyle(color: Colors.white),
),
),
const SizedBox(
height: 40, height: 40,
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
MyButton(text: "Cancel", onPressed: onCancel), MyButton(text: "Annuler", onPressed: onCancel),
MyButton(text: "Save", onPressed: onSave), MyButton(text: "Sauvegarder", onPressed: onSave),
], ],
) )
], ],

View File

@@ -1,18 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MyButton extends StatelessWidget { class MyButton extends StatelessWidget {
MyButton({Key? key, required this.text, required this.onPressed}) const MyButton({Key? key, required this.text, required this.onPressed})
: super(key: key); : super(key: key);
final String text; final String text;
VoidCallback onPressed; final VoidCallback onPressed;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialButton( return MaterialButton(
onPressed: onPressed, onPressed: onPressed,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
child: Text(text), child: Text(text, style: const TextStyle(color: Colors.white)),
); );
} }
} }

View File

@@ -18,27 +18,28 @@ class ToDoTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.fromLTRB(25.0, 25, 25, 0), padding: const EdgeInsets.fromLTRB(15.0, 15, 15, 0),
child: Slidable( child: Slidable(
endActionPane: ActionPane( endActionPane: ActionPane(
motion: StretchMotion(), motion: const StretchMotion(),
children: [ children: [
SlidableAction( SlidableAction(
onPressed: deleteFunction, onPressed: deleteFunction,
icon: Icons.delete, icon: Icons.delete,
backgroundColor: const Color.fromARGB(255, 249, 137, 135), backgroundColor: Color.fromARGB(255, 249, 137, 135),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
) )
], ],
), ),
child: Container( child: Container(
padding: EdgeInsets.all(24.0), padding: const EdgeInsets.all(10.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
taskName, taskName,
style: TextStyle( style: TextStyle(
color: Colors.white,
decoration: taskCompleted decoration: taskCompleted
? TextDecoration.lineThrough ? TextDecoration.lineThrough
: TextDecoration.none), : TextDecoration.none),
@@ -46,12 +47,19 @@ class ToDoTile extends StatelessWidget {
Checkbox( Checkbox(
value: taskCompleted, value: taskCompleted,
onChanged: onChanged, onChanged: onChanged,
activeColor: Colors.redAccent, side:
MaterialStateBorderSide.resolveWith((states) => BorderSide(
width: 2,
color: Colors.white,
)),
focusColor: Colors.white,
checkColor: Colors.white,
activeColor: taskCompleted ? Colors.grey : Colors.redAccent,
) )
], ],
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: taskCompleted ? Colors.grey : Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
), ),

View File

@@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1 version: 1.0.1+11
environment: environment:
sdk: ">=2.15.1 <3.0.0" sdk: ">=2.15.1 <3.0.0"

BIN
upload-keystore.jks Normal file

Binary file not shown.

BIN
upload-keystore.jks.old Normal file

Binary file not shown.