我想将所有页面AppBar
的elevation
设置为0。
我必须单独设置吗?
或者有没有办法将其设置为所有页面?
先感谢您!
创建自己的AppBar
小部件,并在所有屏幕中使用它
import 'package:flutter/material.dart';
class MyAppBar extends AppBar {
MyAppBar(
{Key key,
Widget title,
Color backgroundColor,
List<Widget> actions,
PreferredSizeWidget bottom})
: super(
backgroundColor: backgroundColor,
title: title,
actions: actions,
bottom: bottom,
elevation:
0.0,
);
}
正如我在app_bar.dart文件中看到的那样,给应用栏的默认高程是4.0,您可以将其更改为0.0。我认为这样就可以了。