dart format
This commit is contained in:
@@ -26,33 +26,33 @@ class AsyncActionButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _AsyncMixin(
|
||||
onPressed: onPressed,
|
||||
controller: controller,
|
||||
errorBuilder: errorBuilder,
|
||||
onError: onError,
|
||||
onSuccess: onSuccess,
|
||||
builder: (context, busy, handler) {
|
||||
final spinner = AppProgressIndicator.small(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
);
|
||||
final content = busy
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [spinner, const SizedBox(width: 8), child],
|
||||
)
|
||||
: (icon != null
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [Icon(icon), const SizedBox(width: 8), child],
|
||||
)
|
||||
: child);
|
||||
final button = ElevatedButton(
|
||||
onPressed: handler,
|
||||
style: style,
|
||||
child: content,
|
||||
);
|
||||
if (!showInlineError) return button;
|
||||
return _InlineErrorWrapper(controller: controller, child: button);
|
||||
},
|
||||
onPressed: onPressed,
|
||||
controller: controller,
|
||||
errorBuilder: errorBuilder,
|
||||
onError: onError,
|
||||
onSuccess: onSuccess,
|
||||
builder: (context, busy, handler) {
|
||||
final spinner = AppProgressIndicator.small(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
);
|
||||
final content = busy
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [spinner, const SizedBox(width: 8), child],
|
||||
)
|
||||
: (icon != null
|
||||
? Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [Icon(icon), const SizedBox(width: 8), child],
|
||||
)
|
||||
: child);
|
||||
final button = ElevatedButton(
|
||||
onPressed: handler,
|
||||
style: style,
|
||||
child: content,
|
||||
);
|
||||
if (!showInlineError) return button;
|
||||
return _InlineErrorWrapper(controller: controller, child: button);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user