简体   繁体   中英

How to bypass Artboard in flutter (Rive)

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM