我想知道我是否可以在 flutter app drawer header 中使用背景图像而不是颜色,有什么办法吗?
我可以自定义颜色,但我想知道是否有任何属性可以使用自定义图像更改颜色。
flutter flutter-layout flutter-appbar flutter-navigation flutter-image
寻找更好的方法来解决如何从应用程序抽屉导航到下一页的问题,我在其他文件中制作了一个有状态小部件并导入到 main.dart 中,而不是
Navigate.pop(context);
Run Code Online (Sandbox Code Playgroud)
我用什么?
我努力了
Navigator.of(context).push(
MaterialPageRoute<Null>(builder: (BuildContext context) {
return new HomePage();
Run Code Online (Sandbox Code Playgroud)
它会在上一页上加载页面并使事情变得滞后。
下面是代码。
return Scaffold(
appBar: AppBar(title: Text(title)),
body: Center(child: Text('some text')),
drawer: Drawer(
// Add a ListView to the drawer. This ensures the user can scroll
// through the options in the drawer if there isn't enough vertical
// space to fit everything.
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.blue,
image: …Run Code Online (Sandbox Code Playgroud) flutter ×2