Unverified Commit eac17471 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Renamed ContainedButton et al. to ElevatedButton et al. (#61262)

parent aa012538
......@@ -49,8 +49,6 @@ export 'src/material/circle_avatar.dart';
export 'src/material/color_scheme.dart';
export 'src/material/colors.dart';
export 'src/material/constants.dart';
export 'src/material/contained_button.dart';
export 'src/material/contained_button_theme.dart';
export 'src/material/data_table.dart';
export 'src/material/data_table_source.dart';
export 'src/material/debug.dart';
......@@ -61,6 +59,8 @@ export 'src/material/divider_theme.dart';
export 'src/material/drawer.dart';
export 'src/material/drawer_header.dart';
export 'src/material/dropdown.dart';
export 'src/material/elevated_button.dart';
export 'src/material/elevated_button_theme.dart';
export 'src/material/elevation_overlay.dart';
export 'src/material/expand_icon.dart';
export 'src/material/expansion_panel.dart';
......
......@@ -29,12 +29,12 @@ import 'theme_data.dart';
/// hovered, focused, disabled, etc.
///
/// These properties can override the default value for just one state or all of
/// them. For example to create a [ContainedButton] whose background color is the
/// them. For example to create a [ElevatedButton] whose background color is the
/// color scheme’s primary color with 50% opacity, but only when the button is
/// pressed, one could write:
///
/// ```dart
/// ContainedButton(
/// ElevatedButton(
/// style: ButtonStyle(
/// backgroundColor: MaterialStateProperty.resolveWith<Color>(
/// (Set<MaterialState> states) {
......@@ -48,11 +48,11 @@ import 'theme_data.dart';
///```
///
/// In this case the background color for all other button states would fallback
/// to the ContainedButton’s default values. To unconditionally set the button's
/// to the ElevatedButton’s default values. To unconditionally set the button's
/// [backgroundColor] for all states one could write:
///
/// ```dart
/// ContainedButton(
/// ElevatedButton(
/// style: ButtonStyle(
/// backgroundColor: MaterialStateProperty.all<Color>(Colors.green),
/// ),
......@@ -66,7 +66,7 @@ import 'theme_data.dart';
/// useful to make relatively sweeping changes based on a few initial
/// parameters with simple values. The button styleFrom() methods
/// enable such sweeping changes. See for example:
/// [TextButton.styleFrom], [ContainedButton.styleFrom],
/// [TextButton.styleFrom], [ElevatedButton.styleFrom],
/// [OutlinedButton.styleFrom].
///
/// For example, to override the default text and icon colors for a
......@@ -95,7 +95,7 @@ import 'theme_data.dart';
/// See also:
///
/// * [TextButtonTheme], the theme for [TextButton]s.
/// * [ContainedButtonTheme], the theme for [ContainedButton]s.
/// * [ElevatedButtonTheme], the theme for [ElevatedButton]s.
/// * [OutlinedButtonTheme], the theme for [OutlinedButton]s.
@immutable
class ButtonStyle with Diagnosticable {
......
......@@ -27,7 +27,7 @@ import 'theme_data.dart';
/// See also:
///
/// * [TextButton], a simple ButtonStyleButton without a shadow.
/// * [ContainedButton], a filled ButtonStyleButton whose material elevates when pressed.
/// * [ElevatedButton], a filled ButtonStyleButton whose material elevates when pressed.
/// * [OutlinedButton], similar to [TextButton], but with an outline.
abstract class ButtonStyleButton extends StatefulWidget {
/// Create a [ButtonStyleButton].
......@@ -177,7 +177,7 @@ abstract class ButtonStyleButton extends StatefulWidget {
///
/// * [ButtonStyleButton], the [StatefulWidget] subclass for which this class is the [State].
/// * [TextButton], a simple button without a shadow.
/// * [ContainedButton], a filled button whose material elevates when pressed.
/// * [ElevatedButton], a filled button whose material elevates when pressed.
/// * [OutlinedButton], similar to [TextButton], but with an outline.
class _ButtonStyleState extends State<ButtonStyleButton> {
final Set<MaterialState> _states = <MaterialState>{};
......
......@@ -11,47 +11,47 @@ import 'button_style.dart';
import 'theme.dart';
/// A [ButtonStyle] that overrides the default appearance of
/// [ContainedButton]s when it's used with [ContainedButtonTheme] or with the
/// overall [Theme]'s [ThemeData.containedButtonTheme].
/// [ElevatedButton]s when it's used with [ElevatedButtonTheme] or with the
/// overall [Theme]'s [ThemeData.ElevatedButtonTheme].
///
/// The [style]'s properties override [ContainedButton]'s default style,
/// i.e. the [ButtonStyle] returned by [ContainedButton.defaultStyleOf]. Only
/// The [style]'s properties override [ElevatedButton]'s default style,
/// i.e. the [ButtonStyle] returned by [ElevatedButton.defaultStyleOf]. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
///
/// See also:
///
/// * [ContainedButtonTheme], the theme which is configured with this class.
/// * [ContainedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// * [ElevatedButtonTheme], the theme which is configured with this class.
/// * [ElevatedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// for text buttons.
/// * [ContainedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [ContainedButton]'s defaults.
/// * [ElevatedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [ElevatedButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [ThemeData.containedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [ContainedButton]s below the overall [Theme].
/// * [ThemeData.ElevatedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [ElevatedButton]s below the overall [Theme].
@immutable
class ContainedButtonThemeData with Diagnosticable {
/// Creates a [ContainedButtonThemeData].
class ElevatedButtonThemeData with Diagnosticable {
/// Creates an [ElevatedButtonThemeData].
///
/// The [style] may be null.
const ContainedButtonThemeData({ this.style });
const ElevatedButtonThemeData({ this.style });
/// Overrides for [ContainedButton]'s default style.
/// Overrides for [ElevatedButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// values override the [ButtonStyle] returned by
/// [ContainedButton.defaultStyleOf].
/// [ElevatedButton.defaultStyleOf].
///
/// If [style] is null, then this theme doesn't override anything.
final ButtonStyle style;
/// Linearly interpolate between two contained button themes.
static ContainedButtonThemeData lerp(ContainedButtonThemeData a, ContainedButtonThemeData b, double t) {
/// Linearly interpolate between two elevated button themes.
static ElevatedButtonThemeData lerp(ElevatedButtonThemeData a, ElevatedButtonThemeData b, double t) {
assert (t != null);
if (a == null && b == null)
return null;
return ContainedButtonThemeData(
return ElevatedButtonThemeData(
style: ButtonStyle.lerp(a?.style, b?.style, t),
);
}
......@@ -67,7 +67,7 @@ class ContainedButtonThemeData with Diagnosticable {
return true;
if (other.runtimeType != runtimeType)
return false;
return other is ContainedButtonThemeData && other.style == style;
return other is ElevatedButtonThemeData && other.style == style;
}
@override
......@@ -77,51 +77,84 @@ class ContainedButtonThemeData with Diagnosticable {
}
}
/// Overrides the default [ButtonStyle] of its [ContainedButton] descendants.
/// Overrides the default [ButtonStyle] of its [ElevatedButton] descendants.
///
/// See also:
///
/// * [ContainedButtonThemeData], which is used to configure this theme.
/// * [ContainedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// for text buttons.
/// * [ContainedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [ContainedButton]'s defaults.
/// * [ThemeData.containedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [ContainedButton]s below the overall [Theme].
class ContainedButtonTheme extends InheritedTheme {
/// Create a [ContainedButtonTheme].
/// * [ElevatedButtonThemeData], which is used to configure this theme.
/// * [ElevatedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// for elevated buttons.
/// * [ElevatedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [ElevatedButton]'s defaults.
/// * [ThemeData.ElevatedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [ElevatedButton]s below the overall [Theme].
class ElevatedButtonTheme extends InheritedTheme {
/// Create a [ElevatedButtonTheme].
///
/// The [data] parameter must not be null.
const ContainedButtonTheme({
const ElevatedButtonTheme({
Key key,
@required this.data,
Widget child,
}) : assert(data != null), super(key: key, child: child);
/// The configuration of this theme.
final ContainedButtonThemeData data;
final ElevatedButtonThemeData data;
/// The closest instance of this class that encloses the given context.
///
/// If there is no enclosing [ContainedButtonsTheme] widget, then
/// [ThemeData.containedButtonTheme] is used.
/// If there is no enclosing [ElevatedButtonsTheme] widget, then
/// [ThemeData.ElevatedButtonTheme] is used.
///
/// Typical usage is as follows:
///
/// ```dart
/// ContainedButtonTheme theme = ContainedButtonTheme.of(context);
/// ElevatedButtonTheme theme = ElevatedButtonTheme.of(context);
/// ```
static ContainedButtonThemeData of(BuildContext context) {
final ContainedButtonTheme buttonTheme = context.dependOnInheritedWidgetOfExactType<ContainedButtonTheme>();
return buttonTheme?.data ?? Theme.of(context).containedButtonTheme;
static ElevatedButtonThemeData of(BuildContext context) {
final ElevatedButtonTheme buttonTheme = context.dependOnInheritedWidgetOfExactType<ElevatedButtonTheme>();
return buttonTheme?.data ?? Theme.of(context).elevatedButtonTheme;
}
@override
Widget wrap(BuildContext context, Widget child) {
final ContainedButtonTheme ancestorTheme = context.findAncestorWidgetOfExactType<ContainedButtonTheme>();
return identical(this, ancestorTheme) ? child : ContainedButtonTheme(data: data, child: child);
final ElevatedButtonTheme ancestorTheme = context.findAncestorWidgetOfExactType<ElevatedButtonTheme>();
return identical(this, ancestorTheme) ? child : ElevatedButtonTheme(data: data, child: child);
}
@override
bool updateShouldNotify(ContainedButtonTheme oldWidget) => data != oldWidget.data;
bool updateShouldNotify(ElevatedButtonTheme oldWidget) => data != oldWidget.data;
}
/// Please use [ElevatedButtonTheme].
@Deprecated(
'This class was briefly released with the wrong name. '
'The correct name is ElevatedButtonThemeData. '
'This feature was deprecated after v1.20.0-2.0.pre.'
)
@immutable
class ContainedButtonThemeData extends ElevatedButtonThemeData {
/// Please use [new ElevatedButtonTheme].
const ContainedButtonThemeData({ ButtonStyle style }) : super(style: style);
/// Please use [ElevatedButtonTheme.lerp()].
static ContainedButtonThemeData lerp(ContainedButtonThemeData a, ContainedButtonThemeData b, double t) {
return ElevatedButtonThemeData.lerp(a, b, t) as ContainedButtonThemeData;
}
}
/// Please use [ElevatedButtonThemeData].
@Deprecated(
'This class was briefly released with the wrong name. '
'The correct name is ElevatedButtonTheme. '
'This feature was deprecated after v1.20.0-2.0.pre.'
)
class ContainedButtonTheme extends ElevatedButtonTheme {
/// Please use [new ElevatedButtonThemeData].
const ContainedButtonTheme({
Key key,
@required ContainedButtonThemeData data,
Widget child,
}) : assert(data != null), super(key: key, data: data, child: child);
}
......@@ -46,7 +46,7 @@ import 'theme_data.dart';
///
/// See also:
///
/// * [ContainedButton], a filled material design button with a shadow.
/// * [ElevatedButton], a filled material design button with a shadow.
/// * [TextButton], a material design button without a shadow.
/// * <https://material.io/design/components/buttons.html>
class OutlinedButton extends ButtonStyleButton {
......
......@@ -23,7 +23,7 @@ import 'theme.dart';
///
/// * [OutlinedButtonTheme], the theme which is configured with this class.
/// * [OutlinedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// for text buttons.
/// for outlined buttons.
/// * [OutlinedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [OutlinedButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
......@@ -83,7 +83,7 @@ class OutlinedButtonThemeData with Diagnosticable {
///
/// * [OutlinedButtonThemeData], which is used to configure this theme.
/// * [OutlinedButton.defaultStyleOf], which returns the default [ButtonStyle]
/// for text buttons.
/// for outlined buttons.
/// * [OutlinedButton.styleOf], which converts simple values into a
/// [ButtonStyle] that's consistent with [OutlinedButton]'s defaults.
/// * [ThemeData.outlinedButtonTheme], which can be used to override the default
......
......@@ -54,7 +54,7 @@ import 'theme_data.dart';
/// See also:
///
/// * [OutlinedButton], a [TextButton] with a border outline.
/// * [ContainedButton], a filled button whose material elevates when pressed.
/// * [ElevatedButton], a filled button whose material elevates when pressed.
/// * <https://material.io/design/components/buttons.html>
class TextButton extends ButtonStyleButton {
/// Create a TextButton.
......
......@@ -22,9 +22,9 @@ import 'card_theme.dart';
import 'chip_theme.dart';
import 'color_scheme.dart';
import 'colors.dart';
import 'contained_button_theme.dart';
import 'dialog_theme.dart';
import 'divider_theme.dart';
import 'elevated_button_theme.dart';
import 'floating_action_button_theme.dart';
import 'ink_splash.dart';
import 'ink_well.dart' show InteractiveInkFeatureFactory;
......@@ -276,7 +276,7 @@ class ThemeData with Diagnosticable {
BottomNavigationBarThemeData bottomNavigationBarTheme,
TimePickerThemeData timePickerTheme,
TextButtonThemeData textButtonTheme,
ContainedButtonThemeData containedButtonTheme,
ElevatedButtonThemeData elevatedButtonTheme,
OutlinedButtonThemeData outlinedButtonTheme,
bool fixTextFieldOutlineLabel,
}) {
......@@ -392,7 +392,7 @@ class ThemeData with Diagnosticable {
bottomNavigationBarTheme ??= const BottomNavigationBarThemeData();
timePickerTheme ??= const TimePickerThemeData();
textButtonTheme ??= const TextButtonThemeData();
containedButtonTheme ??= const ContainedButtonThemeData();
elevatedButtonTheme ??= const ElevatedButtonThemeData();
outlinedButtonTheme ??= const OutlinedButtonThemeData();
fixTextFieldOutlineLabel ??= false;
......@@ -464,7 +464,7 @@ class ThemeData with Diagnosticable {
bottomNavigationBarTheme: bottomNavigationBarTheme,
timePickerTheme: timePickerTheme,
textButtonTheme: textButtonTheme,
containedButtonTheme: containedButtonTheme,
elevatedButtonTheme: elevatedButtonTheme,
outlinedButtonTheme: outlinedButtonTheme,
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel,
);
......@@ -548,7 +548,7 @@ class ThemeData with Diagnosticable {
@required this.bottomNavigationBarTheme,
@required this.timePickerTheme,
@required this.textButtonTheme,
@required this.containedButtonTheme,
@required this.elevatedButtonTheme,
@required this.outlinedButtonTheme,
@required this.fixTextFieldOutlineLabel,
}) : assert(visualDensity != null),
......@@ -615,7 +615,7 @@ class ThemeData with Diagnosticable {
assert(bottomNavigationBarTheme != null),
assert(timePickerTheme != null),
assert(textButtonTheme != null),
assert(containedButtonTheme != null),
assert(elevatedButtonTheme != null),
assert(outlinedButtonTheme != null),
assert(fixTextFieldOutlineLabel != null);
......@@ -1086,8 +1086,8 @@ class ThemeData with Diagnosticable {
final TextButtonThemeData textButtonTheme;
/// A theme for customizing the appearance and internal layout of
/// [ContainedButton]s
final ContainedButtonThemeData containedButtonTheme;
/// [ElevatedButton]s
final ElevatedButtonThemeData elevatedButtonTheme;
/// A theme for customizing the appearance and internal layout of
/// [OutlinedButton]s.
......@@ -1177,7 +1177,7 @@ class ThemeData with Diagnosticable {
BottomNavigationBarThemeData bottomNavigationBarTheme,
TimePickerThemeData timePickerTheme,
TextButtonThemeData textButtonTheme,
ContainedButtonThemeData containedButtonTheme,
ElevatedButtonThemeData elevatedButtonTheme,
OutlinedButtonThemeData outlinedButtonTheme,
bool fixTextFieldOutlineLabel,
}) {
......@@ -1250,7 +1250,7 @@ class ThemeData with Diagnosticable {
bottomNavigationBarTheme: bottomNavigationBarTheme ?? this.bottomNavigationBarTheme,
timePickerTheme: timePickerTheme ?? this.timePickerTheme,
textButtonTheme: textButtonTheme ?? this.textButtonTheme,
containedButtonTheme: containedButtonTheme ?? this.containedButtonTheme,
elevatedButtonTheme: elevatedButtonTheme ?? this.elevatedButtonTheme,
outlinedButtonTheme: outlinedButtonTheme ?? this.outlinedButtonTheme,
fixTextFieldOutlineLabel: fixTextFieldOutlineLabel ?? this.fixTextFieldOutlineLabel,
);
......@@ -1401,7 +1401,7 @@ class ThemeData with Diagnosticable {
bottomNavigationBarTheme: BottomNavigationBarThemeData.lerp(a.bottomNavigationBarTheme, b.bottomNavigationBarTheme, t),
timePickerTheme: TimePickerThemeData.lerp(a.timePickerTheme, b.timePickerTheme, t),
textButtonTheme: TextButtonThemeData.lerp(a.textButtonTheme, b.textButtonTheme, t),
containedButtonTheme: ContainedButtonThemeData.lerp(a.containedButtonTheme, b.containedButtonTheme, t),
elevatedButtonTheme: ElevatedButtonThemeData.lerp(a.elevatedButtonTheme, b.elevatedButtonTheme, t),
outlinedButtonTheme: OutlinedButtonThemeData.lerp(a.outlinedButtonTheme, b.outlinedButtonTheme, t),
fixTextFieldOutlineLabel: t < 0.5 ? a.fixTextFieldOutlineLabel : b.fixTextFieldOutlineLabel,
);
......@@ -1480,7 +1480,7 @@ class ThemeData with Diagnosticable {
&& other.bottomNavigationBarTheme == bottomNavigationBarTheme
&& other.timePickerTheme == timePickerTheme
&& other.textButtonTheme == textButtonTheme
&& other.containedButtonTheme == containedButtonTheme
&& other.elevatedButtonTheme == elevatedButtonTheme
&& other.outlinedButtonTheme == outlinedButtonTheme
&& other.fixTextFieldOutlineLabel == fixTextFieldOutlineLabel;
}
......@@ -1558,7 +1558,7 @@ class ThemeData with Diagnosticable {
bottomNavigationBarTheme,
timePickerTheme,
textButtonTheme,
containedButtonTheme,
elevatedButtonTheme,
outlinedButtonTheme,
fixTextFieldOutlineLabel,
];
......@@ -1633,7 +1633,7 @@ class ThemeData with Diagnosticable {
properties.add(DiagnosticsProperty<TimePickerThemeData>('timePickerTheme', timePickerTheme, defaultValue: defaultData.timePickerTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<BottomNavigationBarThemeData>('bottomNavigationBarTheme', bottomNavigationBarTheme, defaultValue: defaultData.bottomNavigationBarTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<TextButtonThemeData>('textButtonTheme', textButtonTheme, defaultValue: defaultData.textButtonTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<ContainedButtonThemeData>('containedButtonTheme', containedButtonTheme, defaultValue: defaultData.containedButtonTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<ElevatedButtonThemeData>('elevatedButtonTheme', elevatedButtonTheme, defaultValue: defaultData.elevatedButtonTheme, level: DiagnosticLevel.debug));
properties.add(DiagnosticsProperty<OutlinedButtonThemeData>('outlinedButtonTheme', outlinedButtonTheme, defaultValue: defaultData.outlinedButtonTheme, level: DiagnosticLevel.debug));
}
}
......
......@@ -9,14 +9,14 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Passing no ContainedButtonTheme returns defaults', (WidgetTester tester) async {
testWidgets('Passing no ElevatedButtonTheme returns defaults', (WidgetTester tester) async {
const ColorScheme colorScheme = ColorScheme.light();
await tester.pumpWidget(
MaterialApp(
theme: ThemeData.from(colorScheme: colorScheme),
home: Scaffold(
body: Center(
child: ContainedButton(
child: ElevatedButton(
onPressed: () { },
child: const Text('button'),
),
......@@ -26,7 +26,7 @@ void main() {
);
final Finder buttonMaterial = find.descendant(
of: find.byType(ContainedButton),
of: find.byType(ElevatedButton),
matching: find.byType(Material),
);
......@@ -43,7 +43,7 @@ void main() {
expect(material.textStyle.fontWeight, FontWeight.w500);
});
group('[Theme, TextTheme, ContainedButton style overrides]', () {
group('[Theme, TextTheme, ElevatedButton style overrides]', () {
const Color primaryColor = Color(0xff000001);
const Color onSurfaceColor = Color(0xff000002);
const Color shadowColor = Color(0xff000004);
......@@ -60,7 +60,7 @@ void main() {
const Duration animationDuration = Duration(milliseconds: 25);
const bool enableFeedback = false;
final ButtonStyle style = ContainedButton.styleFrom(
final ButtonStyle style = ElevatedButton.styleFrom(
primary: primaryColor,
onPrimary: onPrimaryColor,
onSurface: onSurfaceColor,
......@@ -81,7 +81,7 @@ void main() {
Widget buildFrame({ ButtonStyle buttonStyle, ButtonStyle themeStyle, ButtonStyle overallStyle }) {
final Widget child = Builder(
builder: (BuildContext context) {
return ContainedButton(
return ElevatedButton(
style: buttonStyle,
onPressed: () { },
child: const Text('button'),
......@@ -90,14 +90,14 @@ void main() {
);
return MaterialApp(
theme: ThemeData.from(colorScheme: const ColorScheme.light()).copyWith(
containedButtonTheme: ContainedButtonThemeData(style: overallStyle),
elevatedButtonTheme: ElevatedButtonThemeData(style: overallStyle),
),
home: Scaffold(
body: Center(
// If the ContainedButtonTheme widget is present, it's used
// instead of the Theme's ThemeData.containedButtonTheme.
child: themeStyle == null ? child : ContainedButtonTheme(
data: ContainedButtonThemeData(style: themeStyle),
// If the ElevatedButtonTheme widget is present, it's used
// instead of the Theme's ThemeData.ElevatedButtonTheme.
child: themeStyle == null ? child : ElevatedButtonTheme(
data: ElevatedButtonThemeData(style: themeStyle),
child: child,
),
),
......@@ -106,12 +106,12 @@ void main() {
}
final Finder findMaterial = find.descendant(
of: find.byType(ContainedButton),
of: find.byType(ElevatedButton),
matching: find.byType(Material),
);
final Finder findInkWell = find.descendant(
of: find.byType(ContainedButton),
of: find.byType(ElevatedButton),
matching: find.byType(InkWell),
);
......@@ -138,7 +138,7 @@ void main() {
expect(material.borderRadius, null);
expect(material.shape, shape);
expect(material.animationDuration, animationDuration);
expect(tester.getSize(find.byType(ContainedButton)), const Size(200, 200));
expect(tester.getSize(find.byType(ElevatedButton)), const Size(200, 200));
}
testWidgets('Button style overrides defaults', (WidgetTester tester) async {
......
......@@ -285,7 +285,7 @@ void main() {
bottomNavigationBarTheme: const BottomNavigationBarThemeData(type: BottomNavigationBarType.fixed),
timePickerTheme: const TimePickerThemeData(backgroundColor: Colors.black),
textButtonTheme: TextButtonThemeData(style: TextButton.styleFrom(primary: Colors.red)),
containedButtonTheme: ContainedButtonThemeData(style: ContainedButton.styleFrom(primary: Colors.green)),
elevatedButtonTheme: ElevatedButtonThemeData(style: ElevatedButton.styleFrom(primary: Colors.green)),
outlinedButtonTheme: OutlinedButtonThemeData(style: OutlinedButton.styleFrom(primary: Colors.blue)),
fixTextFieldOutlineLabel: false,
);
......@@ -371,7 +371,7 @@ void main() {
bottomNavigationBarTheme: const BottomNavigationBarThemeData(type: BottomNavigationBarType.shifting),
timePickerTheme: const TimePickerThemeData(backgroundColor: Colors.white),
textButtonTheme: const TextButtonThemeData(),
containedButtonTheme: const ContainedButtonThemeData(),
elevatedButtonTheme: const ElevatedButtonThemeData(),
outlinedButtonTheme: const OutlinedButtonThemeData(),
fixTextFieldOutlineLabel: true,
);
......@@ -443,7 +443,7 @@ void main() {
bottomNavigationBarTheme: otherTheme.bottomNavigationBarTheme,
timePickerTheme: otherTheme.timePickerTheme,
textButtonTheme: otherTheme.textButtonTheme,
containedButtonTheme: otherTheme.containedButtonTheme,
elevatedButtonTheme: otherTheme.elevatedButtonTheme,
outlinedButtonTheme: otherTheme.outlinedButtonTheme,
fixTextFieldOutlineLabel: otherTheme.fixTextFieldOutlineLabel,
);
......@@ -514,7 +514,7 @@ void main() {
expect(themeDataCopy.bottomNavigationBarTheme, equals(otherTheme.bottomNavigationBarTheme));
expect(themeDataCopy.timePickerTheme, equals(otherTheme.timePickerTheme));
expect(themeDataCopy.textButtonTheme, equals(otherTheme.textButtonTheme));
expect(themeDataCopy.containedButtonTheme, equals(otherTheme.containedButtonTheme));
expect(themeDataCopy.elevatedButtonTheme, equals(otherTheme.elevatedButtonTheme));
expect(themeDataCopy.outlinedButtonTheme, equals(otherTheme.outlinedButtonTheme));
expect(themeDataCopy.fixTextFieldOutlineLabel, equals(otherTheme.fixTextFieldOutlineLabel));
});
......
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