SpeedDialBuilder<T> class

This widget can be used to create speed dial buttons of all kinds of styles.

The most Basic example of a typically vertical expanding speed dial button looks like this:

SpeedDialBuilder(
  buttonBuilder: (context, isActive, toggle) => FloatingActionButton(
    onPressed: toggle,
    child: Icon( isActive ? Icons.close : Icons.add )
  ),
  buttonAnchor: Alignment.topCenter,
  itemAnchor: Alignment.bottomCenter,
  itemBuilder: (context, Widget item, i, animation) => FractionalTranslation(
    translation: Offset(0, -i.toDouble()),
    child: ScaleTransition(
      scale: animation,
      child: item
    )
  ),
  items: [
    FloatingActionButton.small(
      onPressed: () {},
      child: const Icon(Icons.hub),
    ),
    ...
  ]
);

Checkout the example or readme of the project for further details and more advanced examples.

Inheritance

Constructors

SpeedDialBuilder({required SpeedDialButtonBuilder buttonBuilder, required SpeedDialItemBuilder<T> itemBuilder, required List<T> items, SpeedDialItemBuilder<T>? secondaryItemBuilder, Alignment buttonAnchor = Alignment.topCenter, Alignment itemAnchor = Alignment.topCenter, Offset offset = Offset.zero, double animationOverlap = 0.8, bool reverse = false, Duration duration = const Duration(milliseconds: 300), Duration reverseDuration = const Duration(milliseconds: 300), Curve curve = Curves.easeOutBack, Curve reverseCurve = Curves.easeOutBack, Key? key})
const

Properties

animationOverlap double
A number from 0 to 1 defining the overlap ratio of the item animations.
final
buttonAnchor Alignment
Specify the anchor point of the main button to which the items should be aligned to.
final
buttonBuilder SpeedDialButtonBuilder
The main button builder. This will typically return a FloatingActionButton. However any widget with an intrinsic size might be returned here.
final
curve Curve
Defines the curve of the incoming animation of each item. Setting this to linear allows you to specify different curves for every single item later.
final
duration Duration
The incoming animation duration of a single item.
final
hashCode int
The hash code for this object.
no setterinherited
itemAnchor Alignment
Specify the anchor point of the items that will be snapped to the anchor point of the main button.
final
itemBuilder SpeedDialItemBuilder<T>
The builder for the speed dial items. This will typically return a small FloatingActionButton. However any widget with an intrinsic size might be returned here.
final
items List<T>
A list of items used by the itemBuilder and secondaryItemBuilder.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
offset Offset
A custom offset applied to each item.
final
reverse bool
Define if the animation should start with the first or last item from the list.
final
reverseCurve Curve
Defines the curve of the outgoing animation of each item. Setting this to linear allows you to specify different curves for every single item later.
final
reverseDuration Duration
The outgoing animation duration of a single item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryItemBuilder SpeedDialItemBuilder<T>?
An optional secondary speed dial item builder. This can be used to build an additional widget per item like a label.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited