小编Sto*_*min的帖子

Flutter - LinearGradient 的平滑过渡颜色

你好!

是否有用于创建在开始颜色和 ens 颜色之间具有平滑过渡的 LinearGradient 的解决方案?

new Container(
        decoration: new BoxDecoration(
          gradient: new LinearGradient(
              colors: [
                Colors.black,
                Colors.grey,
              ],
            stops: [0.0, 1.0],
            begin: FractionalOffset.topCenter,
            end: FractionalOffset.bottomCenter,
            tileMode: TileMode.repeated
          )
        ),
)
Run Code Online (Sandbox Code Playgroud)

显示颜色分辨率较差的渐变的图像

flutter

6
推荐指数
3
解决办法
2万
查看次数

Flutter - VoidCallback 内容未执行

我创建了以下客户小部件:

class MainButtonWidget extends StatelessWidget{
  String _text = "";
  TextTheme _textTheme = new TextTheme();
  IconData _icon = null;
  VoidCallback _onPressed;

  MainButtonWidget(String text, TextTheme textTheme, IconData icon, VoidCallback onPressed){
    _text = text;
    _textTheme = textTheme;
    _icon = icon;
    _onPressed = onPressed;
  }

  void setText(String text){
    _text = text;
  }

@override
Widget build(BuildContext context) {
  return new Container(
    child: new RaisedButton(
      padding: const EdgeInsets.fromLTRB(
          Dimens.edgeMainButtonLRB, Dimens.edgeMainButtonT,
          Dimens.edgeMainButtonLRB, Dimens.edgeMainButtonLRB),
      shape: new CircleBorder(side: new BorderSide(
          color: ColorRes.whiteTranslucent2,
          width: Dimens.widthSmallButtonHome)),
      onPressed: (){
        debugPrint("mainButtonWidget before _onPressed"); …
Run Code Online (Sandbox Code Playgroud)

flutter

2
推荐指数
1
解决办法
4669
查看次数

标签 统计

flutter ×2