How to expand Rive animation in Flutter?
349
Just adding height and width to his parent Container and add a fit(cover, fill, whatever you need) to your Rive widget
Container(
width: w,
height: h,
child: Rive(
fit: BoxFit.cover,
artboard: ctrl.globalArtboard!,
),
),
Author by
helloitsme3
Updated on December 01, 2022Comments
-
helloitsme3 over 1 year
I want to make rive animation background and feel whole screen. Changing height and width to MediaQuery... does not work. It changes size but proportion stays the same
This is how rive widget looks like for me:
Center( child: _riveArtboard == null ? const SizedBox() : Rive(artboard: _riveArtboard), ),
thank you in advance
edit: SOLUTION
Container( height: h, width: w, child: Center( child: _riveArtboard == null ? const SizedBox() : Rive(fit: BoxFit.fill, artboard: _riveArtboard), ), ),
-
Yeasin Sheikh over 2 yearsHave you got the solution?
-
helloitsme3 over 2 yearsyes, after a few tries and posting quests, I got it
-
Ibrahim Yildirim over 2 years@helloitsme3 can you please post your answer on the thread? You can mark your own answers as accepted and help other people with this issue :)
-
helloitsme3 over 2 years@IbrahimYildirim I edited question, there is solution in description :)
-