From 2544a3de9fa26564afcefdc7a8fa5472cca0e64f Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 28 Nov 2023 14:53:37 +1300 Subject: [PATCH] Highlight current plan --- lib/plan_list.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/plan_list.dart b/lib/plan_list.dart index 408ff6d..3fe346a 100644 --- a/lib/plan_list.dart +++ b/lib/plan_list.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:fmassive/constants.dart'; import 'package:fmassive/database.dart'; import 'package:fmassive/edit_plan.dart'; import 'package:fmassive/main.dart'; @@ -14,11 +15,20 @@ class PlanList extends StatelessWidget { @override Widget build(BuildContext context) { + final weekday = weekdayNames[DateTime.now().weekday - 1]; + return ListView.builder( itemCount: plans.length, itemBuilder: (context, index) { return ListTile( - title: Text(plans[index].days.replaceAll(',', ', ')), + title: Text(plans[index].days.replaceAll(',', ', '), + style: TextStyle( + fontWeight: plans[index].days.contains(weekday) + ? FontWeight.bold + : null, + decoration: plans[index].days.contains(weekday) + ? TextDecoration.underline + : null)), subtitle: Text(plans[index].exercises), onLongPress: () => showDialog( context: context,