1- import 'package:flutter/foundation.dart' ;
21import 'package:flutter/material.dart' ;
32
43import 'package:google_fonts/google_fonts.dart' ;
54import 'package:taskwarrior/widgets/taskw.dart' ;
65import 'package:taskwarrior/model/json.dart' ;
76
87class TaskListItem extends StatelessWidget {
9- const TaskListItem (this .task, {this .pendingFilter = false , Key ? key, required this .darkmode})
8+ const TaskListItem (this .task,
9+ {this .pendingFilter = false , Key ? key, required this .darkmode})
1010 : super (key: key);
1111
1212 final Task task;
1313 final bool pendingFilter;
1414 final bool darkmode;
15-
1615
1716 @override
1817 Widget build (BuildContext context) {
19- var colour = darkmode? Colors .white: Colors .black;
18+ var colour = darkmode ? Colors .white : Colors .black;
19+ var dimColor = darkmode
20+ ? const Color .fromARGB (137 , 248 , 248 , 248 )
21+ : const Color .fromARGB (136 , 17 , 17 , 17 );
2022 return ListTile (
23+ leading: Icon (
24+ Icons .circle,
25+ color: task.priority == 'H'
26+ ? Colors .red
27+ : task.priority == 'M'
28+ ? Colors .yellow[600 ]
29+ : Colors .green,
30+ size: 20 ,
31+ semanticLabel: 'Priority' ,
32+ ),
2133 title: Row (
2234 mainAxisAlignment: MainAxisAlignment .spaceBetween,
2335 children: [
2436 Flexible (
2537 child: SingleChildScrollView (
2638 scrollDirection: Axis .horizontal,
2739 child: Text (
28- task.description,
29- style: TextStyle (color: colour,fontFamily: GoogleFonts .firaMono ().fontFamily),
40+ '${(task .id == 0 ) ? '#' : task .id }. ${task .description }' ,
41+ style: TextStyle (
42+ color: colour,
43+ fontFamily: GoogleFonts .firaMono ().fontFamily),
3044 ),
3145 ),
3246 ),
3347 Text (
3448 (task.annotations != null ) ? ' [${task .annotations !.length }]' : '' ,
35- style: TextStyle (color: colour,fontFamily: GoogleFonts .firaMono ().fontFamily),
49+ style: TextStyle (
50+ color: colour, fontFamily: GoogleFonts .firaMono ().fontFamily),
3651 ),
3752 ],
3853 ),
@@ -43,28 +58,27 @@ class TaskListItem extends StatelessWidget {
4358 child: SingleChildScrollView (
4459 scrollDirection: Axis .horizontal,
4560 child: Text (
46- '${(task .id == 0 ) ? '-' : task .id } '
47- '${pendingFilter ? '' : '${task .status [0 ].toUpperCase ()} ' }'
48- '${age (task .entry )} '
49- '${(task .modified != null ) ? 'm:${age (task .modified !)}' : '' } '
50- '${(task .start != null ) ? 'st:${age (task .start !)}' : '' } '
51- '${(task .due != null ) ? 'd:${when (task .due !)}' : '' } '
52- '${task .priority ?? '' } '
53- '${task .project ?? '' } '
54- '[${task .tags ?.join (',' ) ?? '' }]'
61+ '${pendingFilter ? '' : '${task .status [0 ].toUpperCase ()}\n ' }'
62+ 'Last Modified: ${(task .modified != null ) ? age (task .modified !) : ((task .start != null ) ? age (task .start !) : '-' )} | '
63+ 'Due: ${(task .due != null ) ? when (task .due !) : '-' }'
5564 .replaceFirst (RegExp (r' \[\]$' ), '' )
5665 .replaceAll (RegExp (r' +' ), ' ' ),
57- style: TextStyle (color: colour,fontFamily: GoogleFonts .firaMono ().fontFamily),
58-
66+ style: TextStyle (
67+ color: dimColor,
68+ fontFamily: GoogleFonts .firaMono ().fontFamily,
69+ fontSize: 12 ,
70+ overflow: TextOverflow .ellipsis),
5971 ),
6072 ),
6173 ),
6274 Text (
6375 formatUrgency (urgency (task)),
64- style: TextStyle (color: colour,fontFamily: GoogleFonts .firaMono ().fontFamily),
76+ style: TextStyle (
77+ color: colour, fontFamily: GoogleFonts .firaMono ().fontFamily),
6578 ),
6679 ],
6780 ),
81+ // isThreeLine: true,
6882 );
6983 }
7084}
0 commit comments