Error:
The argument type 'void Function()' can't be assigned to the parameter type 'void Function(BuildContext)?'.
Code
return Slidable(
endActionPane: ActionPane(
motion: ScrollMotion(),
children: <Widget>[
SlidableAction(
label: 'Delete',
foregroundColor: Colors.white,
backgroundColor: Colors.red,
icon: Icons.delete,
onPressed: () => database.deleteGoal(itemGoal),
),
],
),
function form moore_database.dart
Future deleteGoal(Goal goal) => delete(goals).delete(goal);
How should I approach this problem I have read that I should change method for VoidCallback, but what is correct solution with defining in good manner database methods.
Instead of,
Put the
context.