TomVista
V2EX  ›  问与答

dart 怎么重写类

  •  
  •   TomVista · Sep 15, 2020 · 761 views
    This topic created in 2070 days ago, the information mentioned may be changed or developed.

    像下面的这个,我重写了 Column,改动其实就'extends CustomFlex',但是我要建一个全参数的生成器.super 也要写全

    有其他写法吗?

    class CustomColumn extends CustomFlex {
      final List<int> renderLevel;
      CustomColumn({
        this.renderLevel,
        Key key,
        MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
        MainAxisSize mainAxisSize = MainAxisSize.max,
        CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
        TextDirection textDirection,
        VerticalDirection verticalDirection = VerticalDirection.down,
        TextBaseline textBaseline,
        List<Widget> children = const <Widget>[],
      }) : super(
              renderLevel: renderLevel,
              children: children,
              key: key,
              direction: Axis.vertical,
              mainAxisAlignment: mainAxisAlignment,
              mainAxisSize: mainAxisSize,
              crossAxisAlignment: crossAxisAlignment,
              textDirection: textDirection,
              verticalDirection: verticalDirection,
              textBaseline: textBaseline,
            );
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1304 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:05 · PVG 01:05 · LAX 10:05 · JFK 13:05
    ♥ Do have faith in what you're doing.