genericizing add card, activity ui tweaks
This commit is contained in:
@ -11,9 +11,11 @@ import 'package:sendtrain/widgets/builders/dialogs.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
|
||||
class MediaCard extends StatelessWidget {
|
||||
const MediaCard({super.key, required this.media, this.callback});
|
||||
const MediaCard(
|
||||
{super.key, required this.media, this.callback, this.canDelete});
|
||||
|
||||
final MediaItem media;
|
||||
final bool? canDelete;
|
||||
final Function? callback;
|
||||
|
||||
@override
|
||||
@ -44,7 +46,9 @@ class MediaCard extends StatelessWidget {
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
shadowColor: const Color.fromARGB(0, 255, 255, 255),
|
||||
child: TextButton(
|
||||
onLongPress: () => showRemovalDialog(
|
||||
onLongPress: () {
|
||||
if (canDelete == true) {
|
||||
showRemovalDialog(
|
||||
'Media Removal',
|
||||
'Would you like to permanently remove this media from the current session?',
|
||||
context, () {
|
||||
@ -55,7 +59,9 @@ class MediaCard extends StatelessWidget {
|
||||
if (callback != null) {
|
||||
callback!();
|
||||
}
|
||||
}),
|
||||
});
|
||||
}
|
||||
},
|
||||
onPressed: () => showMediaDetailWidget(context, media),
|
||||
child: const ListTile(
|
||||
title: Text(''),
|
||||
|
Reference in New Issue
Block a user