mmcc007/modal_progress_hud

Migrate to null safety please?

Opened this issue ยท 16 comments

Alternative to this package is this loading_overlay.

Alternative to this package is this loading_overlay.

right link > loading_overlay

Alternative to this package is this loading_overlay.

right link > loading_overlay

Ahhh yes my bad, edited my link to the right one. Thanks!

Any news?

@EgHubs I found that someone published a null-safe version of the same package here: https://pub.dev/packages/modal_progress_hud_nsn

https://pub.dev/packages/modal_progress_hud_nsn is not a good alternative because it only supports iOS and Android. I just created a null-safety clone of this package which as it is a clone it has support for all flutter supported platforms not only for Android and iOS.
Here:
modal_progress_hud_alt

I also made a PR40

@mmcc007 Any timeline on merging the null safety PR? Appreciate your work, and that of @luis901101 !

In my case Loading_Overlay also didn't worked , please don't try that ....That too ( Loading Overlay) does not support Null Safety
Watch this

The amount of code necessary for this plugin to work is just a few lines, I recommend for those who needs some specific behavior to checkout at the source code at https://github.com/luis901101/modal_progress_hud_alt which is alreeady null-safe and copy from there. It is literally a widget.

@Lakhankumawat what version are you using it on? Because loading_overlay is on null safety and I'm using it right now. Please check your configuration.

Thanks to @luis901101 for his modal_progress_hud_alt it worked in my case after using lots of loading progress indicator. Thanks again @luis901101 . You are awesome

this is the null safety version

`import 'package:flutter/material.dart';

class ModalProgressHUD extends StatelessWidget {
  final bool inAsyncCall;
  final double opacity;
  final Color color;
  final Widget progressIndicator;
  Offset? offset;
  final bool dismissible;
  final Widget child;

  ModalProgressHUD({
    Key? key,
    required this.inAsyncCall,
    this.opacity = 0.3,
    this.color = Colors.grey,
    this.progressIndicator = const CircularProgressIndicator(),
    this.offset,
    this.dismissible = false,
    required this.child,
  })  : assert(child != null),
        assert(inAsyncCall != null),
        super(key: key);

  @override
  Widget build(BuildContext context) {
    if (!inAsyncCall) return child;

    Widget layOutProgressIndicator;
    if (offset == null)
      layOutProgressIndicator = Center(child: progressIndicator);
    else {
      layOutProgressIndicator = Positioned(
        child: progressIndicator,
        left: offset!.dx,
        top: offset!.dy,
      );
    }

    return new Stack(
      children: [
        child,
        new Opacity(
          child: new ModalBarrier(dismissible: dismissible, color: color),
          opacity: opacity,
        ),
        layOutProgressIndicator,
      ],
    );
  }
}
`

Is this repo abandoned by the original maintainers?

Is this repo abandoned by the original maintainers?

yes, Its been a while since it was updated.
Anyways feel free to check this out. It's an upgraded one

@mmcc007 you ok? Can you please push this update?