Coder Social home page Coder Social logo

mingxin-yang / flutter_expandable_fab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zuvola/flutter_expandable_fab

0.0 0.0 0.0 545 KB

License: MIT License

C++ 34.86% C 2.38% Objective-C 0.06% Kotlin 0.21% Dart 27.31% Swift 1.93% HTML 3.03% CMake 30.22%

flutter_expandable_fab's Introduction

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(
        heroTag: null,
        child: const Icon(Icons.edit),
        onPressed: () {},
      ),
      FloatingActionButton.small(
        heroTag: null,
        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 Will be called before opening the menu
afterOpen Will be called after opening the menu
onClose Will be called before the menu closes
afterClose Will be called after the menu closes
overlayStyle Provides the style for overlay. No overlay when null.
openButtonHeroTag The tag to apply to the open button's [Hero] widget.
closeButtonHeroTag The tag to apply to the close button's [Hero] widget.
collapsedFabSize The size of the collapsed FAB. regular
expandedFabSize The size of the expanded FAB. small

flutter_expandable_fab's People

Contributors

fauconspartiate avatar mingxin-yang avatar yegor-pelykh avatar zuvola avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.