Skip to content

flutterings/flutter_expandable_fab_plus

 
 

Repository files navigation

flutter_expandable_fab

pub package

English, 日本語

flutter_expandable_fab is the speed dial FAB that can show/hide multiple action buttons with animation.
This is an extension of the code in this article.
https://docs.flutter.dev/cookbook/effects/expandable-fab

Fan style & Blur overlay

Vertical style & Color overlay

Horizontal style & Custom buttons

Getting started

import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';

Scaffold(
  floatingActionButtonLocation: ExpandableFab.location,
  floatingActionButton: ExpandableFab(
    children: [
      FloatingActionButton.small(
        child: const Icon(Icons.edit),
        onPressed: () {},
      ),
      FloatingActionButton.small(
        child: const Icon(Icons.search),
        onPressed: () {},
      ),
    ],
  ),
),

Open/Close programmatically

final _key = GlobalKey<ExpandableFabState>();

Scaffold(
  floatingActionButtonLocation: ExpandableFab.location,
  floatingActionButton: ExpandableFab(
    key: _key,
    children: [
      FloatingActionButton.small(
        child: const Icon(Icons.edit),
        onPressed: () {
          final state = _key.currentState;
          if (state != null) {
            debugPrint('isOpen:${state.isOpen}');
            state.toggle();
          }
        },
      ),
    ],
  ),
),

Properties

Property Description Default
distance Distance from children 100
duration Animation duration 250ms
fanAngle Angle of opening when fan type 90
initialOpen Open at initial display false
type The type of behavior of this widget fan
closeButtonStyle Style of the close button
child The widget below this widget in the tree
childrenOffset For positioning of children widgets
children The widgets below this widget in the tree
foregroundColor The default foreground color for icons and text within the button
backgroundColor The button's background color
onOpen Execute when the menu opens
onClose Execute when the menu closes
overlayStyle Provides the style for overlay. No overlay when null.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 35.2%
  • CMake 30.6%
  • Dart 26.4%
  • HTML 3.1%
  • C 2.4%
  • Swift 2.0%
  • Other 0.3%