MetroMap<T> class

Linked items as a metro map: stations are items, rows are the distance from the finish (the item that ends last), so parallel branches and merges are visible. A line takes the colour of the station it leads to and is faded until that station is done.

Vertical (start on top) by default; horizontal lays it out left to right and sizes itself to its content, so put it in a horizontal scroll view.

Inheritance

Constructors

MetroMap({required List<T> items, required List<(int, int)> links, required int idOf(T item), required DateTime endOf(T item), required String titleOf(T item), required Color colorOf(T item), Key? key, String? subtitleOf(T item)?, bool isDone(T item)?, void onTap(T item)?, bool horizontal = false, Color? finishColor, IconData finishIcon = Icons.flag_rounded, Color? mutedColor, TextStyle? titleStyle})
Creates a metro map.
const

Properties

colorOf → Color Function(T item)
The station's colour, and the colour of the line leading to it.
final
endOf → DateTime Function(T item)
When the item ends; the latest one is the finish.
final
finishColor → Color?
The finish station's colour; the theme's primary colour by default.
final
finishIcon → IconData
The icon inside the finish station.
final
hashCode → int
The hash code for this object.
no setterinherited
horizontal → bool
Left to right instead of top to bottom.
final
idOf → int Function(T item)
The item's id, as used in links.
final
isDone → bool Function(T item)?
Done stations are filled and their lines solid.
final
items → List<T>
The items to draw. An empty list draws nothing.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
Undirected links between item ids.
final
mutedColor → Color?
Colour of subtitles and of done labels; the theme's hint colour by default.
final
onTap → void Function(T item)?
Called when a station is tapped.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subtitleOf → String? Function(T item)?
A smaller line under the label, e.g. a date.
final
titleOf → String Function(T item)
The station's label.
final
titleStyle → TextStyle?
Style of the labels.
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) → 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