flare_checkbox 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

flare_checkbox #

pub package

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

Usage #

  animation: 'assets/checkbox.flr',
  value: true,

You can customize the widget with:

animation: path/name to your flare 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

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

How it works #

To make your flare 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

[1.0.3] - 12/02/2020 #

  • upgrade flare deps to be compatible with last flutter stable

[1.0.2] - 09/07/2019 #

  • upgrade flare deps to be compatible with last flutter stable

[1.0.1+1] - 27/03/2019 #

  • fix snapToEnd when controlling checkbox by it's value and not by gesture

[1.0.1] - 23/03/2019 #

  • Use snapToEnd to prevent intro animation on widget creation

[1.0.0] - 23/03/2019 #

  • Add animations name customization

[0.0.1+2] - 27/02/2019 #

  • Add width and height field.

[0.0.1+1] - 26/02/2019 #

  • Readme documentation.

[0.0.1] - 26/02/2019 #

  • initial release.


import 'package:flare_checkbox/flare_checkbox.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      home: MyHomePage(title: 'Flutter Demo Home Page'),

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  _MyHomePageState createState() => _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      body: Center(
        child: FlareCheckbox(
          onChanged: print,
          animation: 'assets/checkbox.flr',
          value: true,
      ), // This trailing comma makes auto-formatting nicer for build methods.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flare_checkbox: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flare_checkbox/flare_checkbox.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Mar 31, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Format lib/flare_checkbox.dart.

Run flutter format to format lib/flare_checkbox.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flare_flutter ^2.0.1 2.0.1
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
flare_dart 2.3.3
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies