Unverified Commit 525365db authored by Hans Muller's avatar Hans Muller Committed by GitHub

Revert "Added AppBar.textButtonTheme (#85585)" (#85714)

parent 7a739151
...@@ -22,8 +22,6 @@ import 'material_localizations.dart'; ...@@ -22,8 +22,6 @@ import 'material_localizations.dart';
import 'material_state.dart'; import 'material_state.dart';
import 'scaffold.dart'; import 'scaffold.dart';
import 'tabs.dart'; import 'tabs.dart';
import 'text_button.dart';
import 'text_button_theme.dart';
import 'text_theme.dart'; import 'text_theme.dart';
import 'theme.dart'; import 'theme.dart';
...@@ -195,7 +193,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -195,7 +193,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
this.iconTheme, this.iconTheme,
this.actionsIconTheme, this.actionsIconTheme,
this.textTheme, this.textTheme,
this.textButtonTheme,
this.primary = true, this.primary = true,
this.centerTitle, this.centerTitle,
this.excludeHeaderSemantics = false, this.excludeHeaderSemantics = false,
...@@ -521,8 +518,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -521,8 +518,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// ///
/// * [actionsIconTheme], which defines the appearance of icons in /// * [actionsIconTheme], which defines the appearance of icons in
/// in the [actions] list. /// in the [actions] list.
/// * [textButtonTheme], which defines the appearance of [TextButton]s
/// in the tool bar.
final IconThemeData? iconTheme; final IconThemeData? iconTheme;
/// {@template flutter.material.appbar.actionsIconTheme} /// {@template flutter.material.appbar.actionsIconTheme}
...@@ -553,25 +548,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { ...@@ -553,25 +548,6 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// {@endtemplate} /// {@endtemplate}
final TextTheme? textTheme; final TextTheme? textTheme;
/// {@template flutter.material.appbar.textButtonTheme}
/// Defines the [ButtonStyle] applied to [TextButton]s that
/// appear in the in the app bar's toolbar.
///
/// If this property is null, then a [ButtonStyle] configured with
/// [foregroundColor] is used. This is useful because the default
/// [ButtonStyle.foregroundColor] is [ColorScheme.primary], which
/// is the same as the default value for the app bar's [backgroundColor].
///
/// This property is null by default.
///
/// See also:
///
/// * [actionsIconTheme], which defines the appearance of icons in
/// in the [actions] list.
/// * [iconTheme], which defines the appearance of all of the toolbar icons.
/// {@endtemplate}
final TextButtonThemeData? textButtonTheme;
/// {@template flutter.material.appbar.primary} /// {@template flutter.material.appbar.primary}
/// Whether this app bar is being displayed at the top of the screen. /// Whether this app bar is being displayed at the top of the screen.
/// ///
...@@ -853,10 +829,6 @@ class _AppBarState extends State<AppBar> { ...@@ -853,10 +829,6 @@ class _AppBarState extends State<AppBar> {
?? appBarTheme.iconTheme ?? appBarTheme.iconTheme
?? theme.iconTheme.copyWith(color: foregroundColor); ?? theme.iconTheme.copyWith(color: foregroundColor);
final TextButtonThemeData textButtonTheme = widget.textButtonTheme
?? appBarTheme.textButtonTheme
?? TextButtonThemeData(style: TextButton.styleFrom(primary: foregroundColor));
IconThemeData actionsIconTheme = widget.actionsIconTheme IconThemeData actionsIconTheme = widget.actionsIconTheme
?? appBarTheme.actionsIconTheme ?? appBarTheme.actionsIconTheme
?? overallIconTheme; ?? overallIconTheme;
...@@ -1001,10 +973,7 @@ class _AppBarState extends State<AppBar> { ...@@ -1001,10 +973,7 @@ class _AppBarState extends State<AppBar> {
data: overallIconTheme, data: overallIconTheme,
child: DefaultTextStyle( child: DefaultTextStyle(
style: toolbarTextStyle!, style: toolbarTextStyle!,
child: TextButtonTheme( child: toolbar,
data: textButtonTheme,
child: toolbar,
),
), ),
), ),
), ),
...@@ -1117,7 +1086,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -1117,7 +1086,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
required this.iconTheme, required this.iconTheme,
required this.actionsIconTheme, required this.actionsIconTheme,
required this.textTheme, required this.textTheme,
required this.textButtonTheme,
required this.primary, required this.primary,
required this.centerTitle, required this.centerTitle,
required this.excludeHeaderSemantics, required this.excludeHeaderSemantics,
...@@ -1160,7 +1128,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -1160,7 +1128,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
final IconThemeData? iconTheme; final IconThemeData? iconTheme;
final IconThemeData? actionsIconTheme; final IconThemeData? actionsIconTheme;
final TextTheme? textTheme; final TextTheme? textTheme;
final TextButtonThemeData? textButtonTheme;
final bool primary; final bool primary;
final bool? centerTitle; final bool? centerTitle;
final bool excludeHeaderSemantics; final bool excludeHeaderSemantics;
...@@ -1235,7 +1202,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -1235,7 +1202,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
iconTheme: iconTheme, iconTheme: iconTheme,
actionsIconTheme: actionsIconTheme, actionsIconTheme: actionsIconTheme,
textTheme: textTheme, textTheme: textTheme,
textButtonTheme: textButtonTheme,
primary: primary, primary: primary,
centerTitle: centerTitle, centerTitle: centerTitle,
excludeHeaderSemantics: excludeHeaderSemantics, excludeHeaderSemantics: excludeHeaderSemantics,
...@@ -1271,7 +1237,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { ...@@ -1271,7 +1237,6 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|| iconTheme != oldDelegate.iconTheme || iconTheme != oldDelegate.iconTheme
|| actionsIconTheme != oldDelegate.actionsIconTheme || actionsIconTheme != oldDelegate.actionsIconTheme
|| textTheme != oldDelegate.textTheme || textTheme != oldDelegate.textTheme
|| textButtonTheme != oldDelegate.textButtonTheme
|| primary != oldDelegate.primary || primary != oldDelegate.primary
|| centerTitle != oldDelegate.centerTitle || centerTitle != oldDelegate.centerTitle
|| titleSpacing != oldDelegate.titleSpacing || titleSpacing != oldDelegate.titleSpacing
...@@ -1508,7 +1473,6 @@ class SliverAppBar extends StatefulWidget { ...@@ -1508,7 +1473,6 @@ class SliverAppBar extends StatefulWidget {
this.iconTheme, this.iconTheme,
this.actionsIconTheme, this.actionsIconTheme,
this.textTheme, this.textTheme,
this.textButtonTheme,
this.primary = true, this.primary = true,
this.centerTitle, this.centerTitle,
this.excludeHeaderSemantics = false, this.excludeHeaderSemantics = false,
...@@ -1622,11 +1586,6 @@ class SliverAppBar extends StatefulWidget { ...@@ -1622,11 +1586,6 @@ class SliverAppBar extends StatefulWidget {
/// This property is used to configure an [AppBar]. /// This property is used to configure an [AppBar].
final TextTheme? textTheme; final TextTheme? textTheme;
/// {@macro flutter.material.appbar.textButtonTheme}
///
/// This property is used to configure an [AppBar].
final TextButtonThemeData? textButtonTheme;
/// {@macro flutter.material.appbar.primary} /// {@macro flutter.material.appbar.primary}
/// ///
/// This property is used to configure an [AppBar]. /// This property is used to configure an [AppBar].
...@@ -1883,7 +1842,6 @@ class _SliverAppBarState extends State<SliverAppBar> with TickerProviderStateMix ...@@ -1883,7 +1842,6 @@ class _SliverAppBarState extends State<SliverAppBar> with TickerProviderStateMix
iconTheme: widget.iconTheme, iconTheme: widget.iconTheme,
actionsIconTheme: widget.actionsIconTheme, actionsIconTheme: widget.actionsIconTheme,
textTheme: widget.textTheme, textTheme: widget.textTheme,
textButtonTheme: widget.textButtonTheme,
primary: widget.primary, primary: widget.primary,
centerTitle: widget.centerTitle, centerTitle: widget.centerTitle,
excludeHeaderSemantics: widget.excludeHeaderSemantics, excludeHeaderSemantics: widget.excludeHeaderSemantics,
......
...@@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart'; ...@@ -8,7 +8,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'text_button_theme.dart';
import 'text_theme.dart'; import 'text_theme.dart';
import 'theme.dart'; import 'theme.dart';
...@@ -38,7 +37,6 @@ class AppBarTheme with Diagnosticable { ...@@ -38,7 +37,6 @@ class AppBarTheme with Diagnosticable {
this.iconTheme, this.iconTheme,
this.actionsIconTheme, this.actionsIconTheme,
this.textTheme, this.textTheme,
this.textButtonTheme,
this.centerTitle, this.centerTitle,
this.titleSpacing, this.titleSpacing,
this.toolbarHeight, this.toolbarHeight,
...@@ -137,17 +135,6 @@ class AppBarTheme with Diagnosticable { ...@@ -137,17 +135,6 @@ class AppBarTheme with Diagnosticable {
/// [AppBar.titleTextStyle in all descendant [AppBar] widgets. /// [AppBar.titleTextStyle in all descendant [AppBar] widgets.
final TextTheme? textTheme; final TextTheme? textTheme;
/// Overrides the default value of the [AppBar.textButtonTheme]
/// property in all descendant [AppBar] widgets.
///
/// See also:
///
/// * [actionsIconTheme], which overrides the default value for
/// [AppBar.actionsIconTheme] in all descendant [AppBar] widgets.
/// * [foregroundColor], which overrides the default value
/// [AppBar.foregroundColor] in all descendant widgets.
final TextButtonThemeData? textButtonTheme;
/// Overrides the default value for [AppBar.centerTitle]. /// Overrides the default value for [AppBar.centerTitle].
/// property in all descendant widgets. /// property in all descendant widgets.
final bool? centerTitle; final bool? centerTitle;
...@@ -209,7 +196,6 @@ class AppBarTheme with Diagnosticable { ...@@ -209,7 +196,6 @@ class AppBarTheme with Diagnosticable {
Color? shadowColor, Color? shadowColor,
IconThemeData? iconTheme, IconThemeData? iconTheme,
TextTheme? textTheme, TextTheme? textTheme,
TextButtonThemeData? textButtonTheme,
bool? centerTitle, bool? centerTitle,
double? titleSpacing, double? titleSpacing,
double? toolbarHeight, double? toolbarHeight,
...@@ -231,7 +217,6 @@ class AppBarTheme with Diagnosticable { ...@@ -231,7 +217,6 @@ class AppBarTheme with Diagnosticable {
iconTheme: iconTheme ?? this.iconTheme, iconTheme: iconTheme ?? this.iconTheme,
actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme, actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme,
textTheme: textTheme ?? this.textTheme, textTheme: textTheme ?? this.textTheme,
textButtonTheme: textButtonTheme ?? this.textButtonTheme,
centerTitle: centerTitle ?? this.centerTitle, centerTitle: centerTitle ?? this.centerTitle,
titleSpacing: titleSpacing ?? this.titleSpacing, titleSpacing: titleSpacing ?? this.titleSpacing,
toolbarHeight: toolbarHeight ?? this.toolbarHeight, toolbarHeight: toolbarHeight ?? this.toolbarHeight,
...@@ -263,7 +248,6 @@ class AppBarTheme with Diagnosticable { ...@@ -263,7 +248,6 @@ class AppBarTheme with Diagnosticable {
iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t), iconTheme: IconThemeData.lerp(a?.iconTheme, b?.iconTheme, t),
actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t), actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t),
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t), textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t),
textButtonTheme: TextButtonThemeData.lerp(a?.textButtonTheme, b?.textButtonTheme, t),
centerTitle: t < 0.5 ? a?.centerTitle : b?.centerTitle, centerTitle: t < 0.5 ? a?.centerTitle : b?.centerTitle,
titleSpacing: lerpDouble(a?.titleSpacing, b?.titleSpacing, t), titleSpacing: lerpDouble(a?.titleSpacing, b?.titleSpacing, t),
toolbarHeight: lerpDouble(a?.toolbarHeight, b?.toolbarHeight, t), toolbarHeight: lerpDouble(a?.toolbarHeight, b?.toolbarHeight, t),
...@@ -285,7 +269,6 @@ class AppBarTheme with Diagnosticable { ...@@ -285,7 +269,6 @@ class AppBarTheme with Diagnosticable {
iconTheme, iconTheme,
actionsIconTheme, actionsIconTheme,
textTheme, textTheme,
textButtonTheme,
centerTitle, centerTitle,
titleSpacing, titleSpacing,
toolbarHeight, toolbarHeight,
...@@ -311,7 +294,6 @@ class AppBarTheme with Diagnosticable { ...@@ -311,7 +294,6 @@ class AppBarTheme with Diagnosticable {
&& other.iconTheme == iconTheme && other.iconTheme == iconTheme
&& other.actionsIconTheme == actionsIconTheme && other.actionsIconTheme == actionsIconTheme
&& other.textTheme == textTheme && other.textTheme == textTheme
&& other.textButtonTheme == textButtonTheme
&& other.centerTitle == centerTitle && other.centerTitle == centerTitle
&& other.titleSpacing == titleSpacing && other.titleSpacing == titleSpacing
&& other.toolbarHeight == toolbarHeight && other.toolbarHeight == toolbarHeight
...@@ -332,7 +314,6 @@ class AppBarTheme with Diagnosticable { ...@@ -332,7 +314,6 @@ class AppBarTheme with Diagnosticable {
properties.add(DiagnosticsProperty<IconThemeData>('iconTheme', iconTheme, defaultValue: null)); properties.add(DiagnosticsProperty<IconThemeData>('iconTheme', iconTheme, defaultValue: null));
properties.add(DiagnosticsProperty<IconThemeData>('actionsIconTheme', actionsIconTheme, defaultValue: null)); properties.add(DiagnosticsProperty<IconThemeData>('actionsIconTheme', actionsIconTheme, defaultValue: null));
properties.add(DiagnosticsProperty<TextTheme>('textTheme', textTheme, defaultValue: null)); properties.add(DiagnosticsProperty<TextTheme>('textTheme', textTheme, defaultValue: null));
properties.add(DiagnosticsProperty<TextButtonThemeData>('textButtonTheme', textButtonTheme, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('centerTitle', centerTitle, defaultValue: null)); properties.add(DiagnosticsProperty<bool>('centerTitle', centerTitle, defaultValue: null));
properties.add(DiagnosticsProperty<double>('titleSpacing', titleSpacing, defaultValue: null)); properties.add(DiagnosticsProperty<double>('titleSpacing', titleSpacing, defaultValue: null));
properties.add(DiagnosticsProperty<double>('toolbarHeight', toolbarHeight, defaultValue: null)); properties.add(DiagnosticsProperty<double>('toolbarHeight', toolbarHeight, defaultValue: null));
......
...@@ -20,10 +20,8 @@ void main() { ...@@ -20,10 +20,8 @@ void main() {
home: Scaffold( home: Scaffold(
appBar: AppBar( appBar: AppBar(
backwardsCompatibility: false, backwardsCompatibility: false,
title: TextButton(onPressed: () { }, child: const Text('TitleButton')),
actions: <Widget>[ actions: <Widget>[
IconButton(onPressed: () { }, icon: const Icon(Icons.share)), IconButton(icon: const Icon(Icons.share), onPressed: () { }),
TextButton(onPressed: () { }, child: const Text('ActionButton')),
], ],
), ),
), ),
...@@ -31,22 +29,18 @@ void main() { ...@@ -31,22 +29,18 @@ void main() {
); );
final Material widget = _getAppBarMaterial(tester); final Material widget = _getAppBarMaterial(tester);
final RichText titleButtonText = _getAppBarButtonRichText(tester, 'TitleButton');
final IconTheme iconTheme = _getAppBarIconTheme(tester); final IconTheme iconTheme = _getAppBarIconTheme(tester);
final IconTheme actionsIconTheme = _getAppBarActionsIconTheme(tester); final IconTheme actionsIconTheme = _getAppBarActionsIconTheme(tester);
final RichText actionIconText = _getAppBarIconRichText(tester); final RichText actionIconText = _getAppBarIconRichText(tester);
final RichText actionButtonText = _getAppBarButtonRichText(tester, 'ActionButton');
final DefaultTextStyle text = _getAppBarText(tester); final DefaultTextStyle text = _getAppBarText(tester);
expect(SystemChrome.latestStyle!.statusBarBrightness, SystemUiOverlayStyle.light.statusBarBrightness); expect(SystemChrome.latestStyle!.statusBarBrightness, SystemUiOverlayStyle.light.statusBarBrightness);
expect(titleButtonText.text.style!.color, Colors.white);
expect(widget.color, Colors.blue); expect(widget.color, Colors.blue);
expect(widget.elevation, 4.0); expect(widget.elevation, 4.0);
expect(widget.shadowColor, Colors.black); expect(widget.shadowColor, Colors.black);
expect(iconTheme.data, const IconThemeData(color: Colors.white)); expect(iconTheme.data, const IconThemeData(color: Colors.white));
expect(actionsIconTheme.data, const IconThemeData(color: Colors.white)); expect(actionsIconTheme.data, const IconThemeData(color: Colors.white));
expect(actionIconText.text.style!.color, Colors.white); expect(actionIconText.text.style!.color, Colors.white);
expect(actionButtonText.text.style!.color, Colors.white);
expect(text.style, Typography.material2014().englishLike.bodyText2!.merge(Typography.material2014().white.bodyText2)); expect(text.style, Typography.material2014().englishLike.bodyText2!.merge(Typography.material2014().white.bodyText2));
expect(tester.getSize(find.byType(AppBar)).height, kToolbarHeight); expect(tester.getSize(find.byType(AppBar)).height, kToolbarHeight);
expect(tester.getSize(find.byType(AppBar)).width, 800); expect(tester.getSize(find.byType(AppBar)).width, 800);
...@@ -63,8 +57,7 @@ void main() { ...@@ -63,8 +57,7 @@ void main() {
backwardsCompatibility: false, backwardsCompatibility: false,
title: const Text('App Bar Title'), title: const Text('App Bar Title'),
actions: <Widget>[ actions: <Widget>[
IconButton(onPressed: () { }, icon: const Icon(Icons.share)), IconButton(icon: const Icon(Icons.share), onPressed: () { }),
TextButton(onPressed: () { }, child: const Text('ActionButton')),
], ],
), ),
), ),
...@@ -75,7 +68,6 @@ void main() { ...@@ -75,7 +68,6 @@ void main() {
final IconTheme iconTheme = _getAppBarIconTheme(tester); final IconTheme iconTheme = _getAppBarIconTheme(tester);
final IconTheme actionsIconTheme = _getAppBarActionsIconTheme(tester); final IconTheme actionsIconTheme = _getAppBarActionsIconTheme(tester);
final RichText actionIconText = _getAppBarIconRichText(tester); final RichText actionIconText = _getAppBarIconRichText(tester);
final RichText actionButtonText = _getAppBarButtonRichText(tester, 'ActionButton');
final DefaultTextStyle text = _getAppBarText(tester); final DefaultTextStyle text = _getAppBarText(tester);
expect(SystemChrome.latestStyle!.statusBarBrightness, appBarTheme.brightness); expect(SystemChrome.latestStyle!.statusBarBrightness, appBarTheme.brightness);
...@@ -85,7 +77,6 @@ void main() { ...@@ -85,7 +77,6 @@ void main() {
expect(iconTheme.data, appBarTheme.iconTheme); expect(iconTheme.data, appBarTheme.iconTheme);
expect(actionsIconTheme.data, appBarTheme.actionsIconTheme); expect(actionsIconTheme.data, appBarTheme.actionsIconTheme);
expect(actionIconText.text.style!.color, appBarTheme.actionsIconTheme!.color); expect(actionIconText.text.style!.color, appBarTheme.actionsIconTheme!.color);
expect(actionButtonText.text.style!.color, Colors.pink);
expect(text.style, appBarTheme.toolbarTextStyle); expect(text.style, appBarTheme.toolbarTextStyle);
expect(tester.getSize(find.byType(AppBar)).height, appBarTheme.toolbarHeight); expect(tester.getSize(find.byType(AppBar)).height, appBarTheme.toolbarHeight);
expect(tester.getSize(find.byType(AppBar)).width, 800); expect(tester.getSize(find.byType(AppBar)).width, 800);
...@@ -144,7 +135,6 @@ void main() { ...@@ -144,7 +135,6 @@ void main() {
const Color shadowColor = Colors.red; const Color shadowColor = Colors.red;
const IconThemeData iconThemeData = IconThemeData(color: Colors.green); const IconThemeData iconThemeData = IconThemeData(color: Colors.green);
const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.lightBlue); const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.lightBlue);
const TextButtonThemeData textButtonTheme = TextButtonThemeData();
const TextStyle toolbarTextStyle = TextStyle(color: Colors.pink); const TextStyle toolbarTextStyle = TextStyle(color: Colors.pink);
const TextStyle titleTextStyle = TextStyle(color: Colors.orange); const TextStyle titleTextStyle = TextStyle(color: Colors.orange);
...@@ -161,7 +151,6 @@ void main() { ...@@ -161,7 +151,6 @@ void main() {
shadowColor: shadowColor, shadowColor: shadowColor,
iconTheme: iconThemeData, iconTheme: iconThemeData,
actionsIconTheme: actionsIconThemeData, actionsIconTheme: actionsIconThemeData,
textButtonTheme: textButtonTheme,
toolbarTextStyle: toolbarTextStyle, toolbarTextStyle: toolbarTextStyle,
titleTextStyle: titleTextStyle, titleTextStyle: titleTextStyle,
actions: <Widget>[ actions: <Widget>[
...@@ -186,7 +175,6 @@ void main() { ...@@ -186,7 +175,6 @@ void main() {
expect(actionsIconTheme.data, actionsIconThemeData); expect(actionsIconTheme.data, actionsIconThemeData);
expect(actionIconText.text.style!.color, actionsIconThemeData.color); expect(actionIconText.text.style!.color, actionsIconThemeData.color);
expect(text.style, toolbarTextStyle); expect(text.style, toolbarTextStyle);
expect(_getAppBarTextButtonTheme(tester).data, textButtonTheme);
}); });
testWidgets('AppBar icon color takes priority over everything', (WidgetTester tester) async { testWidgets('AppBar icon color takes priority over everything', (WidgetTester tester) async {
...@@ -548,22 +536,16 @@ AppBarTheme _appBarTheme() { ...@@ -548,22 +536,16 @@ AppBarTheme _appBarTheme() {
const Color shadowColor = Colors.red; const Color shadowColor = Colors.red;
const IconThemeData iconThemeData = IconThemeData(color: Colors.black); const IconThemeData iconThemeData = IconThemeData(color: Colors.black);
const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.pink); const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.pink);
final TextButtonThemeData textButtonThemeData = TextButtonThemeData( return const AppBarTheme(
style: TextButton.styleFrom(
primary: Colors.pink,
),
);
return AppBarTheme(
actionsIconTheme: actionsIconThemeData, actionsIconTheme: actionsIconThemeData,
brightness: brightness, brightness: brightness,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
elevation: elevation, elevation: elevation,
shadowColor: shadowColor, shadowColor: shadowColor,
iconTheme: iconThemeData, iconTheme: iconThemeData,
textButtonTheme: textButtonThemeData,
toolbarHeight: 96, toolbarHeight: 96,
toolbarTextStyle: const TextStyle(color: Colors.yellow), toolbarTextStyle: TextStyle(color: Colors.yellow),
titleTextStyle: const TextStyle(color: Colors.pink), titleTextStyle: TextStyle(color: Colors.pink),
); );
} }
...@@ -572,7 +554,7 @@ Material _getAppBarMaterial(WidgetTester tester) { ...@@ -572,7 +554,7 @@ Material _getAppBarMaterial(WidgetTester tester) {
find.descendant( find.descendant(
of: find.byType(AppBar), of: find.byType(AppBar),
matching: find.byType(Material), matching: find.byType(Material),
).first, ),
); );
} }
...@@ -594,15 +576,6 @@ IconTheme _getAppBarActionsIconTheme(WidgetTester tester) { ...@@ -594,15 +576,6 @@ IconTheme _getAppBarActionsIconTheme(WidgetTester tester) {
); );
} }
TextButtonTheme _getAppBarTextButtonTheme(WidgetTester tester) {
return tester.widget<TextButtonTheme>(
find.descendant(
of: find.byType(AppBar),
matching: find.byType(TextButtonTheme),
).first,
);
}
RichText _getAppBarIconRichText(WidgetTester tester) { RichText _getAppBarIconRichText(WidgetTester tester) {
return tester.widget<RichText>( return tester.widget<RichText>(
find.descendant( find.descendant(
...@@ -612,15 +585,6 @@ RichText _getAppBarIconRichText(WidgetTester tester) { ...@@ -612,15 +585,6 @@ RichText _getAppBarIconRichText(WidgetTester tester) {
); );
} }
RichText _getAppBarButtonRichText(WidgetTester tester, String text) {
return tester.widget<RichText>(
find.descendant(
of: find.text(text),
matching: find.byType(RichText),
).first,
);
}
DefaultTextStyle _getAppBarText(WidgetTester tester) { DefaultTextStyle _getAppBarText(WidgetTester tester) {
return tester.widget<DefaultTextStyle>( return tester.widget<DefaultTextStyle>(
find.descendant( find.descendant(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment