simplify: dedupe boilerplate and remove dead code across all layers
This commit is contained in:
@@ -3,6 +3,11 @@ part of '../async_action_button.dart';
|
||||
typedef AsyncActionCallback = Future<void> Function();
|
||||
typedef AsyncErrorBuilder = String Function(Object error);
|
||||
|
||||
/// Shared style for the inline error message the async-button family renders
|
||||
/// beneath a control after a caught failure.
|
||||
TextStyle _asyncErrorTextStyle(BuildContext context) =>
|
||||
TextStyle(color: Theme.of(context).colorScheme.error, fontSize: 13);
|
||||
|
||||
/// Wraps [action] with a try/catch that pops up an [InfoDialog] on failure
|
||||
/// (using [errorBuilder] or the default error mapper). Returns `true` on
|
||||
/// success, `false` on caught failure.
|
||||
|
||||
Reference in New Issue
Block a user