@@ -26,6 +26,7 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
2626 DateTime ? due;
2727 String dueString = '' ;
2828 String priority = 'M' ;
29+ bool use24hourFormate = false ;
2930 final tagcontroller = TextEditingController ();
3031 List <String > tags = [];
3132
@@ -75,6 +76,10 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
7576 buildDueDate (context),
7677 const SizedBox (height: 8 ),
7778 buildPriority (),
79+ const SizedBox (
80+ height: 8 ,
81+ ),
82+ buildformate (),
7883 buildTags (),
7984 ],
8085 ),
@@ -217,7 +222,12 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
217222 onSurface: Colors .black,
218223 ),
219224 ),
220- child: child! ,
225+ child: MediaQuery (
226+ data: MediaQuery .of (context).copyWith (
227+ alwaysUse24HourFormat: use24hourFormate,
228+ ),
229+ child: child! ),
230+ );
221231 );
222232 },
223233 fieldHintText: "Month/Date/Year" ,
@@ -351,6 +361,40 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
351361 ),
352362 ],
353363 );
364+ Widget buildformate () {
365+ return Row (mainAxisAlignment: MainAxisAlignment .start, children: [
366+ Text (
367+ 'Click to Choose:' ,
368+ style: GoogleFonts .poppins (
369+ fontWeight: FontWeight .bold,
370+ color: AppSettings .isDarkMode ? Colors .white : Colors .black,
371+ ),
372+ ),
373+ const SizedBox (
374+ width: 5.0 ,
375+ ),
376+ Wrap (
377+ spacing: 5.0 ,
378+ children: List <Widget >.generate (
379+ 1 ,
380+ (int index) {
381+ return ChoiceChip (
382+ label: const Text (
383+ '24hour' ,
384+ ),
385+ selected: use24hourFormate,
386+ onSelected: (bool ? selected) {
387+ if (selected != use24hourFormate) {
388+ setState (() {
389+ use24hourFormate = selected! ;
390+ });
391+ }
392+ });
393+ },
394+ ),
395+ )
396+ ]);
397+ }
354398
355399 Widget buildCancelButton (BuildContext context) => TextButton (
356400 child: Text (
0 commit comments