Revert "Add shadowColor and surfaceTintColor to Dialog and DialogTheme." (#108621)
This commit is contained in:
parent
5532775b19
commit
4ed9d9de4d
@ -27,11 +27,9 @@ class _${blockName}DefaultsM3 extends DialogTheme {
|
|||||||
@override
|
@override
|
||||||
Color? get iconColor => _colors.secondary;
|
Color? get iconColor => _colors.secondary;
|
||||||
|
|
||||||
|
// TODO(darrenaustin): overlay should be handled by Material widget: https://github.com/flutter/flutter/issues/9160
|
||||||
@override
|
@override
|
||||||
Color? get backgroundColor => ${componentColor("md.comp.dialog.container")};
|
Color? get backgroundColor => ElevationOverlay.colorWithOverlay(${componentColor("md.comp.dialog.container")}, _colors.primary, ${elevation("md.comp.dialog.container")});
|
||||||
|
|
||||||
@override
|
|
||||||
Color? get surfaceTintColor => ${componentColor("md.comp.dialog.container.surface-tint-layer")};
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
TextStyle? get titleTextStyle => ${textStyle("md.comp.dialog.headline")};
|
TextStyle? get titleTextStyle => ${textStyle("md.comp.dialog.headline")};
|
||||||
|
@ -11,6 +11,7 @@ import 'color_scheme.dart';
|
|||||||
import 'colors.dart';
|
import 'colors.dart';
|
||||||
import 'debug.dart';
|
import 'debug.dart';
|
||||||
import 'dialog_theme.dart';
|
import 'dialog_theme.dart';
|
||||||
|
import 'elevation_overlay.dart';
|
||||||
import 'ink_well.dart';
|
import 'ink_well.dart';
|
||||||
import 'material.dart';
|
import 'material.dart';
|
||||||
import 'material_localizations.dart';
|
import 'material_localizations.dart';
|
||||||
@ -45,8 +46,6 @@ class Dialog extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.elevation,
|
this.elevation,
|
||||||
this.shadowColor,
|
|
||||||
this.surfaceTintColor,
|
|
||||||
this.insetAnimationDuration = const Duration(milliseconds: 100),
|
this.insetAnimationDuration = const Duration(milliseconds: 100),
|
||||||
this.insetAnimationCurve = Curves.decelerate,
|
this.insetAnimationCurve = Curves.decelerate,
|
||||||
this.insetPadding = _defaultInsetPadding,
|
this.insetPadding = _defaultInsetPadding,
|
||||||
@ -54,8 +53,7 @@ class Dialog extends StatelessWidget {
|
|||||||
this.shape,
|
this.shape,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
this.child,
|
this.child,
|
||||||
}) : assert(clipBehavior != null),
|
}) : assert(clipBehavior != null);
|
||||||
assert(elevation == null || elevation >= 0.0);
|
|
||||||
|
|
||||||
/// {@template flutter.material.dialog.backgroundColor}
|
/// {@template flutter.material.dialog.backgroundColor}
|
||||||
/// The background color of the surface of this [Dialog].
|
/// The background color of the surface of this [Dialog].
|
||||||
@ -69,53 +67,12 @@ class Dialog extends StatelessWidget {
|
|||||||
/// {@template flutter.material.dialog.elevation}
|
/// {@template flutter.material.dialog.elevation}
|
||||||
/// The z-coordinate of this [Dialog].
|
/// The z-coordinate of this [Dialog].
|
||||||
///
|
///
|
||||||
/// Controls how far above the parent the dialog will appear. Elevation is
|
/// If null then [DialogTheme.elevation] is used, and if that's null then the
|
||||||
/// represented by a drop shadow if [shadowColor] is non null,
|
/// dialog's elevation is 24.0.
|
||||||
/// and a surface tint overlay on the background color if [surfaceTintColor] is
|
|
||||||
/// non null.
|
|
||||||
///
|
|
||||||
/// If null then [DialogTheme.elevation] is used, and if that is null then
|
|
||||||
/// the elevation will match the Material Design specification for Dialogs.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [Material.elevation], which describes how [elevation] effects the
|
|
||||||
/// drop shadow or surface tint overlay.
|
|
||||||
/// * [shadowColor], color of the drop shadow used to indicate the elevation.
|
|
||||||
/// * [surfaceTintColor], color of an overlay on top of the background
|
|
||||||
/// color used to indicate the elevation.
|
|
||||||
/// * <https://m3.material.io/components/dialogs/overview>, the Material
|
|
||||||
/// Design specification for dialogs.
|
|
||||||
/// {@endtemplate}
|
/// {@endtemplate}
|
||||||
|
/// {@macro flutter.material.material.elevation}
|
||||||
final double? elevation;
|
final double? elevation;
|
||||||
|
|
||||||
/// {@template flutter.material.dialog.shadowColor}
|
|
||||||
/// The color to paint the [elevation] shadow under the dialog's [Material].
|
|
||||||
///
|
|
||||||
/// If null then no drop shadow will be painted.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [Material.shadowColor], which describes how the drop shadow is painted.
|
|
||||||
/// * [elevation], effects how the drop shadow is painted.
|
|
||||||
/// * [surfaceTintColor], if non-null will also provide a surface tint
|
|
||||||
/// overlay on the background color to indicate elevation.
|
|
||||||
/// {@endtemplate}
|
|
||||||
final Color? shadowColor;
|
|
||||||
|
|
||||||
/// {@template flutter.material.dialog.surfaceTintColor}
|
|
||||||
/// The color used as a surface tint overlay on the dialog's background color,
|
|
||||||
/// which reflects the dialog's [elevation].
|
|
||||||
///
|
|
||||||
/// If null then no surface tint will be applied.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// * [Material.surfaceTintColor], which describes how the surface tint will
|
|
||||||
/// be applied to the background color of the dialog.
|
|
||||||
/// * [elevation], effects the opacity of the surface tint.
|
|
||||||
/// * [shadowColor], if non-null will also provide a drop shadow to
|
|
||||||
/// indicate elevation.
|
|
||||||
/// {@endtemplate}
|
|
||||||
final Color? surfaceTintColor;
|
|
||||||
|
|
||||||
/// {@template flutter.material.dialog.insetAnimationDuration}
|
/// {@template flutter.material.dialog.insetAnimationDuration}
|
||||||
/// The duration of the animation to show when the system keyboard intrudes
|
/// The duration of the animation to show when the system keyboard intrudes
|
||||||
/// into the space that the dialog is placed in.
|
/// into the space that the dialog is placed in.
|
||||||
@ -198,8 +155,6 @@ class Dialog extends StatelessWidget {
|
|||||||
child: Material(
|
child: Material(
|
||||||
color: backgroundColor ?? dialogTheme.backgroundColor ?? Theme.of(context).dialogBackgroundColor,
|
color: backgroundColor ?? dialogTheme.backgroundColor ?? Theme.of(context).dialogBackgroundColor,
|
||||||
elevation: elevation ?? dialogTheme.elevation ?? defaults.elevation!,
|
elevation: elevation ?? dialogTheme.elevation ?? defaults.elevation!,
|
||||||
shadowColor: shadowColor ?? dialogTheme.shadowColor ?? defaults.shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor ?? dialogTheme.surfaceTintColor ?? defaults.surfaceTintColor,
|
|
||||||
shape: shape ?? dialogTheme.shape ?? defaults.shape!,
|
shape: shape ?? dialogTheme.shape ?? defaults.shape!,
|
||||||
type: MaterialType.card,
|
type: MaterialType.card,
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
@ -325,8 +280,6 @@ class AlertDialog extends StatelessWidget {
|
|||||||
this.buttonPadding,
|
this.buttonPadding,
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.elevation,
|
this.elevation,
|
||||||
this.shadowColor,
|
|
||||||
this.surfaceTintColor,
|
|
||||||
this.semanticLabel,
|
this.semanticLabel,
|
||||||
this.insetPadding = _defaultInsetPadding,
|
this.insetPadding = _defaultInsetPadding,
|
||||||
this.clipBehavior = Clip.none,
|
this.clipBehavior = Clip.none,
|
||||||
@ -525,14 +478,9 @@ class AlertDialog extends StatelessWidget {
|
|||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.elevation}
|
/// {@macro flutter.material.dialog.elevation}
|
||||||
|
/// {@macro flutter.material.material.elevation}
|
||||||
final double? elevation;
|
final double? elevation;
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.shadowColor}
|
|
||||||
final Color? shadowColor;
|
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.surfaceTintColor}
|
|
||||||
final Color? surfaceTintColor;
|
|
||||||
|
|
||||||
/// The semantic label of the dialog used by accessibility frameworks to
|
/// The semantic label of the dialog used by accessibility frameworks to
|
||||||
/// announce screen transitions when the dialog is opened and closed.
|
/// announce screen transitions when the dialog is opened and closed.
|
||||||
///
|
///
|
||||||
@ -747,8 +695,6 @@ class AlertDialog extends StatelessWidget {
|
|||||||
return Dialog(
|
return Dialog(
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
elevation: elevation,
|
elevation: elevation,
|
||||||
shadowColor: shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor,
|
|
||||||
insetPadding: insetPadding,
|
insetPadding: insetPadding,
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
shape: shape,
|
shape: shape,
|
||||||
@ -914,8 +860,6 @@ class SimpleDialog extends StatelessWidget {
|
|||||||
this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
|
this.contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.elevation,
|
this.elevation,
|
||||||
this.shadowColor,
|
|
||||||
this.surfaceTintColor,
|
|
||||||
this.semanticLabel,
|
this.semanticLabel,
|
||||||
this.insetPadding = _defaultInsetPadding,
|
this.insetPadding = _defaultInsetPadding,
|
||||||
this.clipBehavior = Clip.none,
|
this.clipBehavior = Clip.none,
|
||||||
@ -971,14 +915,9 @@ class SimpleDialog extends StatelessWidget {
|
|||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.elevation}
|
/// {@macro flutter.material.dialog.elevation}
|
||||||
|
/// {@macro flutter.material.material.elevation}
|
||||||
final double? elevation;
|
final double? elevation;
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.shadowColor}
|
|
||||||
final Color? shadowColor;
|
|
||||||
|
|
||||||
/// {@macro flutter.material.dialog.surfaceTintColor}
|
|
||||||
final Color? surfaceTintColor;
|
|
||||||
|
|
||||||
/// The semantic label of the dialog used by accessibility frameworks to
|
/// The semantic label of the dialog used by accessibility frameworks to
|
||||||
/// announce screen transitions when the dialog is opened and closed.
|
/// announce screen transitions when the dialog is opened and closed.
|
||||||
///
|
///
|
||||||
@ -1092,8 +1031,6 @@ class SimpleDialog extends StatelessWidget {
|
|||||||
return Dialog(
|
return Dialog(
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
elevation: elevation,
|
elevation: elevation,
|
||||||
shadowColor: shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor,
|
|
||||||
insetPadding: insetPadding,
|
insetPadding: insetPadding,
|
||||||
clipBehavior: clipBehavior,
|
clipBehavior: clipBehavior,
|
||||||
shape: shape,
|
shape: shape,
|
||||||
@ -1359,9 +1296,6 @@ class _DialogDefaultsM2 extends DialogTheme {
|
|||||||
@override
|
@override
|
||||||
Color? get backgroundColor => Theme.of(context).dialogBackgroundColor;
|
Color? get backgroundColor => Theme.of(context).dialogBackgroundColor;
|
||||||
|
|
||||||
@override
|
|
||||||
Color? get shadowColor => Theme.of(context).shadowColor;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
TextStyle? get titleTextStyle => _textTheme.headline6;
|
TextStyle? get titleTextStyle => _textTheme.headline6;
|
||||||
|
|
||||||
@ -1396,11 +1330,9 @@ class _DialogDefaultsM3 extends DialogTheme {
|
|||||||
@override
|
@override
|
||||||
Color? get iconColor => _colors.secondary;
|
Color? get iconColor => _colors.secondary;
|
||||||
|
|
||||||
|
// TODO(darrenaustin): overlay should be handled by Material widget: https://github.com/flutter/flutter/issues/9160
|
||||||
@override
|
@override
|
||||||
Color? get backgroundColor => _colors.surface;
|
Color? get backgroundColor => ElevationOverlay.colorWithOverlay(_colors.surface, _colors.primary, 6.0);
|
||||||
|
|
||||||
@override
|
|
||||||
Color? get surfaceTintColor => _colors.surfaceTint;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
TextStyle? get titleTextStyle => _textTheme.headlineSmall;
|
TextStyle? get titleTextStyle => _textTheme.headlineSmall;
|
||||||
|
@ -30,8 +30,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
const DialogTheme({
|
const DialogTheme({
|
||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.elevation,
|
this.elevation,
|
||||||
this.shadowColor,
|
|
||||||
this.surfaceTintColor,
|
|
||||||
this.shape,
|
this.shape,
|
||||||
this.alignment,
|
this.alignment,
|
||||||
this.iconColor,
|
this.iconColor,
|
||||||
@ -46,12 +44,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
/// Overrides the default value for [Dialog.elevation].
|
/// Overrides the default value for [Dialog.elevation].
|
||||||
final double? elevation;
|
final double? elevation;
|
||||||
|
|
||||||
/// Overrides the default value for [Dialog.shadowColor].
|
|
||||||
final Color? shadowColor;
|
|
||||||
|
|
||||||
/// Overrides the default value for [Dialog.surfaceTintColor].
|
|
||||||
final Color? surfaceTintColor;
|
|
||||||
|
|
||||||
/// Overrides the default value for [Dialog.shape].
|
/// Overrides the default value for [Dialog.shape].
|
||||||
final ShapeBorder? shape;
|
final ShapeBorder? shape;
|
||||||
|
|
||||||
@ -77,8 +69,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
DialogTheme copyWith({
|
DialogTheme copyWith({
|
||||||
Color? backgroundColor,
|
Color? backgroundColor,
|
||||||
double? elevation,
|
double? elevation,
|
||||||
Color? shadowColor,
|
|
||||||
Color? surfaceTintColor,
|
|
||||||
ShapeBorder? shape,
|
ShapeBorder? shape,
|
||||||
AlignmentGeometry? alignment,
|
AlignmentGeometry? alignment,
|
||||||
Color? iconColor,
|
Color? iconColor,
|
||||||
@ -89,8 +79,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
return DialogTheme(
|
return DialogTheme(
|
||||||
backgroundColor: backgroundColor ?? this.backgroundColor,
|
backgroundColor: backgroundColor ?? this.backgroundColor,
|
||||||
elevation: elevation ?? this.elevation,
|
elevation: elevation ?? this.elevation,
|
||||||
shadowColor: shadowColor ?? this.shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor ?? this.surfaceTintColor,
|
|
||||||
shape: shape ?? this.shape,
|
shape: shape ?? this.shape,
|
||||||
alignment: alignment ?? this.alignment,
|
alignment: alignment ?? this.alignment,
|
||||||
iconColor: iconColor ?? this.iconColor,
|
iconColor: iconColor ?? this.iconColor,
|
||||||
@ -115,8 +103,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
return DialogTheme(
|
return DialogTheme(
|
||||||
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
|
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
|
||||||
elevation: lerpDouble(a?.elevation, b?.elevation, t),
|
elevation: lerpDouble(a?.elevation, b?.elevation, t),
|
||||||
shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
|
|
||||||
surfaceTintColor: Color.lerp(a?.surfaceTintColor, b?.surfaceTintColor, t),
|
|
||||||
shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
|
shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
|
||||||
alignment: AlignmentGeometry.lerp(a?.alignment, b?.alignment, t),
|
alignment: AlignmentGeometry.lerp(a?.alignment, b?.alignment, t),
|
||||||
iconColor: Color.lerp(a?.iconColor, b?.iconColor, t),
|
iconColor: Color.lerp(a?.iconColor, b?.iconColor, t),
|
||||||
@ -140,8 +126,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
return other is DialogTheme
|
return other is DialogTheme
|
||||||
&& other.backgroundColor == backgroundColor
|
&& other.backgroundColor == backgroundColor
|
||||||
&& other.elevation == elevation
|
&& other.elevation == elevation
|
||||||
&& other.shadowColor == shadowColor
|
|
||||||
&& other.surfaceTintColor == surfaceTintColor
|
|
||||||
&& other.shape == shape
|
&& other.shape == shape
|
||||||
&& other.alignment == alignment
|
&& other.alignment == alignment
|
||||||
&& other.iconColor == iconColor
|
&& other.iconColor == iconColor
|
||||||
@ -155,8 +139,6 @@ class DialogTheme with Diagnosticable {
|
|||||||
super.debugFillProperties(properties);
|
super.debugFillProperties(properties);
|
||||||
properties.add(ColorProperty('backgroundColor', backgroundColor));
|
properties.add(ColorProperty('backgroundColor', backgroundColor));
|
||||||
properties.add(DoubleProperty('elevation', elevation));
|
properties.add(DoubleProperty('elevation', elevation));
|
||||||
properties.add(ColorProperty('shadowColor', shadowColor));
|
|
||||||
properties.add(ColorProperty('surfaceTintColor', surfaceTintColor));
|
|
||||||
properties.add(DiagnosticsProperty<ShapeBorder>('shape', shape, defaultValue: null));
|
properties.add(DiagnosticsProperty<ShapeBorder>('shape', shape, defaultValue: null));
|
||||||
properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment, defaultValue: null));
|
properties.add(DiagnosticsProperty<AlignmentGeometry>('alignment', alignment, defaultValue: null));
|
||||||
properties.add(ColorProperty('iconColor', iconColor));
|
properties.add(ColorProperty('iconColor', iconColor));
|
||||||
|
@ -140,13 +140,9 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('Custom dialog elevation', (WidgetTester tester) async {
|
testWidgets('Custom dialog elevation', (WidgetTester tester) async {
|
||||||
const double customElevation = 12.0;
|
const double customElevation = 12.0;
|
||||||
const Color shadowColor = Color(0xFF000001);
|
|
||||||
const Color surfaceTintColor = Color(0xFF000002);
|
|
||||||
const AlertDialog dialog = AlertDialog(
|
const AlertDialog dialog = AlertDialog(
|
||||||
actions: <Widget>[ ],
|
actions: <Widget>[ ],
|
||||||
elevation: customElevation,
|
elevation: customElevation,
|
||||||
shadowColor: shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor,
|
|
||||||
);
|
);
|
||||||
await tester.pumpWidget(_buildAppWithDialog(dialog));
|
await tester.pumpWidget(_buildAppWithDialog(dialog));
|
||||||
|
|
||||||
@ -155,8 +151,6 @@ void main() {
|
|||||||
|
|
||||||
final Material materialWidget = _getMaterialFromDialog(tester);
|
final Material materialWidget = _getMaterialFromDialog(tester);
|
||||||
expect(materialWidget.elevation, customElevation);
|
expect(materialWidget.elevation, customElevation);
|
||||||
expect(materialWidget.shadowColor, shadowColor);
|
|
||||||
expect(materialWidget.surfaceTintColor, surfaceTintColor);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Custom Title Text Style', (WidgetTester tester) async {
|
testWidgets('Custom Title Text Style', (WidgetTester tester) async {
|
||||||
|
@ -51,8 +51,6 @@ void main() {
|
|||||||
const DialogTheme(
|
const DialogTheme(
|
||||||
backgroundColor: Color(0xff123456),
|
backgroundColor: Color(0xff123456),
|
||||||
elevation: 8.0,
|
elevation: 8.0,
|
||||||
shadowColor: Color(0xff000001),
|
|
||||||
surfaceTintColor: Color(0xff000002),
|
|
||||||
alignment: Alignment.bottomLeft,
|
alignment: Alignment.bottomLeft,
|
||||||
iconColor: Color(0xff654321),
|
iconColor: Color(0xff654321),
|
||||||
titleTextStyle: TextStyle(color: Color(0xffffffff)),
|
titleTextStyle: TextStyle(color: Color(0xffffffff)),
|
||||||
@ -65,8 +63,6 @@ void main() {
|
|||||||
expect(description, <String>[
|
expect(description, <String>[
|
||||||
'backgroundColor: Color(0xff123456)',
|
'backgroundColor: Color(0xff123456)',
|
||||||
'elevation: 8.0',
|
'elevation: 8.0',
|
||||||
'shadowColor: Color(0xff000001)',
|
|
||||||
'surfaceTintColor: Color(0xff000002)',
|
|
||||||
'alignment: Alignment.bottomLeft',
|
'alignment: Alignment.bottomLeft',
|
||||||
'iconColor: Color(0xff654321)',
|
'iconColor: Color(0xff654321)',
|
||||||
'titleTextStyle: TextStyle(inherit: true, color: Color(0xffffffff))',
|
'titleTextStyle: TextStyle(inherit: true, color: Color(0xffffffff))',
|
||||||
@ -93,19 +89,11 @@ void main() {
|
|||||||
|
|
||||||
testWidgets('Custom dialog elevation', (WidgetTester tester) async {
|
testWidgets('Custom dialog elevation', (WidgetTester tester) async {
|
||||||
const double customElevation = 12.0;
|
const double customElevation = 12.0;
|
||||||
const Color shadowColor = Color(0xFF000001);
|
|
||||||
const Color surfaceTintColor = Color(0xFF000002);
|
|
||||||
const AlertDialog dialog = AlertDialog(
|
const AlertDialog dialog = AlertDialog(
|
||||||
title: Text('Title'),
|
title: Text('Title'),
|
||||||
actions: <Widget>[ ],
|
actions: <Widget>[ ],
|
||||||
);
|
);
|
||||||
final ThemeData theme = ThemeData(
|
final ThemeData theme = ThemeData(dialogTheme: const DialogTheme(elevation: customElevation));
|
||||||
dialogTheme: const DialogTheme(
|
|
||||||
elevation: customElevation,
|
|
||||||
shadowColor: shadowColor,
|
|
||||||
surfaceTintColor: surfaceTintColor,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
_appWithDialog(tester, dialog, theme: theme),
|
_appWithDialog(tester, dialog, theme: theme),
|
||||||
@ -115,8 +103,6 @@ void main() {
|
|||||||
|
|
||||||
final Material materialWidget = _getMaterialFromDialog(tester);
|
final Material materialWidget = _getMaterialFromDialog(tester);
|
||||||
expect(materialWidget.elevation, customElevation);
|
expect(materialWidget.elevation, customElevation);
|
||||||
expect(materialWidget.shadowColor, shadowColor);
|
|
||||||
expect(materialWidget.surfaceTintColor, surfaceTintColor);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Custom dialog shape', (WidgetTester tester) async {
|
testWidgets('Custom dialog shape', (WidgetTester tester) async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user