show static method
void
show({})
-- example implementation
void loading() {
ExLoading.show(context: Get.context!);
Future.delayed(3.seconds).then((value) => ExLoading.dismiss(Get.context!));
}
Implementation
static void show({
bool isDismissible = true,
Widget? child,
Color? barrierColor,
String? message,
double? paddingSymmetric,
}) {
final showCancel = false.obs;
Future.delayed(5.seconds, () {
showCancel.value = true;
});
Get.dialog(
Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: child?.p24() ??
VStack(
[
LoadingAnimationWidget.discreteCircle(
color: Theme.of(Get.context!).primaryColor,
size: 32,
).centered(),
if (message != null)
Text(message, textAlign: TextAlign.center)
.centered()
.pOnly(top: 16),
Obx(
() => showCancel.value == true
? ExButtonOutline(
label: 'Cancel',
height: 40,
onPressed: Get.back,
).pOnly(top: 24).centered()
: Container(),
),
],
).p24(),
).pSymmetric(h: paddingSymmetric ?? 90),
barrierDismissible: isDismissible,
barrierColor: barrierColor,
);
}