我正在尝试使我的应用程序成为RTL,我希望抽屉位于右侧。我设法从正确的方向打开它,但是汉堡菜单图标消失了。。
这是MyApp代码,可用于布局rtl:
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'Flutter task', home: Directionality( textDirection: TextDirection.rtl, child: new MyHomePage() ), ); } }`
这是我的抽屉:
drawer: new Container( constraints: new BoxConstraints.expand( width: MediaQuery .of(context) .size .width - 60, ), color: Colors.black.withOpacity(0.6), alignment: Alignment.center, child: new ListView( children: <Widget>[ Text('1'), Text('2') ], ), ),
我想念什么?
我正在尝试使我的应用程序成为RTL,我希望抽屉位于右侧。我设法从正确的方向打开它,但是汉堡菜单图标消失了。 >
[不给drawer
任何孩子,但给Drawer
本身
drawer: Drawer(
child: // your container here
)