You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

7 months ago
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class RecordActionPane extends StatelessWidget {
const RecordActionPane({
super.key,
this.onDelete,
this.onEdit,
});
final VoidCallback? onDelete;
final VoidCallback? onEdit;
@override
ActionPane build(BuildContext context) {
return ActionPane(
motion: const BehindMotion(),
//dismissible: DismissiblePane(onDismissed: () {}),
children: [
SlidableAction(
onPressed: (context) {
onEdit?.call();
},
backgroundColor: Colors.green,
foregroundColor: Colors.white,
icon: Icons.edit,
label: AppLocalizations.of(context)!.edit,
),
SlidableAction(
onPressed: (context) {
onDelete?.call();
},
backgroundColor: Colors.red,
foregroundColor: Colors.white,
icon: Icons.delete,
label: AppLocalizations.of(context)!.delete,
),
],
);
}
}