我想集中的所有网页AppBar的elevation为0.
我一定要单独设置?
或者有没有办法将其设置为所有页面?
先感谢您!
这是一个简单的方法。
MaterialApp(
theme: ThemeData(
appBarTheme: AppBarTheme(elevation: 0)
),
)
Run Code Online (Sandbox Code Playgroud)
创建自己的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,
);
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1417 次 |
| 最近记录: |