Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue resizing the json from assets #38

Closed
explorer-source opened this issue Apr 3, 2020 · 2 comments
Closed

Issue resizing the json from assets #38

explorer-source opened this issue Apr 3, 2020 · 2 comments

Comments

@explorer-source
Copy link

I'm trying to work with this as a loader when async function begins https://lottiefiles.com/448-ripple-loading-animation

calling _onLoading() from a button press

_onLoading() {
    showDialog(
        context: context,
        barrierDismissible: false,
        builder: (BuildContext context) {
          return Lottie.asset("assets/animation/loading.json",
              fit: BoxFit.contain, width: 200, height: 200);
    });
}

In the documentation it said it works like a image asset but I think it doesn't :(

@xvrh
Copy link
Owner

xvrh commented Apr 3, 2020

Thanks for the report.
I tried your example and replaced Lottie.asset with a Image.asset and I think I see the same behaviour with Lottie or Image.

Maybe you can try to wrap the content with a Center widget like this?

    showDialog<void>(
      context: context,
      builder: (context) => Center(
        child: Lottie.network(
            'https://assets10.lottiefiles.com/datafiles/QeC7XD39x4C1CIj/data.json',
            fit: BoxFit.contain,
            width: 200,
            height: 200),
      ),
    );

@explorer-source
Copy link
Author

Thanks it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants