MinimalStat class
A dashboard figure: the uppercase label, the value in mono with tabular figures, an optional delta and a line of detail, and an optional sparkline.
On its own, or in a MinimalStatRow, it is a hairline tile on the card
colour, its delta after an arrow that points along time: up or down
toward the end edge, so right to left it leans left, as the sparkline
runs. In a MinimalStatRow.joined it is one cell of a single hairline
strip on the ground, divided from its neighbours by hairlines, its value
a step smaller and its delta signed (+12%) so three or four fit. The
value always prints whole at its size, never scaled down: a row too
narrow for its figures stacks them.
delta is the change's magnitude and deltaUp its direction; a sign
already on delta is dropped. deltaGood owns the colour and defaults
to deltaUp (higher is better): set it when the two part ways, as for
latency or an error rate. tone inks the value itself for a figure that
is the alarm (Late 4 in MinimalTone.warning).
MinimalStat(label: 'Kept', value: '23/28', delta: '4', deltaUp: true)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MinimalStat
Constructors
-
MinimalStat({Key? key, required String label, required String value, String? delta, bool deltaUp = true, bool? deltaGood, String? detail, IconData? icon, MinimalTone? tone, List<
double> ? spark, bool large = false, double weight = 1, bool selected = false, VoidCallback? onPressed, FocusNode? focusNode, bool autofocus = false}) -
A figure and what it counts.
const
Properties
- autofocus → bool
-
Whether it takes keyboard focus when it first appears.
final
- delta → String?
-
The change's magnitude, already formatted (
12%,3). A leading sign (+12%,−3) is dropped: deltaUp says which way.final - deltaGood → bool?
-
Whether that move is good news (the success colour, else the
destructive one); null takes deltaUp.
final
- deltaUp → bool
-
Which way the number moved: the tile's arrow, the joined cell's sign.
final
- detail → String?
-
The quiet rest of the line: the delta's baseline (
vs last week) or, with no delta, a fact about the figure (best 21d).final - focusNode → FocusNode?
-
Its focus node, for a caller that moves focus to it; null keeps one
of its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
A glyph at the label's end, on a tile.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
What the figure counts; printed upper-cased in the label style.
final
- large → bool
-
Prints a tile's value at the giant step, for the one figure a screen
leads with.
final
- onPressed → VoidCallback?
-
Makes the figure a control (opens its breakdown, filters a list to
it); null leaves it a figure.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool
-
Whether this cell is a joined row's current filter: a 2 px foot in
ink under a label in ink, announced as selected.
final
-
spark
→ List<
double> ? -
A series drawn as a sparkline under the figure, in the delta's colour.
final
- tone → MinimalTone?
-
Inks the value in a tone; null keeps the foreground.
final
- value → String
-
The figure, already formatted (
€1,284,12d,23/28).final - weight → double
-
The cell's share of a MinimalStatRow.joined row's width (the cell
with a sparkline usually takes 1.3).
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.
override
-
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
Static Methods
-
magnitude(
String delta) → String -
deltawith any leading sign (+,-,−,±) and the space after it dropped: the magnitude a stat prints. -
valueStyleOf(
MinimalThemeData t, {bool joined = false}) → TextStyle -
The value's style: a tile's (mono 600 at 22/28, a step under giant so
two tiles share a row), or with
joineda joined cell's (20/26, so three or four fit a strip).