33import 'dart:developer' ;
44
55import 'package:flutter/material.dart' ;
6+ import 'package:taskwarrior/config/app_settings.dart' ;
67import 'package:taskwarrior/model/storage/storage_widget.dart' ;
78import 'package:taskwarrior/widgets/taskfunctions/taskparser.dart' ;
89import 'package:jiffy/jiffy.dart' ;
@@ -39,6 +40,9 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
3940 const title = 'Add Task' ;
4041
4142 return AlertDialog (
43+ backgroundColor: AppSettings .isDarkMode
44+ ? const Color .fromARGB (255 , 220 , 216 , 216 )
45+ : Colors .white,
4246 title: const Center (child: Text (title)),
4347 content: Form (
4448 key: formKey,
@@ -56,8 +60,8 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
5660 children: [
5761 const Text (
5862 "Due : " ,
59- style:
60- TextStyle ( fontWeight: FontWeight .bold, height: 3.3 ),
63+ style: TextStyle (
64+ fontWeight: FontWeight .bold, height: 3.3 ),
6165 ),
6266 GestureDetector (
6367 onLongPress: () {
@@ -68,9 +72,7 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
6872 backgroundColor: Colors .grey.shade300,
6973 label: Container (
7074 child: Text (
71- (due != null )
72- ? dueString
73- : "null" ,
75+ (due != null ) ? dueString : "null" ,
7476 ),
7577 ),
7678 onPressed: () async {
@@ -88,7 +90,7 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
8890 var time = await showTimePicker (
8991 context: context,
9092 initialTime:
91- TimeOfDay .fromDateTime (initialDate),
93+ TimeOfDay .fromDateTime (initialDate),
9294 );
9395 if (time != null ) {
9496 var dateTime = date.add (
@@ -103,7 +105,8 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
103105 ),
104106 );
105107 due = dateTime.toUtc ();
106- dueString = Jiffy (dateTime).format ('MMM do yyyy, h:mm:ss a' );
108+ dueString = Jiffy (dateTime)
109+ .format ('MMM do yyyy, h:mm:ss a' );
107110 }
108111 }
109112 setState (() {});
@@ -130,7 +133,6 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
130133 }
131134
132135 Widget buildName () => TextFormField (
133-
134136 controller: namecontroller,
135137 decoration: const InputDecoration (
136138 border: OutlineInputBorder (),
@@ -141,43 +143,46 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
141143 : null ,
142144 );
143145 Widget buildPriority () => Column (children: [
144- Row (
145- mainAxisAlignment: MainAxisAlignment .start,
146- crossAxisAlignment: CrossAxisAlignment .center,
147- children: [
148- const Text (
149- 'Priority : ' ,
150- style: TextStyle (fontWeight: FontWeight .bold),
151- textAlign: TextAlign .left,
146+ Row (
147+ mainAxisAlignment: MainAxisAlignment .start,
148+ crossAxisAlignment: CrossAxisAlignment .center,
149+ children: [
150+ const Text (
151+ 'Priority : ' ,
152+ style: TextStyle (fontWeight: FontWeight .bold),
153+ textAlign: TextAlign .left,
154+ ),
155+ DropdownButton <String >(
156+ dropdownColor: AppSettings .isDarkMode
157+ ? const Color .fromARGB (255 , 220 , 216 , 216 )
158+ : Colors .white,
159+ value: priority,
160+ elevation: 16 ,
161+ style: const TextStyle (color: Colors .black),
162+ underline: Container (
163+ height: 1.5 ,
164+ color: Colors .black,
165+ ),
166+ onChanged: (String ? newValue) {
167+ setState (() {
168+ priority = newValue! ;
169+ });
170+ },
171+ items: < String > ['H' , 'M' , 'L' ]
172+ .map <DropdownMenuItem <String >>((String value) {
173+ return DropdownMenuItem <String >(
174+ value: value,
175+ child: Text (' $value ' ),
176+ );
177+ }).toList (),
178+ )
179+ ],
152180 ),
153- DropdownButton <String >(
154- value: priority,
155- elevation: 16 ,
156- style: const TextStyle (color: Colors .black),
157- underline: Container (
158- height: 1.5 ,
159- color: Colors .black,
160- ),
161- onChanged: (String ? newValue) {
162- setState (() {
163- priority = newValue! ;
164- });
165- },
166- items: < String > ['H' , 'M' , 'L' ]
167- .map <DropdownMenuItem <String >>((String value) {
168- return DropdownMenuItem <String >(
169- value: value,
170- child: Text (' $value ' ),
171- );
172- }).toList (),
173- )
174- ],
175- ),
176- ]);
181+ ]);
177182 Widget buildCancelButton (BuildContext context) => TextButton (
178- child: const Text ('Cancel' ),
179- onPressed: () => Navigator .of (context).pop (),
180- );
183+ child: const Text ('Cancel' ),
184+ onPressed: () => Navigator .of (context).pop (),
185+ );
181186
182187 Widget buildAddButton (BuildContext context) {
183188 return TextButton (
0 commit comments