Widget build()

in packages/diagrams/lib/src/heroes.dart [38:216]


  Widget build(BuildContext context) {
    return Directionality(
      textDirection: TextDirection.ltr,
      child: Container(
        color: Colors.white,
        height: 480.0,
        width: 900.0,
        child: Stack(
          children: <Widget>[
            Center(
              child: SizedBox(
                width: 500.0,
                child: Center(
                  child: Stack(
                    children: <Widget>[
                      Column(
                        key: heroKey,
                        crossAxisAlignment: CrossAxisAlignment.center,
                        children: <Widget>[
                          SizedBox(
                            height: 400.0,
                            child: Stack(
                              children: <Widget>[
                                Positioned(
                                  left: 0.0,
                                  top: 0.0,
                                  bottom: 0.0,
                                  width: 300.0,
                                  child: Material(
                                    key: fromRoute,
                                    color: Colors.grey[400],
                                    child: Padding(
                                      padding: const EdgeInsets.all(10.0),
                                      child: Align(
                                        alignment: Alignment.centerLeft,
                                        child: Container(
                                          key: fromHero,
                                          height: 100.0,
                                          width: 100.0,
                                          color: Colors.blue[300],
                                          child: Padding(
                                            padding: const EdgeInsets.all(10.0),
                                            child: Container(
                                              key: fromPlaceholder,
                                              color: Colors.red[200],
                                            ),
                                          ),
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                                Positioned(
                                  right: 0.0,
                                  top: 0.0,
                                  bottom: 0.0,
                                  width: 300.0,
                                  child: Material(
                                    key: toRoute,
                                    color: Colors.grey[300],
                                    elevation: 20.0,
                                    child: Padding(
                                      padding: const EdgeInsets.all(10.0),
                                      child: Align(
                                        alignment: const Alignment(1.0, -0.5),
                                        child: Container(
                                          key: toHero,
                                          height: 180.0,
                                          width: 180.0,
                                          color: Colors.blue[300],
                                          child: Padding(
                                            padding: const EdgeInsets.all(10.0),
                                            child: Container(
                                              color: Colors.red[200],
                                              child: const Align(
                                                alignment:
                                                    Alignment.bottomCenter,
                                                child: Padding(
                                                  padding: EdgeInsets.all(8.0),
                                                  child: Text(
                                                      'placeholderBuilder'),
                                                ),
                                              ),
                                            ),
                                          ),
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          const Padding(
                            padding: EdgeInsets.all(10.0),
                            child: CustomPaint(
                              painter:
                                  RightArrowPainter(fillColor: Colors.orange),
                              child: SizedBox(
                                height: 60.0,
                                width: 400.0,
                                child: Center(
                                  child: Text(
                                    'Push',
                                    style: TextStyle(fontSize: 24.0),
                                  ),
                                ),
                              ),
                            ),
                          ),
                        ],
                      ),
                      Positioned(
                        left: 60.0,
                        top: 140.0,
                        child: Transform.rotate(
                          angle: -0.2,
                          child: CustomPaint(
                            size: const Size(320.0, 20.0),
                            painter:
                                RightArrowPainter(fillColor: Colors.blue[600]!),
                          ),
                        ),
                      ),
                      Positioned(
                        left: 140.0,
                        top: 100.0,
                        height: 140.0,
                        width: 140.0,
                        child: Container(
                          color: Colors.blue[400],
                          child: const Center(
                            child: Text('flightShuttleBuilder'),
                          ),
                        ),
                      )
                    ],
                  ),
                ),
              ),
            ),
            Positioned.fill(
              child: LabelPainterWidget(
                key: key,
                heroKey: heroKey,
                labels: <Label>[
                  Label(
                    fromRoute,
                    '"bottom" route\nor\n"from" route (when pushing)',
                    const FractionalOffset(0.1, 0.95),
                  ),
                  Label(
                    toRoute,
                    '"top" route\nor\n"to" route (when pushing)',
                    const FractionalOffset(0.9, 0.95),
                  ),
                  Label(
                    fromHero,
                    '"from" hero (when pushing)',
                    const FractionalOffset(0.05, 0.95),
                  ),
                  Label(
                    fromPlaceholder,
                    'placeholderBuilder',
                    const FractionalOffset(0.5, 0.6),
                  ),
                  Label(
                    toHero,
                    '"to" hero (when pushing)',
                    const FractionalOffset(0.95, 0.95),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }