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.
final padding = new 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(new Container(padding: padding));
rowChildren.add(label);
if (measure != null) {
rowChildren.add(new Container(padding: padding));
rowChildren.add(measure);
}
// Row automatically reverses the content if Directionality is rtl.
return new Row(children: rowChildren);
}