11// ignore_for_file: deprecated_member_use, use_build_context_synchronously
2-
3- import 'package:date_format/date_format.dart' ;
42import 'package:flutter/material.dart' ;
53import 'package:google_fonts/google_fonts.dart' ;
64import 'package:intl/intl.dart' ;
7- import 'package:taskwarrior/api_service.dart' ;
85import 'package:taskwarrior/app/utils/app_settings/app_settings.dart' ;
96import 'package:taskwarrior/app/utils/constants/taskwarrior_colors.dart' ;
107import 'package:taskwarrior/app/utils/constants/utilites.dart' ;
118import 'package:taskwarrior/app/utils/themes/theme_extension.dart' ;
129import 'package:taskwarrior/app/utils/language/sentence_manager.dart' ;
10+ import 'package:taskwarrior/app/v3/db/task_database.dart' ;
11+ import 'package:taskwarrior/app/v3/models/task.dart' ;
12+ import 'package:taskwarrior/app/v3/net/modify.dart' ;
1313
1414class TaskDetails extends StatefulWidget {
15- final Tasks task;
15+ final TaskForC task;
1616 const TaskDetails ({super .key, required this .task});
1717
1818 @override
@@ -53,7 +53,8 @@ class _TaskDetailsState extends State<TaskDetails> {
5353
5454 @override
5555 Widget build (BuildContext context) {
56- TaskwarriorColorTheme tColors = Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
56+ TaskwarriorColorTheme tColors =
57+ Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
5758 return WillPopScope (
5859 onWillPop: () async {
5960 if (hasChanges) {
@@ -123,10 +124,18 @@ class _TaskDetailsState extends State<TaskDetails> {
123124 });
124125 }),
125126 _buildDetail ('UUID:' , widget.task.uuid! ),
126- _buildDetail ('${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageUrgency }:' , widget.task.urgency.toString ()),
127- _buildDetail ('${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageEnd }:' , _buildDate (widget.task.end)),
128- _buildDetail ('${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageEntry }:' , _buildDate (widget.task.entry)),
129- _buildDetail ('${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageModified }:' , _buildDate (widget.task.modified)),
127+ _buildDetail (
128+ '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageUrgency }:' ,
129+ widget.task.urgency.toString ()),
130+ _buildDetail (
131+ '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageEnd }:' ,
132+ _buildDate (widget.task.end)),
133+ _buildDetail (
134+ '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageEntry }:' ,
135+ _buildDate (widget.task.entry)),
136+ _buildDetail (
137+ '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .detailPageModified }:' ,
138+ _buildDate (widget.task.modified)),
130139 ],
131140 ),
132141 ),
@@ -206,7 +215,8 @@ class _TaskDetailsState extends State<TaskDetails> {
206215 }
207216
208217 Widget _buildDetail (String label, String value) {
209- TaskwarriorColorTheme tColors = Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
218+ TaskwarriorColorTheme tColors =
219+ Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
210220 return Container (
211221 width: double .infinity,
212222 decoration: BoxDecoration (
@@ -251,7 +261,8 @@ class _TaskDetailsState extends State<TaskDetails> {
251261
252262 Future <String ?> _showEditDialog (
253263 BuildContext context, String label, String initialValue) async {
254- TaskwarriorColorTheme tColors = Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
264+ TaskwarriorColorTheme tColors =
265+ Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
255266 final TextEditingController controller =
256267 TextEditingController (text: initialValue);
257268 return await showDialog <String >(
@@ -260,21 +271,15 @@ class _TaskDetailsState extends State<TaskDetails> {
260271 return Utils .showAlertDialog (
261272 title: Text (
262273 '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .edit } $label ' ,
263- style: TextStyle (
264- color: tColors.primaryTextColor
265- ),
274+ style: TextStyle (color: tColors.primaryTextColor),
266275 ),
267276 content: TextField (
268- style: TextStyle (
269- color: tColors.primaryTextColor
270- ),
277+ style: TextStyle (color: tColors.primaryTextColor),
271278 controller: controller,
272279 decoration: InputDecoration (
273280 hintText:
274281 '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .enterNew } $label ' ,
275- hintStyle: TextStyle (
276- color: tColors.primaryTextColor
277- ),
282+ hintStyle: TextStyle (color: tColors.primaryTextColor),
278283 ),
279284 ),
280285 actions: [
@@ -286,9 +291,7 @@ class _TaskDetailsState extends State<TaskDetails> {
286291 SentenceManager (currentLanguage: AppSettings .selectedLanguage)
287292 .sentences
288293 .cancel,
289- style: TextStyle (
290- color: tColors.primaryTextColor
291- ),
294+ style: TextStyle (color: tColors.primaryTextColor),
292295 ),
293296 ),
294297 TextButton (
@@ -299,9 +302,7 @@ class _TaskDetailsState extends State<TaskDetails> {
299302 SentenceManager (currentLanguage: AppSettings .selectedLanguage)
300303 .sentences
301304 .save,
302- style: TextStyle (
303- color: tColors.primaryTextColor
304- ),
305+ style: TextStyle (color: tColors.primaryTextColor),
305306 ),
306307 ),
307308 ],
@@ -312,26 +313,23 @@ class _TaskDetailsState extends State<TaskDetails> {
312313
313314 Future <String ?> _showSelectDialog (BuildContext context, String label,
314315 String initialValue, List <String > options) async {
315- TaskwarriorColorTheme tColors = Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
316+ TaskwarriorColorTheme tColors =
317+ Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
316318 return await showDialog <String >(
317319 context: context,
318320 builder: (context) {
319321 return Utils .showAlertDialog (
320322 title: Text (
321323 '${SentenceManager (currentLanguage : AppSettings .selectedLanguage ).sentences .select } $label ' ,
322- style: TextStyle (
323- color: tColors.primaryTextColor
324- ),
324+ style: TextStyle (color: tColors.primaryTextColor),
325325 ),
326326 content: Column (
327327 mainAxisSize: MainAxisSize .min,
328328 children: options.map ((option) {
329329 return RadioListTile <String >(
330330 title: Text (
331331 option,
332- style: TextStyle (
333- color: tColors.primaryTextColor
334- ),
332+ style: TextStyle (color: tColors.primaryTextColor),
335333 ),
336334 value: option,
337335 groupValue: initialValue,
@@ -362,7 +360,8 @@ class _TaskDetailsState extends State<TaskDetails> {
362360
363361 Future <UnsavedChangesAction ?> _showUnsavedChangesDialog (
364362 BuildContext context) async {
365- TaskwarriorColorTheme tColors = Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
363+ TaskwarriorColorTheme tColors =
364+ Theme .of (context).extension < TaskwarriorColorTheme > ()! ;
366365 return showDialog <UnsavedChangesAction >(
367366 context: context,
368367 barrierDismissible: false ,
@@ -372,16 +371,13 @@ class _TaskDetailsState extends State<TaskDetails> {
372371 SentenceManager (currentLanguage: AppSettings .selectedLanguage)
373372 .sentences
374373 .unsavedChanges,
375- style: TextStyle (
376- color: tColors.primaryTextColor),
374+ style: TextStyle (color: tColors.primaryTextColor),
377375 ),
378376 content: Text (
379377 SentenceManager (currentLanguage: AppSettings .selectedLanguage)
380378 .sentences
381379 .unsavedChangesWarning,
382- style: TextStyle (
383- color: tColors.primaryTextColor
384- ),
380+ style: TextStyle (color: tColors.primaryTextColor),
385381 ),
386382 actions: < Widget > [
387383 TextButton (
0 commit comments