当前位置: 首页 > 工具软件 > FlatButton > 使用案例 >

Flutter跨平台移动端开发丨Container + FlatButton 实现背景色渐变的圆角Button

太叔逸春
2023-12-01
Container

Container 是各种我们已知的 widget 的组合,使用它可以实现装饰、变换、限制等各种效果

  Container({
    Key key,
    this.alignment,
    this.padding,
    Color color,
    Decoration decoration,
    this.foregroundDecoration,
    double width,
    double height,
    BoxConstraints constraints,
    this.margin,
    this.transform,
    this.child,
  }) : assert(margin == null || margin.isNonNegative),
       assert(padding == null || padding.isNonNegative),
       assert(decoration == null || decoration.debugAssertIsValid()),
       assert(constraints == null || constraints.debugAssertIsValid()),
       assert(color == null || decoration == null,
         'Cannot provide both a color and a decoration\n'
         'The color argument is just a shorthand for "decoration: new BoxDecoration(color: color)".'
       ),
       decoration = decoration ?? (color != null ? BoxDecoratio
 类似资料: