Widget build()

in packages/diagrams/lib/src/text.dart [506:625]


  Widget build(BuildContext context) {
    return Container(
      alignment: Alignment.center,
      height: 500,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          const Center(
            child: Text(
              'Roboto, fontSize: $_fontSize, height: $_height',
              style: TextStyle(fontSize: 30, fontWeight: FontWeight.w700),
            ),
          ),
          Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              Row(
                crossAxisAlignment: CrossAxisAlignment.baseline,
                textBaseline: TextBaseline.alphabetic,
                children: <Widget>[
                  Column(
                    mainAxisSize: MainAxisSize.min,
                    children: const <Widget>[
                      // This must be the first child of the column for the Row
                      // elements to be properly baseline-aligned.
                      TextHeightBreakdownRow(
                        text: _text,
                        backgroundColor: Colors.transparent,
                        style: TextStyle(
                          fontSize: _fontSize,
                          height: _height,
                          color: Colors.black,
                          leadingDistribution:
                              TextLeadingDistribution.proportional,
                        ),
                        paintHeightIndicator: true,
                        paintCaptions: true,
                        paintLeadingIndicator: true,
                      ),
                      SizedBox(height: 30),
                      // This column has the height indicator so the glyph is not
                      // centered. This is a hack to offset the "Configuration 1"
                      // caption so it looks more aligned with the glyph.
                      Text('                        Configuration 1',
                          textScaleFactor: 1.5),
                    ],
                  ),
                  Column(
                    mainAxisSize: MainAxisSize.min,
                    children: const <Widget>[
                      TextHeightBreakdownRow(
                        text: _text,
                        backgroundColor: Colors.transparent,
                        style: TextStyle(
                          fontSize: _fontSize,
                          height: _height,
                          color: Colors.black,
                          leadingDistribution:
                              TextLeadingDistribution.proportional,
                        ),
                        textHeightBehavior:
                            TextHeightBehavior(applyHeightToFirstAscent: false),
                        paintCaptions: true,
                      ),
                      SizedBox(height: 30),
                      Text('Configuration 2', textScaleFactor: 1.5),
                    ],
                  ),
                ],
              ),
              Row(
                crossAxisAlignment: CrossAxisAlignment.baseline,
                textBaseline: TextBaseline.alphabetic,
                children: <Widget>[
                  Column(
                    mainAxisSize: MainAxisSize.min,
                    children: const <Widget>[
                      TextHeightBreakdownRow(
                        text: _text,
                        backgroundColor: Colors.transparent,
                        style: TextStyle(
                          fontSize: _fontSize,
                          height: _height,
                          color: Colors.black,
                          leadingDistribution: TextLeadingDistribution.even,
                        ),
                        paintLeadingIndicator: true,
                      ),
                      SizedBox(height: 30),
                      Text('Configuration 3', textScaleFactor: 1.5),
                    ],
                  ),
                  Column(
                    mainAxisSize: MainAxisSize.min,
                    children: const <Widget>[
                      TextHeightBreakdownRow(
                        text: _text,
                        backgroundColor: Colors.transparent,
                        style: TextStyle(
                          fontSize: _fontSize,
                          height: _height,
                          color: Colors.black,
                          leadingDistribution: TextLeadingDistribution.even,
                        ),
                        textHeightBehavior:
                            TextHeightBehavior(applyHeightToLastDescent: false),
                      ),
                      SizedBox(height: 30),
                      Text('Configuration 4', textScaleFactor: 1.5),
                    ],
                  ),
                ],
              ),
            ],
          ),
        ],
      ),
    );
  }