我最近尝试在没有 AppBar 或至少完全不可见的情况下为我的菜单滑块保留一个汉堡包图标。第一次尝试是使用 SafeArea,但它清空了 Scaffold。然后我尝试将不透明度设置为 0.0,如下面的代码所示。但它给出了与 SafeArea 相同的结果,而 Scaffold 上没有任何内容。请问有人可以帮忙吗?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() => MyAppState();
}
class MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return new MaterialApp(
theme: ThemeData(
// Define the default Brightness and Colors
brightness: Brightness.dark,
primaryColor: Colors.lightBlue[800],
accentColor: Colors.cyan[600],
),
home: Scaffold(
Opacity(
opacity: 0.0,
appBar: AppBar(),
),
drawer: new Drawer(
child: new ListView(),
),
body: new Center(
child: new Column(
children: <Widget>[],
))),
);
}
}