1

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),
          ),
        ),
helloitsme3
  • 259
  • 3
  • 13

1 Answers1

1

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!,
          ),
    ),