Why this matters
Prevents drift in copy, button order, and analytics hooks.
Centralize repeated dialog creation/action handlers into a helper to ensure consistent UX and error handling.
Prevents drift in copy, button order, and analytics hooks.
Side-by-side examples engineers can pattern-match during review.
showDialog(context: ctx, builder: (_) => AlertDialog(actions: [TextButton(onPressed: onOk, child: Text('OK'))])); // repeated many timesFuture<void> showOkDialog(BuildContext c, String msg, VoidCallback onOk) {
return showDialog(
context: c,
builder: (_) => AlertDialog(content: Text(msg), actions: [TextButton(onPressed: onOk, child: const Text('OK'))]),
);
}AlertDialog(...) duplicatedshowOkDialog(context, 'msg', onOk)From the same buckets as this rule.