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,46 @@
|
||||
part of '../async_action_button.dart';
|
||||
|
||||
class AsyncIconButton extends StatelessWidget {
|
||||
final AsyncActionCallback? onPressed;
|
||||
final IconData icon;
|
||||
final Color? color;
|
||||
final String? tooltip;
|
||||
final AsyncActionController? controller;
|
||||
final AsyncErrorBuilder? errorBuilder;
|
||||
final void Function(String message)? onError;
|
||||
final VoidCallback? onSuccess;
|
||||
|
||||
const AsyncIconButton({
|
||||
required this.onPressed,
|
||||
required this.icon,
|
||||
this.color,
|
||||
this.tooltip,
|
||||
this.controller,
|
||||
this.errorBuilder,
|
||||
this.onError,
|
||||
this.onSuccess,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => _AsyncMixin(
|
||||
onPressed: onPressed,
|
||||
controller: controller,
|
||||
errorBuilder: errorBuilder,
|
||||
onError: onError,
|
||||
onSuccess: onSuccess,
|
||||
builder: (context, busy, handler) {
|
||||
if (busy) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: AppProgressIndicator.small(color: color),
|
||||
);
|
||||
}
|
||||
return IconButton(
|
||||
icon: Icon(icon, color: color),
|
||||
tooltip: tooltip,
|
||||
onPressed: handler,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user