如何将此CSS转换为颤动样式

问题描述 投票:0回答:2

我有一些CSS,如何将此CSS转换为抖动样式

background: linear-gradient(262.06deg, #03737D 0%, #14373A 101.04%);

我尝试了这个,但没有按照我想要的方式工作

return Scaffold(
            body: Container(
          decoration: BoxDecoration(
              gradient: LinearGradient(
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                  stops: [
                0,
                1.1
              ],
                  colors: [
                constants.customColors.gradiant03,
                constants.customColors.gradiant14
              ])),
        ));
flutter flutter-layout
2个回答
2
投票

这样做:

return Scaffold(
    appBar: AppBar(title: Text("Title")),
    body: Container(
        padding: EdgeInsets.all(20),
        width: double.infinity,
        decoration: BoxDecoration(
            gradient: LinearGradient(
                begin: Alignment.centerRight,
                end: Alignment.centerLeft,
                colors: [Color(0xff03737D), Color(0xff14373A)]
                )
            ),
        height: 60,
        child: Text("Checking gradient bg", style: TextStyle(color: Colors.white)),
));

CSS输出

enter image description here

颤振输出

enter image description here


-1
投票

尝试下面的代码段..

CSS

background: linear-gradient(262.06deg, #03737D 0%, #14373A 101.04%);

Flutter

new Container( 
  decoration: BoxDecoration(
    image: new DecorationImage(
      image: new ExactAssetImage('linear-gradient(262.06deg, rgb(3, 115, 125) 0%, rgb(20, 55, 58) 101.04%'),
      fit: BoxFit.auto,
      repeat: ImageRepeat.repeat,
    ),
  )
),
© www.soinside.com 2019 - 2024. All rights reserved.