File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ class _BottomAppBarState extends State<BottomAppBar> {
196
196
key: materialKey,
197
197
type: isMaterial3 ? MaterialType .canvas : MaterialType .transparency,
198
198
elevation: elevation,
199
+ color: isMaterial3 ? effectiveColor : null ,
199
200
surfaceTintColor: surfaceTintColor,
200
201
child: child == null
201
202
? null
Original file line number Diff line number Diff line change @@ -197,8 +197,39 @@ void main() {
197
197
198
198
final PhysicalShape physicalShape =
199
199
tester.widget (find.byType (PhysicalShape ).at (0 ));
200
+ final Material material = tester.widget (find.byType (Material ).at (1 ));
200
201
201
202
expect (physicalShape.color, const Color (0xff0000ff ));
203
+ expect (material.color, null ); /* no value in Material 2. */
204
+ });
205
+
206
+
207
+ testWidgets ('color overrides theme color with Material 3' , (WidgetTester tester) async {
208
+ await tester.pumpWidget (
209
+ MaterialApp (
210
+ theme: ThemeData .light (useMaterial3: true ).copyWith (
211
+ bottomAppBarColor: const Color (0xffffff00 )),
212
+ home: Builder (
213
+ builder: (BuildContext context) {
214
+ return const Scaffold (
215
+ floatingActionButton: FloatingActionButton (
216
+ onPressed: null ,
217
+ ),
218
+ bottomNavigationBar: BottomAppBar (
219
+ color: Color (0xff0000ff ),
220
+ ),
221
+ );
222
+ },
223
+ ),
224
+ ),
225
+ );
226
+
227
+ final PhysicalShape physicalShape =
228
+ tester.widget (find.byType (PhysicalShape ).at (0 ));
229
+ final Material material = tester.widget (find.byType (Material ).at (1 ));
230
+
231
+ expect (physicalShape.color, const Color (0xff0000ff ));
232
+ expect (material.color, const Color (0xff0000ff ));
202
233
});
203
234
204
235
testWidgets ('dark theme applies an elevation overlay color' , (WidgetTester tester) async {
You can’t perform that action at this time.
0 commit comments