modal_bottom_sheet icon indicating copy to clipboard operation
modal_bottom_sheet copied to clipboard

Animations are gone on Android in latest flutter

Open lucasjinreal opened this issue 2 years ago • 10 comments

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

lucasjinreal avatar May 07 '23 10:05 lucasjinreal

We are having the same issue.

jseminck avatar May 09 '23 05:05 jseminck

this package is abandoned I think!

mariopepe avatar May 09 '23 11:05 mariopepe

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!

lucasjinreal avatar May 09 '23 13:05 lucasjinreal

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.

jseminck avatar May 09 '23 14:05 jseminck

@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!

lucasjinreal avatar May 10 '23 02:05 lucasjinreal

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!

xSILENCEx avatar May 19 '23 02:05 xSILENCEx

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

lucasjinreal avatar May 19 '23 02:05 lucasjinreal

@lucasjinreal No need to change the source code

xSILENCEx avatar May 19 '23 03:05 xSILENCEx

anyone who fix animation?

faridistiqlal avatar Jul 17 '23 12:07 faridistiqlal

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.

AlexDochioiu avatar Sep 14 '23 18:09 AlexDochioiu