mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 13:13:44 +02:00
fix: change default layout builder to be a widget
This commit is contained in:
parent
62a130e3d6
commit
9a524184f1
1 changed files with 16 additions and 7 deletions
|
@ -24,8 +24,7 @@ class AvailabilityOptions {
|
||||||
this.colors = const AvailabilityColors(),
|
this.colors = const AvailabilityColors(),
|
||||||
this.confirmationDialogBuilder = DefaultConfirmationDialog.builder,
|
this.confirmationDialogBuilder = DefaultConfirmationDialog.builder,
|
||||||
this.timePickerBuilder,
|
this.timePickerBuilder,
|
||||||
// TODO(Joey): Also have a DefaultLoader.builder
|
this.loadingIndicatorBuilder = DefaultLoader.builder,
|
||||||
this.loadingIndicatorBuilder = defaultLoader,
|
|
||||||
AvailabilityDataInterface? dataInterface,
|
AvailabilityDataInterface? dataInterface,
|
||||||
}) : dataInterface = dataInterface ?? LocalAvailabilityDataInterface();
|
}) : dataInterface = dataInterface ?? LocalAvailabilityDataInterface();
|
||||||
|
|
||||||
|
@ -200,8 +199,18 @@ typedef ConfirmationDialogBuilder = Future<bool?> Function(
|
||||||
required String description,
|
required String description,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
///
|
||||||
|
class DefaultLoader extends StatelessWidget {
|
||||||
|
///
|
||||||
|
const DefaultLoader({super.key});
|
||||||
|
|
||||||
/// Builder definition for providing a loading indicator implementation
|
/// Builder definition for providing a loading indicator implementation
|
||||||
Widget defaultLoader(
|
static Widget builder(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
) =>
|
) =>
|
||||||
|
const DefaultLoader();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) =>
|
||||||
const CircularProgressIndicator.adaptive();
|
const CircularProgressIndicator.adaptive();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue