build method
Widget
build(
- BuildContext context,
- LegendEntry legendEntry,
- TappableLegend legend,
- bool isHidden, {
- bool showMeasures = false,
override
Implementation
@override
Widget build(BuildContext context, common.LegendEntry legendEntry,
TappableLegend legend, bool isHidden,
{bool showMeasures = false}) {
final rowChildren = <Widget>[];
// TODO: Allow setting to configure the padding.
const padding = EdgeInsets.only(right: 8.0); // Material default.
final symbol = createSymbol(context, legendEntry, legend, isHidden);
final label = createLabel(context, legendEntry, legend, isHidden);
final measure = showMeasures
? createMeasureValue(context, legendEntry, legend, isHidden)
: null;
rowChildren.add(symbol);
rowChildren.add(Container(padding: padding));
rowChildren.add(label);
if (measure != null) {
rowChildren.add(Container(padding: padding));
rowChildren.add(measure);
}
// Row automatically reverses the content if Directionality is rtl.
return Row(children: rowChildren);
}