我正在尝试在应用程序栏中添加线性渐变,但到目前为止我还没有设法做到这一点。有谁知道如何将其添加到我的应用程序栏中?谢谢
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [const Color(0xFFF06292), const Color(0xff2A75BC)]),
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样
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,
)
],
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)