This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 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> {
196196 key: materialKey,
197197 type: isMaterial3 ? MaterialType .canvas : MaterialType .transparency,
198198 elevation: elevation,
199+ color: isMaterial3 ? effectiveColor : null ,
199200 surfaceTintColor: surfaceTintColor,
200201 child: child == null
201202 ? null
Original file line number Diff line number Diff line change @@ -197,8 +197,39 @@ void main() {
197197
198198 final PhysicalShape physicalShape =
199199 tester.widget (find.byType (PhysicalShape ).at (0 ));
200+ final Material material = tester.widget (find.byType (Material ).at (1 ));
200201
201202 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 ));
202233 });
203234
204235 testWidgets ('dark theme applies an elevation overlay color' , (WidgetTester tester) async {
You can’t perform that action at this time.
0 commit comments