From 83fade8950c5a42a502187c3fde87aa1a0d2c212 Mon Sep 17 00:00:00 2001 From: its-me-abhishek Date: Thu, 16 Nov 2023 13:31:09 +0530 Subject: [PATCH 1/4] Add task theme change fix --- lib/widgets/add_Task.dart | 66 +++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/lib/widgets/add_Task.dart b/lib/widgets/add_Task.dart index b1a05bd4..a7992bff 100644 --- a/lib/widgets/add_Task.dart +++ b/lib/widgets/add_Task.dart @@ -1,8 +1,7 @@ -// ignore_for_file: use_build_context_synchronously, library_private_types_in_public_api, file_names - import 'dart:developer'; import 'package:flutter/material.dart'; +import 'package:flutter_launcher_icons/xml_templates.dart'; import 'package:get/get.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -48,10 +47,15 @@ class _AddTaskBottomSheetState extends State { return Center( child: SingleChildScrollView( child: AlertDialog( - backgroundColor: AppSettings.isDarkMode - ? const Color.fromARGB(255, 220, 216, 216) - : Colors.white, - title: const Center(child: Text(title)), + backgroundColor: AppSettings.isDarkMode ? Colors.black : Colors.white, + title: Center( + child: Text( + title, + style: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), + ), + ), content: Form( key: formKey, child: SizedBox( @@ -80,8 +84,11 @@ class _AddTaskBottomSheetState extends State { Widget buildName() => TextFormField( controller: namecontroller, - decoration: const InputDecoration( + decoration: InputDecoration( hintText: 'Enter Task', + hintStyle: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), ), validator: (name) => name != null && name.isEmpty ? 'You cannot leave this field empty!' @@ -93,6 +100,7 @@ class _AddTaskBottomSheetState extends State { Text( "Due : ", style: GoogleFonts.poppins( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, fontWeight: FontWeight.bold, height: 3.3, ), @@ -100,25 +108,19 @@ class _AddTaskBottomSheetState extends State { Expanded( child: GestureDetector( child: TextFormField( + style: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), readOnly: true, controller: TextEditingController( - text: (due != null) ? dueString : "Select due date", + text: (due != null) ? dueString : " Select due date", ), decoration: InputDecoration( hintText: 'Select due date', - errorText: (due == null) ? 'Due date is required' : null, - enabledBorder: const UnderlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 1.0, - ), - ), - focusedBorder: const UnderlineInputBorder( - borderSide: BorderSide( - color: Colors.black, - width: 1.0, - ), + hintStyle: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, ), + errorText: (due == null) ? 'Due date is required' : null, ), validator: (name) => name != null && name.isEmpty ? 'due date is required' @@ -180,16 +182,20 @@ class _AddTaskBottomSheetState extends State { children: [ Text( 'Priority : ', - style: GoogleFonts.poppins(fontWeight: FontWeight.bold), + style: GoogleFonts.poppins( + fontWeight: FontWeight.bold, + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), textAlign: TextAlign.left, ), DropdownButton( - dropdownColor: AppSettings.isDarkMode - ? const Color.fromARGB(255, 220, 216, 216) - : Colors.white, + dropdownColor: + AppSettings.isDarkMode ? Colors.black : Colors.white, value: priority, elevation: 16, - style: GoogleFonts.poppins(color: Colors.black), + style: GoogleFonts.poppins( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), underline: Container( height: 1.5, color: Colors.black, @@ -228,9 +234,8 @@ class _AddTaskBottomSheetState extends State { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: const Text( 'Due date cannot be empty. Please select a due date.'), - backgroundColor: AppSettings.isDarkMode - ? const Color.fromARGB(255, 61, 61, 61) - : const Color.fromARGB(255, 39, 39, 39), + backgroundColor: + AppSettings.isDarkMode ? Colors.black : Colors.white, duration: const Duration(seconds: 2), )); return; @@ -250,9 +255,8 @@ class _AddTaskBottomSheetState extends State { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: const Text('Task Added Successfully, Tap to Edit'), - backgroundColor: AppSettings.isDarkMode - ? const Color.fromARGB(255, 61, 61, 61) - : const Color.fromARGB(255, 39, 39, 39), + backgroundColor: + AppSettings.isDarkMode ? Colors.black : Colors.white, duration: const Duration(seconds: 2), )); From 78d0255f9352a8fd646cca2998ec8da3c734f8eb Mon Sep 17 00:00:00 2001 From: its-me-abhishek Date: Thu, 16 Nov 2023 15:55:44 +0530 Subject: [PATCH 2/4] UI fixes --- lib/views/home/home.dart | 2 +- lib/widgets/add_Task.dart | 37 +++++++++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/lib/views/home/home.dart b/lib/views/home/home.dart index 74925afd..51dd8bdd 100644 --- a/lib/views/home/home.dart +++ b/lib/views/home/home.dart @@ -11,7 +11,7 @@ import 'package:taskwarrior/drawer/filter_drawer.dart'; import 'package:taskwarrior/drawer/nav_drawer.dart'; import 'package:taskwarrior/model/storage/storage_widget.dart'; import 'package:taskwarrior/taskserver/ntaskserver.dart'; -import 'package:taskwarrior/widgets/add_Task.dart'; +import 'package:taskwarrior/widgets/add_task.dart'; import 'package:taskwarrior/widgets/buildTasks.dart'; import 'package:taskwarrior/widgets/pallete.dart'; import 'package:taskwarrior/widgets/tag_filter.dart'; diff --git a/lib/widgets/add_Task.dart b/lib/widgets/add_Task.dart index a7992bff..a0061fea 100644 --- a/lib/widgets/add_Task.dart +++ b/lib/widgets/add_Task.dart @@ -1,7 +1,4 @@ -import 'dart:developer'; - import 'package:flutter/material.dart'; -import 'package:flutter_launcher_icons/xml_templates.dart'; import 'package:get/get.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -17,7 +14,6 @@ import 'package:taskwarrior/widgets/taskw.dart'; class AddTaskBottomSheet extends StatefulWidget { const AddTaskBottomSheet({Key? key}) : super(key: key); - @override _AddTaskBottomSheetState createState() => _AddTaskBottomSheetState(); } @@ -47,7 +43,12 @@ class _AddTaskBottomSheetState extends State { return Center( child: SingleChildScrollView( child: AlertDialog( - backgroundColor: AppSettings.isDarkMode ? Colors.black : Colors.white, + surfaceTintColor: AppSettings.isDarkMode + ? const Color.fromARGB(255, 25, 25, 25) + : Colors.white, + backgroundColor: AppSettings.isDarkMode + ? const Color.fromARGB(255, 25, 25, 25) + : Colors.white, title: Center( child: Text( title, @@ -84,6 +85,9 @@ class _AddTaskBottomSheetState extends State { Widget buildName() => TextFormField( controller: namecontroller, + style: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), decoration: InputDecoration( hintText: 'Enter Task', hintStyle: TextStyle( @@ -189,8 +193,9 @@ class _AddTaskBottomSheetState extends State { textAlign: TextAlign.left, ), DropdownButton( - dropdownColor: - AppSettings.isDarkMode ? Colors.black : Colors.white, + dropdownColor: AppSettings.isDarkMode + ? const Color.fromARGB(255, 25, 25, 25) + : Colors.white, value: priority, elevation: 16, style: GoogleFonts.poppins( @@ -198,7 +203,9 @@ class _AddTaskBottomSheetState extends State { ), underline: Container( height: 1.5, - color: Colors.black, + color: AppSettings.isDarkMode + ? const Color.fromARGB(255, 25, 25, 25) + : Colors.white, ), onChanged: (String? newValue) { setState(() { @@ -219,7 +226,12 @@ class _AddTaskBottomSheetState extends State { ); Widget buildCancelButton(BuildContext context) => TextButton( - child: const Text('Cancel'), + child: Text( + 'Cancel', + style: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), + ), onPressed: () => Navigator.of(context).pop("cancel"), ); @@ -227,7 +239,12 @@ class _AddTaskBottomSheetState extends State { WidgetController widgetController = Get.put(WidgetController(context)); return TextButton( - child: const Text("Add"), + child: Text( + "Add", + style: TextStyle( + color: AppSettings.isDarkMode ? Colors.white : Colors.black, + ), + ), onPressed: () async { if (formKey.currentState!.validate()) { if (due == null) { From 3486f610e20d5e20f29d5e96e9f3c337742cc613 Mon Sep 17 00:00:00 2001 From: its-me-abhishek Date: Thu, 16 Nov 2023 16:15:54 +0530 Subject: [PATCH 3/4] UI Bug fixes --- lib/widgets/add_Task.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/widgets/add_Task.dart b/lib/widgets/add_Task.dart index a0061fea..d86ed703 100644 --- a/lib/widgets/add_Task.dart +++ b/lib/widgets/add_Task.dart @@ -1,3 +1,7 @@ +// ignore_for_file: library_private_types_in_public_api, use_build_context_synchronously, file_names + +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:google_fonts/google_fonts.dart'; From d5aa6f02013439df510fd5f59ab0275e0f991dc7 Mon Sep 17 00:00:00 2001 From: its-me-abhishek Date: Thu, 16 Nov 2023 16:18:31 +0530 Subject: [PATCH 4/4] Fix imports --- lib/views/home/home.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/views/home/home.dart b/lib/views/home/home.dart index 51dd8bdd..74925afd 100644 --- a/lib/views/home/home.dart +++ b/lib/views/home/home.dart @@ -11,7 +11,7 @@ import 'package:taskwarrior/drawer/filter_drawer.dart'; import 'package:taskwarrior/drawer/nav_drawer.dart'; import 'package:taskwarrior/model/storage/storage_widget.dart'; import 'package:taskwarrior/taskserver/ntaskserver.dart'; -import 'package:taskwarrior/widgets/add_task.dart'; +import 'package:taskwarrior/widgets/add_Task.dart'; import 'package:taskwarrior/widgets/buildTasks.dart'; import 'package:taskwarrior/widgets/pallete.dart'; import 'package:taskwarrior/widgets/tag_filter.dart';