more prep work for local data storage
This commit is contained in:
parent
d6e62024d7
commit
13fe7e2ef4
@ -60,33 +60,55 @@ class ActivityCardState extends State<ActivityCard> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: Padding(
|
leading: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 60,
|
width: 60,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
image: findMediaByType(
|
image: findMediaByType(
|
||||||
widget.activity.actions[0].media, 'image')),
|
widget.activity.actions[0].media, 'image')),
|
||||||
// color: Colors.blue,
|
// color: Colors.blue,
|
||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.all(Radius.elliptical(10, 10)),
|
const BorderRadius.all(Radius.elliptical(10, 10)),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
title: Consumer<ActivityTimerModel>(
|
title: Consumer<ActivityTimerModel>(
|
||||||
builder: (context, atm, child) {
|
builder: (context, atm, child) {
|
||||||
if (atm.activity?.id == widget.activity.id) {
|
if (atm.activity?.id == widget.activity.id) {
|
||||||
return Text(
|
return Text(
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
"${widget.activity.title} (${formattedTime(atm.totalTime)})");
|
"${widget.activity.title} (${formattedTime(atm.totalTime)})");
|
||||||
} else {
|
} else {
|
||||||
return Text(maxLines: 1, widget.activity.title);
|
return Text(maxLines: 1, widget.activity.title);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
subtitle: Text(maxLines: 2, widget.activity.description),
|
subtitle: Text(maxLines: 2, widget.activity.description),
|
||||||
),
|
trailing: IconButton(
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
icon: Icon(Icons.close_rounded),
|
||||||
|
onPressed: () {
|
||||||
|
showAdaptiveDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
title: const Text('Activity Removal'),
|
||||||
|
content: const Text('Would you like to permanently remove this activity from the current session?'),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||||
|
child: const Text('Cancel'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, 'OK'),
|
||||||
|
child: const Text('OK'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
@ -214,6 +214,29 @@ class SessionCard extends StatelessWidget {
|
|||||||
)),
|
)),
|
||||||
title: Text(maxLines: 1, data.title),
|
title: Text(maxLines: 1, data.title),
|
||||||
subtitle: Text(maxLines: 1, dateFormat.format(data.date)),
|
subtitle: Text(maxLines: 1, dateFormat.format(data.date)),
|
||||||
|
trailing: IconButton(
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
|
icon: Icon(Icons.close_rounded),
|
||||||
|
onPressed: () {
|
||||||
|
showAdaptiveDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
title: const Text('Session Removal'),
|
||||||
|
content: const Text('Would you like to permanently remove this session?'),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||||
|
child: const Text('Cancel'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.pop(context, 'OK'),
|
||||||
|
child: const Text('OK'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
contentPadding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
contentPadding: const EdgeInsets.fromLTRB(15, 0, 15, 15),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user