achievement crud complete
This commit is contained in:
@ -24,8 +24,7 @@ class ActivityCard extends StatefulWidget {
|
||||
class ActivityCardState extends State<ActivityCard> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ActivityTimerModel atm =
|
||||
Provider.of<ActivityTimerModel>(context);
|
||||
final ActivityTimerModel atm = Provider.of<ActivityTimerModel>(context);
|
||||
|
||||
return FutureBuilder<List<MediaItem>>(
|
||||
future: MediaItemsDao(Provider.of<AppDatabase>(context))
|
||||
@ -48,7 +47,8 @@ class ActivityCardState extends State<ActivityCard> {
|
||||
ListTile(
|
||||
// visualDensity: VisualDensity(horizontal: VisualDensity.maximumDensity),
|
||||
leading: CardImage(
|
||||
image: findMediaByType(mediaItems, MediaType.image)),
|
||||
image:
|
||||
findMediaByType(mediaItems, MediaType.image)),
|
||||
title: Consumer<ActivityTimerModel>(
|
||||
builder: (context, atm, child) {
|
||||
if (atm.activity?.id == widget.activity.id) {
|
||||
@ -76,15 +76,14 @@ class ActivityCardState extends State<ActivityCard> {
|
||||
icon: Icon(Icons.close_rounded),
|
||||
onPressed: () {
|
||||
showRemovalDialog(
|
||||
'Activity Removal',
|
||||
'Would you like to permanently remove this activity from the current session?',
|
||||
context,
|
||||
ActivitiesDao(
|
||||
Provider.of<AppDatabase>(
|
||||
context,
|
||||
listen: false)),
|
||||
widget.activity)
|
||||
.then((result) {
|
||||
'Activity Removal',
|
||||
'Would you like to permanently remove this activity from the current session?',
|
||||
context, () {
|
||||
ActivitiesDao(Provider.of<AppDatabase>(
|
||||
context,
|
||||
listen: false))
|
||||
.remove(widget.activity);
|
||||
}).then((result) {
|
||||
setState(() {});
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user