Highlight current plan
This commit is contained in:
parent
4aa6926f5c
commit
2544a3de9f
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user