From 8cf7301c42ee6646d256022723d0d5cc4f866504 Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:02:59 +0200 Subject: [PATCH 1/6] Image picker lates version Flutter plugin for iOS and Android for picking images from the image library, and taking new pictures with the camera. --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index af1c700..6aa6d33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: sdk: flutter hive: ^2.2.3 hive_flutter: ^1.1.0 - image_picker: ^0.8.6 + image_picker: ^1.0.4 json_annotation: ^4.7.0 path: ^1.8.2 path_provider: ^2.0.11 From 240ea9ff09ab70f9f01235971e4ffef4545e166d Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:04:28 +0200 Subject: [PATCH 2/6] Defines the annotations used by json_serializable to create code for JSON serialization and deserialization. --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 6aa6d33..91fb069 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: sdk: flutter hive: ^2.2.3 hive_flutter: ^1.1.0 - image_picker: ^1.0.4 + json_annotation: ^4.8.1 json_annotation: ^4.7.0 path: ^1.8.2 path_provider: ^2.0.11 From 2905daad92ad9d1d7b0987dc09ca52b123f8b647 Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:05:39 +0200 Subject: [PATCH 3/6] Path package --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 91fb069..5cf6650 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: hive_flutter: ^1.1.0 json_annotation: ^4.8.1 json_annotation: ^4.7.0 - path: ^1.8.2 + path: ^1.8.3 path_provider: ^2.0.11 provider: ^6.0.3 shared_preferences: ^2.0.15 From c0d745039408cecac9843748476bfb84475d4293 Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:06:27 +0200 Subject: [PATCH 4/6] Path provider --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 5cf6650..7402b55 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: json_annotation: ^4.8.1 json_annotation: ^4.7.0 path: ^1.8.3 - path_provider: ^2.0.11 + path_provider: ^2.1.1 provider: ^6.0.3 shared_preferences: ^2.0.15 syncfusion_flutter_pdfviewer: ^20.3.52 From efa39fab311710b88abb4244b57daad043c6d0b6 Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:07:17 +0200 Subject: [PATCH 5/6] Shared Preferences --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7402b55..afb9a4a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,7 +41,7 @@ dependencies: path: ^1.8.3 path_provider: ^2.1.1 provider: ^6.0.3 - shared_preferences: ^2.0.15 + shared_preferences: ^2.2.2 syncfusion_flutter_pdfviewer: ^20.3.52 dev_dependencies: From 042e749beed359e7d40e8e65d8745fac0a55be32 Mon Sep 17 00:00:00 2001 From: Dominique Rwema Bagirishya <52289151+rwema3@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:10:53 +0200 Subject: [PATCH 6/6] New features --- lib/widgets/todo_screen_checker.dart | 34 ++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lib/widgets/todo_screen_checker.dart b/lib/widgets/todo_screen_checker.dart index db6f82e..8378685 100644 --- a/lib/widgets/todo_screen_checker.dart +++ b/lib/widgets/todo_screen_checker.dart @@ -1,25 +1,40 @@ import 'package:flutter/material.dart'; +// Define a callback for when the checkbox value changes typedef OnChangeCallback = void Function(bool checked); class CircularCheckBox extends StatefulWidget { + // Add a new property for the checked color Color color = Colors.white; + // Add a new property for the unchecked color Color uncheckedColor = Colors.blue; + // Specify that key is nullable + final Key? key; + // The initial checked state final bool checked; + // Callback function when the checkbox changes final OnChangeCallback onChange; + // Size of the checkbox double size = 30; + // A label to display next to the checkbox final String str; + // Constructor with named parameters CircularCheckBox({ - super.key, + this.key, required this.checked, required this.onChange, required this.str, }); + @override _CircularCheckBoxState createState() => _CircularCheckBoxState(); } + class _CircularCheckBoxState extends State { + // Add a boolean property to track whether the checkbox is hovered or not + bool isHovered = false; + @override Widget build(BuildContext context) { return Padding( @@ -30,6 +45,12 @@ class _CircularCheckBoxState extends State { onTap: () { widget.onChange(!widget.checked); }, + // Add a MouseRegion to handle hover events + onHover: (value) { + setState(() { + isHovered = value; + }); + }, child: Container( width: widget.size, height: widget.size, @@ -37,11 +58,13 @@ class _CircularCheckBoxState extends State { shape: BoxShape.circle, border: Border.all( width: 1.0, - color: widget.uncheckedColor, + color: isHovered ? Colors.black : widget.uncheckedColor, ), color: widget.checked ? widget.color - : Colors.white, + : isHovered + ? Colors.grey[200] // Change the background color on hover + : Colors.white, ), child: widget.checked ? const Center( @@ -61,8 +84,9 @@ class _CircularCheckBoxState extends State { style: TextStyle( fontWeight: FontWeight.w500, fontSize: 20, - color: widget.checked ? Colors.black:Colors.black38, - ),), + color: widget.checked ? Colors.black : Colors.black38, + ), + ), ], ), );