some polishings
This commit is contained in:
@@ -174,6 +174,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
await User.refreshUserData();
|
||||
|
||||
}
|
||||
DateTime? lastProductive = null;
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
@@ -193,6 +194,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
firstDay = null;
|
||||
lastDay = null;
|
||||
String lastDate = "";
|
||||
lastProductive=null;
|
||||
days = [];
|
||||
for (var element in User.activities) {
|
||||
if (lastDay == null) {
|
||||
@@ -228,6 +230,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
}
|
||||
|
||||
if (element.taskType.cat?.productive ?? false) {
|
||||
if(lastProductive==null){lastProductive = element.trueEndTime;}
|
||||
if (productivtyActs.containsKey(thisDate)) {
|
||||
productivtyActs[thisDate] = (productivtyActs[thisDate]! + thisMinutes);
|
||||
} else {
|
||||
@@ -415,7 +418,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
)
|
||||
: Container(),
|
||||
Container(
|
||||
height: 300,
|
||||
height: 350,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Card(
|
||||
elevation: 8,
|
||||
@@ -470,7 +473,16 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
dataLabelSettings: DataLabelSettings(overflowMode: OverflowMode.hide, showZeroValue: false, isVisible: true),
|
||||
color: Colors.green)
|
||||
]),
|
||||
)
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
if(lastProductive!=null && DateTime.now().difference(lastProductive!).inMinutes > 60)RichText(text: TextSpan(
|
||||
children: <TextSpan>[
|
||||
TextSpan(text: "You haven't been productive in last",style: TextStyle(color:Colors.orange)),
|
||||
TextSpan(text:" ${MinutesToTimeString(DateTime.now().difference(lastProductive!).inMinutes)}",style: TextStyle(color:Colors.redAccent,fontWeight: FontWeight.bold))
|
||||
]
|
||||
))
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user