animated_floating_buttons
플로팅 버튼의 접을 수 있는 목록을 만들 수 있습니다. 아군 수리야의 튜토리얼을 기반으로 합니다.
접을 수 있는 플로팅 버튼 목록을 만들 수 있습니다. https://medium.com/@agungsurya/create-a-simple-animated-floatingactionbutton-in-flutter-2d24f37cfbcc 에서 Agung Surya의 튜토리얼 기반
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
This package is based on Agung Surya's tutorial. You can visit his post for more technical information about the package. https://medium.com/@agungsurya/create-a-simple-animated-floatingactionbutton-in-flutter-2d24f37cfbcc
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
To use this plugin:
In your flutter project add the dependency:
dependencies:
...
animated_floating_buttons: ^0.0.1
//Import package
import 'package:animated_floating_buttons/animated_floating_buttons.dart';
...
/// when you want to close the menu you have to create
final GlobalKey<AnimatedFloatingActionButtonState> key =GlobalKey<AnimatedFloatingActionButtonState>();
/// and then assign it to the our widget library
Widget float1() {
return Container(
child: FloatingActionButton(
onPressed: null,
heroTag: "btn1",
tooltip: 'First button',
child: Icon(Icons.add),
),
);
}
Widget float2() {
return Container(
child: FloatingActionButton(
onPressed: null,
heroTag: "btn2",
tooltip: 'Second button',
child: Icon(Icons.add),
),
);
}
...
Scaffold(
floatingActionButton: AnimatedFloatingActionButton(
//Fab list
fabButtons: <Widget>[
float1(), float2()
],
key : key,
colorStartAnimation: Colors.blue,
colorEndAnimation: Colors.red,
animatedIconData: AnimatedIcons.menu_close //To principal button
),
)
Complete example here
Be aware that you have to pass heroTag parameter to every new fab you create
Otherwise you will get an exciption.