Flutter package to render a Material Design Speed Dial.
The SpeedDial widget is built to be placed in the Scaffold.floatingActionButton
parameter.
It's not possible to set its position with the Scaffold.floatingActionButtonLocation
parameter though.
The use with the Scaffold.bottomNavigationBar
is possible but the floating button will be placed above the bar, so the BottomAppBar.hasNotch
should be false
.
Labels
Every child button can have a label
, which can be customized providing a labelStyle
. If the label
parameter is not provided the label will be not rendered.
Animated Icon
The main floating action button child can set with the child
parameter, however to make easier to use an AnimatedIcon
there are two specific parameters:
animatedIcon
takes an AnimatedIconData
widgetanimatedIconTheme
takes its themeThe package will handle the animation by itself.
Hide on Scroll
Another possibility is to make the button hide on scroll with a curve animation, with a visible
parameter to set dynamically based on the scroll direction. See the example project for more info.
Example Usage:
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: SpeedDial(
animatedIcon: AnimatedIcons.menu_close,
animatedIconTheme: IconThemeData(size: 22.0),
// this is ignored if animatedIcon is non null
// child: Icon(Icons.add),
visible: _dialVisible,
curve: Curves.bounceIn,
overlayColor: Colors.black,
overlayOpacity: 0.5,
onOpen: () => print('OPENING DIAL'),
onClose: () => print('DIAL CLOSED'),
tooltip: 'Speed Dial',
heroTag: 'speed-dial-hero-tag',
backgroundColor: Colors.white,
foregroundColor: Colors.black,
elevation: 8.0,
shape: CircleBorder(),
children: [
SpeedDialChild(
child: Icon(Icons.accessibility),
backgroundColor: Colors.red,
label: 'First',
labelStyle: TextTheme(fontSize: 18.0),
onTap: () => print('FIRST CHILD')
),
SpeedDialChild(
child: Icon(Icons.brush),
backgroundColor: Colors.blue,
label: 'Second',
labelStyle: TextTheme(fontSize: 18.0),
onTap: () => print('SECOND CHILD'),
),
SpeedDialChild(
child: Icon(Icons.keyboard_voice),
backgroundColor: Colors.green,
label: 'Third',
labelStyle: TextTheme(fontSize: 18.0),
onTap: () => print('THIRD CHILD'),
),
],
),
);
}
Please file an issue to send feedback or report a bug. Thank you!
Every pull request is welcome.
example/README.md
A new Flutter project.
For help getting started with Flutter, view our online documentation.
Add this to your package's pubspec.yaml file:
dependencies:
flutter_speed_dial: ^1.0.9
You can install packages from the command line:
with Flutter:
$ flutter packages get
Alternatively, your editor might support flutter packages get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
1.1.1 | Feb 15, 2019 |
|
|
1.1.0 | Feb 7, 2019 |
|
|
1.0.9 | Nov 23, 2018 |
|
|
1.0.8 | Sep 4, 2018 |
|
|
1.0.7 | Aug 18, 2018 |
|
|
1.0.6 | Jul 15, 2018 |
|
|
1.0.5 | Jul 13, 2018 |
|
|
1.0.4 | Jul 7, 2018 |
|
|
1.0.3 | Jul 7, 2018 |
|
|
1.0.2 | Jul 7, 2018 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
91
|
Health:
Code health derived from static analysis.
[more]
|
100
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
100
|
Overall:
Weighted score of the above.
[more]
|
96
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Format lib/src/speed_dial.dart
.
Run flutter format
to format lib/src/speed_dial.dart
.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=1.20.1 <3.0.0 | ||
flutter | 0.0.0 | ||
Transitive dependencies | |||
collection | 1.14.11 | ||
meta | 1.1.6 | 1.1.7 | |
sky_engine | 0.0.99 | ||
typed_data | 1.1.6 | ||
vector_math | 2.0.8 | ||
Dev dependencies | |||
flutter_test |