jamesblasco / modal_bottom_sheet

Flutter | Create advanced modal bottom sheets. Material, Cupertino or your own style
https://pub.dev/packages/modal_bottom_sheet
MIT License
1.9k stars 479 forks source link

Animations are gone on Android in latest flutter #347

Open lucasjinreal opened 1 year ago

lucasjinreal commented 1 year ago

iOS this push back animation is OK, but android is not work anymore. Please have a look!!

jseminck commented 1 year ago

We are having the same issue.

mariopepe commented 1 year ago

this package is abandoned I think!

lucasjinreal commented 1 year ago

I am so sorry to hear that, this was a wonderful lib and really less maintainance nowadays! @jamesblasco Our whole software stack are depending on this! Please help!

jseminck commented 1 year ago

Yes, there aren't any real alternative that provide the same functionality. Seems we'll have to figure out this one on our own and fork the repo, if needed.

lucasjinreal commented 1 year ago

@jseminck I would suggest fork this repo if anyone much more familliar on flutter than me. I would never using sheeter anymore since the original author doesn't response any on his wonderful lib, just leave millions developers keep issues in their apps. This is really lack of responsibility.

I hear flutter might add this pushing back animation into flutter but no progress anymore, so there might need a new modal_bottom_sheet from community!

xSILENCEx commented 1 year ago

I checked the source code, animation disappearance is caused by accessibility settings:

      ...

    final mediaQuery = MediaQuery.of(context);

    child = AnimatedBuilder(
      animation: widget.animationController,
      builder: (context, Widget? child) {
        assert(child != null);
        final animationValue =
            animationCurve.transform(mediaQuery.accessibleNavigation ? 1.0 : widget.animationController.value);
     ...

So just add it to the MaterialApp builder:

      ...
      builder: (BuildContext ctx, Widget? child) {
        return MediaQuery(
          data: MediaQuery.of(ctx).copyWith(accessibleNavigation: false),
          child: child!,
        );
      },
      ...

Animation is back!

lucasjinreal commented 1 year ago

@xSILENCEx Waaoo! Does it need change model_bottom_sheet source code itself?

xSILENCEx commented 1 year ago

@lucasjinreal No need to change the source code

faridistiqlal commented 1 year ago

anyone who fix animation?

AlexDochioiu commented 1 year ago

For anyone needing it:

I made a fork from main + added the fix from @xSILENCEx (thank you) directly in the library.

  modal_bottom_sheet:
    git:
      url: https://github.com/vespr-wallet/modal_bottom_sheet.git
      path: modal_bottom_sheet
      ref: 48549ad85b0685185e29f2363640621c51741b99

P.S: Some other changes in main to consider: ModalBottomSheetRoute name changed to ModalSheetRoute. You may have to update some parts in your project because of this.