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, ), ], ); } }