show method
Loader
show(
- Widget builder(
- BuildContext context
- String? id,
- Color backgroundColor = Colors.transparent,
- OverlayLayoutTypeEnum type = OverlayLayoutTypeEnum.custom,
- bool dismissible = false,
override
Return an id of the entry in entries.
Implementation
@override
Loader show(
Widget Function(BuildContext context) builder, {
String? id,
Color backgroundColor = Colors.transparent,
OverlayLayoutTypeEnum type = OverlayLayoutTypeEnum.custom,
bool dismissible = false,
}) {
final _id = id ?? const UuidV4().generate();
final loader = Loader(
overlayId: _id,
dismiss: () {
hide(_id);
},
);
final entry = OverlayEntry(
builder: (context) {
final widget = builder(context);
return OverlayLayout(
type: type,
backgroundColor: backgroundColor,
onTap: dismissible
? () async {
await loader.dismiss.call();
}
: null,
child: widget,
);
},
);
insert(_id, entry);
return loader;
}