AnimatedFloatingActionButton constructor

AnimatedFloatingActionButton({
  1. Key? key,
  2. required List<Widget> fabButtons,
  3. required AnimatedIconData animatedIconData,
  4. int durationAnimation = 500,
  5. Color colorStartAnimation = Colors.blue,
  6. Color colorEndAnimation = Colors.red,
  7. Curve curve = Curves.easeOut,
  8. double spaceBetween = -5.0,
  9. String? tooltip = 'toggle',
})

The fabButtons and animatedIconData arguments must not be null. The durationAnimation, colorStartAnimation, colorEndAnimation, curve and spaceBetween default to the value given by the library but also the should not be null.

Implementation

AnimatedFloatingActionButton({
  Key? key,
  required this.fabButtons,
  required this.animatedIconData,
  this.durationAnimation = 500,
  this.colorStartAnimation = Colors.blue,
  this.colorEndAnimation = Colors.red,
  this.curve = Curves.easeOut,
  this.spaceBetween = -5.0,
  this.tooltip = 'toggle',
})  : assert(
        durationAnimation > 150 && durationAnimation < 1250,
        'The duration of the animation should be '
        'greater than 150 and smaller than 12500.',
      ),
      assert(
        fabButtons.length > 1,
        'The number of FABs should be more than 1 FAB.',
      ),
      assert(
        spaceBetween <= -5,
        'This is a space between the FABs when they are expanded, '
        'and the value should be lower than or '
        'equal to -5 to have a reasonable space between them.',
      ),
      super(key: key);