How to bypass Artboard in flutter (Rive)

379 views Asked by At

How to bypass artboard?
I want to move my button bottom the screen a little
I use bottomNavigationBar but my button it high from bottom screen

Example image Click Here

bottomNavigationBar: Row(
    children: [
      Expanded(
        child: GestureDetector(
          child: SizedBox(
            width: 190,
            height: 190,
            child: FlareActor(
              'assets/Plus_Animation_Button.flr',
              animation: 'Stay',
              controller: _Animation_Plus,
              sizeFromArtboard: false,
              fit: BoxFit.cover,
            ),
          ),
          onTap: _CheckPlus(),
        ),
      ),
      Expanded(
        flex: 1,
        child: Padding(padding: EdgeInsets.all(2)),
      ),
      Expanded(
        child: GestureDetector(
          child: SizedBox(
            width: 190,
            height: 190,
            child: FlareActor(
              'assets/Minus_Animation_Button.flr',
              animation: 'Stay',
              controller: _Animation_Minus,
              sizeFromArtboard: false,
              fit: BoxFit.cover,
            ),
          ),
          onTap: _CheckMinus(),
        ),
      ),
    ],
  ),

I'm not good at english Thank you so much!

1

There are 1 answers

0
Luigi Rosso On

there are a few ways you could do this. I'd try combinations of some of these tools/options:

  1. Help align it by changing fit and alignment to what makes sense for your layout (I'd try fit: BoxFit.contain and alignment: Alignment.bottomCenter first).

  2. Alter the dimensions of your artboard and tell FlareActor to size from their artboard (use intrinsic size in Flutter speak) by providing sizeFromArtboard: true to your FlareActor.

  3. Use alternate bounds (not the artboard's) using a custom shape. This can be helpful if you want a different bounding box than the artboard itself. Create an invisible rectangle in Rive over the item of interest (like another artboard/bounds). Name it something that you can reference in Flutter (like "boundsRectangle"). Then provide boundsNode: "boundsRectangle" to the FlareActor widget.