Yas*_*han 2 user-interface background dart flutter flutter-layout
我想在我的 flutter 应用程序的背景中使用 Liner 渐变颜色样式,如何在我的 flutter 应用程序中实现它?
小智 7
您只需在中使用正确的参数即可BoxDecoration
https://api.flutter.dev/flutter/painting/LinearGradient-class.html
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end:
Alignment(0.8, 0.0), // 10% of the width, so there are ten blinds.
colors: [
const Color(0xffee0000),
const Color(0xffeeee00)
], // red to yellow
tileMode: TileMode.repeated, // repeats the gradient over the canvas
),
),
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1705 次 |
| 最近记录: |