Skip to content

Checkbox widget with two or three state animation with a Rive animation of your choice

License

Notifications You must be signed in to change notification settings

jaumard/rive_checkbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rive_checkbox

pub package

Checkbox widget with two or three state animation with a Rive animation of your choice

Usage

RiveCheckbox(
  animation: 'assets/checkbox.riv',
  value: true,
),

You can customize the widget with:

animation: path/name to your Rive animation

animationOn: animation name of on state, default to On

animationOff: animation name of off state, default to Off

animationUnknown: animation name of unknown state, default to Unknown

value: null, false or true

width: force width of the animation

height: force height of the animation

tristate: true/false to enable null as an initial value

onChanged: callback whenever to checkbox change his state

useArtboardSize: use Rive artboard size instead of scaling

if tristate is false and value is null, it will be set to false

How it works

To make your Rive animation compatible with this widget it's simple:

  • when value is true the animation On is called
  • when value is false the animation Off is called
  • when value is null and tristate true the animation Unknown is called

About

Checkbox widget with two or three state animation with a Rive animation of your choice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published