showLoading method

  1. @override
Future<Loader> showLoading({
  1. Widget builder(
    1. BuildContext context
    )?,
  2. bool hasShadow = true,
})
override

Implementation

@override
Future<Loader> showLoading(
    {Widget Function(BuildContext context)? builder,
    bool hasShadow = true}) async {
  final id = _generateLoadingID();
  _requestLoading(
    payload: LoadingRequestPayload(
      id: id,
      type: LoadingRequestType.show,
      hasShadow: hasShadow,
      builder: builder,
    ),
  );
  await Future.delayed(const Duration(milliseconds: 50));
  return Loader(
      overlayId: id,
      dismiss: () async {
        _requestLoading(
          payload: LoadingRequestPayload(
            id: id,
            type: LoadingRequestType.hide,
          ),
        );
      });
}