From ed5229e57b66292762784b2addc9a855a1f5a59a Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 8 Dec 2020 09:18:07 -0800 Subject: [PATCH] Remove isMaterialAppTheme property (#71861) --- packages/flutter/lib/src/material/app.dart | 1 - packages/flutter/lib/src/material/theme.dart | 17 ----------------- .../test/material/text_selection_test.dart | 1 - 3 files changed, 19 deletions(-) diff --git a/packages/flutter/lib/src/material/app.dart b/packages/flutter/lib/src/material/app.dart index ac37ebe3d7..5d116244af 100644 --- a/packages/flutter/lib/src/material/app.dart +++ b/packages/flutter/lib/src/material/app.dart @@ -739,7 +739,6 @@ class _MaterialAppState extends State { key: widget.scaffoldMessengerKey, child: AnimatedTheme( data: theme, - isMaterialAppTheme: true, child: widget.builder != null ? Builder( builder: (BuildContext context) { diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart index 034dfdb128..2463a62833 100644 --- a/packages/flutter/lib/src/material/theme.dart +++ b/packages/flutter/lib/src/material/theme.dart @@ -40,7 +40,6 @@ class Theme extends StatelessWidget { const Theme({ Key? key, required this.data, - this.isMaterialAppTheme = false, required this.child, }) : assert(child != null), assert(data != null), @@ -49,17 +48,6 @@ class Theme extends StatelessWidget { /// Specifies the color and typography values for descendant widgets. final ThemeData data; - /// True if this theme was installed by the [MaterialApp]. - /// - /// When an app uses the [Navigator] to push a route, the route's widgets - /// will only inherit from the app's theme, even though the widget that - /// triggered the push may inherit from a theme that "shadows" the app's - /// theme because it's deeper in the widget tree. Apps can find the shadowing - /// theme with `Theme.of(context, shadowThemeOnly: true)` and pass it along - /// to the class that creates a route's widgets. Material widgets that push - /// routes, like [PopupMenuButton] and [DropdownButton], do this. - final bool isMaterialAppTheme; - /// The widget below this widget in the tree. /// /// {@macro flutter.widgets.ProxyWidget.child} @@ -209,7 +197,6 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget { const AnimatedTheme({ Key? key, required this.data, - this.isMaterialAppTheme = false, Curve curve = Curves.linear, Duration duration = kThemeAnimationDuration, VoidCallback? onEnd, @@ -221,9 +208,6 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget { /// Specifies the color and typography values for descendant widgets. final ThemeData data; - /// True if this theme was created by the [MaterialApp]. See [Theme.isMaterialAppTheme]. - final bool isMaterialAppTheme; - /// The widget below this widget in the tree. /// /// {@macro flutter.widgets.ProxyWidget.child} @@ -245,7 +229,6 @@ class _AnimatedThemeState extends AnimatedWidgetBaseState { @override Widget build(BuildContext context) { return Theme( - isMaterialAppTheme: widget.isMaterialAppTheme, child: widget.child, data: _data!.evaluate(animation!), ); diff --git a/packages/flutter/test/material/text_selection_test.dart b/packages/flutter/test/material/text_selection_test.dart index 972dde2d00..033738d347 100644 --- a/packages/flutter/test/material/text_selection_test.dart +++ b/packages/flutter/test/material/text_selection_test.dart @@ -556,7 +556,6 @@ void main() { selectionHandleColor: Color(0x550000AA), ), ), - isMaterialAppTheme: true, child: Builder( builder: (BuildContext context) { return Container(