【发布时间】:2021-06-15 16:44:22
【问题描述】:
我正在尝试在 appBar 中添加线性渐变,但到目前为止我还没有设法做到这一点。 有人知道我如何在我的 appBar 中添加它吗?谢谢
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [const Color(0xFFF06292), const Color(0xff2A75BC)]),
我的代码是这样的
class RegisterAgree extends StatefulWidget {
@override
_RegisterAgreeState createState() => _RegisterAgreeState();
}
class _RegisterAgreeState extends State<RegisterAgree> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.pink,
title: Row(
children: <Widget>[
Image.asset(
'assets/images/logox.png',
fit: BoxFit.cover,
height: 45.0,
)
],
),
),
);
}
}
【问题讨论】:
标签: flutter dart gradient android-appbarlayout flutter-appbar