refactored broad range of the application, split files, modularized calendar and file views, centralized bottom sheets and clipboard handling, and implemented unit test coverage
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
part of '../async_action_button.dart';
|
||||
|
||||
class AsyncFab extends StatelessWidget {
|
||||
final AsyncActionCallback? onPressed;
|
||||
final IconData icon;
|
||||
final Color? backgroundColor;
|
||||
final Color? foregroundColor;
|
||||
final Object? heroTag;
|
||||
final AsyncActionController? controller;
|
||||
final AsyncErrorBuilder? errorBuilder;
|
||||
final void Function(String message)? onError;
|
||||
final VoidCallback? onSuccess;
|
||||
final bool mini;
|
||||
|
||||
const AsyncFab({
|
||||
required this.onPressed,
|
||||
required this.icon,
|
||||
this.backgroundColor,
|
||||
this.foregroundColor,
|
||||
this.heroTag,
|
||||
this.controller,
|
||||
this.errorBuilder,
|
||||
this.onError,
|
||||
this.onSuccess,
|
||||
this.mini = false,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _AsyncMixin(
|
||||
onPressed: onPressed,
|
||||
controller: controller,
|
||||
errorBuilder: errorBuilder,
|
||||
onError: onError,
|
||||
onSuccess: onSuccess,
|
||||
builder: (context, busy, handler) {
|
||||
final fg = foregroundColor ?? Theme.of(context).colorScheme.onPrimary;
|
||||
return FloatingActionButton(
|
||||
heroTag: heroTag,
|
||||
backgroundColor: backgroundColor,
|
||||
foregroundColor: fg,
|
||||
mini: mini,
|
||||
onPressed: handler,
|
||||
child: busy ? AppProgressIndicator.small(color: fg) : Icon(icon),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user