cancel static method

Widget cancel(
  1. BuildContext context, {
  2. Object? result,
  3. String label = 'Cancel',
})

A neutral action (e.g. "Cancel"). Pops with result.

Implementation

static Widget cancel(
  BuildContext context, {
  Object? result,
  String label = 'Cancel',
}) => TextButton(
  onPressed: () => Navigator.pop(context, result),
  child: Text(label),
);