I'd like to set all pages AppBar
's elevation
to 0. Do I have to set individually? Or is there any way to set it to all pages?
Here is an easy way of doing it.
MaterialApp(
theme: ThemeData(
appBarTheme: AppBarTheme(elevation: 0)
),
)
Create your own AppBar
Widget and use it in all your screens
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,
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With