Unverified Commit 2b317d58 authored by hangyu's avatar hangyu Committed by GitHub

Add a `minTileHeight` to ListTile widget so its height can be customized to...

Add a `minTileHeight` to ListTile widget so its height can be customized to less than the default height. (#145244)

fixes: https://github.com/flutter/flutter/issues/145369
parent 6190c5ee
...@@ -251,6 +251,7 @@ class ExpansionTile extends StatefulWidget { ...@@ -251,6 +251,7 @@ class ExpansionTile extends StatefulWidget {
this.controller, this.controller,
this.dense, this.dense,
this.visualDensity, this.visualDensity,
this.minTileHeight,
this.enableFeedback = true, this.enableFeedback = true,
this.enabled = true, this.enabled = true,
this.expansionAnimationStyle, this.expansionAnimationStyle,
...@@ -508,6 +509,9 @@ class ExpansionTile extends StatefulWidget { ...@@ -508,6 +509,9 @@ class ExpansionTile extends StatefulWidget {
/// {@macro flutter.material.themedata.visualDensity} /// {@macro flutter.material.themedata.visualDensity}
final VisualDensity? visualDensity; final VisualDensity? visualDensity;
/// {@macro flutter.material.ListTile.minTileHeight}
final double? minTileHeight;
/// {@macro flutter.material.ListTile.enableFeedback} /// {@macro flutter.material.ListTile.enableFeedback}
final bool? enableFeedback; final bool? enableFeedback;
...@@ -710,6 +714,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider ...@@ -710,6 +714,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
title: widget.title, title: widget.title,
subtitle: widget.subtitle, subtitle: widget.subtitle,
trailing: widget.trailing ?? _buildTrailingIcon(context), trailing: widget.trailing ?? _buildTrailingIcon(context),
minTileHeight: widget.minTileHeight,
), ),
), ),
), ),
......
...@@ -364,6 +364,7 @@ class ListTile extends StatelessWidget { ...@@ -364,6 +364,7 @@ class ListTile extends StatelessWidget {
this.horizontalTitleGap, this.horizontalTitleGap,
this.minVerticalPadding, this.minVerticalPadding,
this.minLeadingWidth, this.minLeadingWidth,
this.minTileHeight,
this.titleAlignment, this.titleAlignment,
}) : assert(!isThreeLine || subtitle != null); }) : assert(!isThreeLine || subtitle != null);
...@@ -669,6 +670,16 @@ class ListTile extends StatelessWidget { ...@@ -669,6 +670,16 @@ class ListTile extends StatelessWidget {
/// that is also null, then a default value of 40 is used. /// that is also null, then a default value of 40 is used.
final double? minLeadingWidth; final double? minLeadingWidth;
/// {@template flutter.material.ListTile.minTileHeight}
/// The minimum height allocated for the [ListTile] widget.
///
/// If this is null, default tile heights are 56.0, 72.0, and 88.0 for one,
/// two, and three lines of text respectively. If `isDense` is true, these
/// defaults are changed to 48.0, 64.0, and 76.0. A visual density value or
/// a large title will also adjust the default tile heights.
/// {@endtemplate}
final double? minTileHeight;
/// Defines how [ListTile.leading] and [ListTile.trailing] are /// Defines how [ListTile.leading] and [ListTile.trailing] are
/// vertically aligned relative to the [ListTile]'s titles /// vertically aligned relative to the [ListTile]'s titles
/// ([ListTile.title] and [ListTile.subtitle]). /// ([ListTile.title] and [ListTile.subtitle]).
...@@ -884,6 +895,7 @@ class ListTile extends StatelessWidget { ...@@ -884,6 +895,7 @@ class ListTile extends StatelessWidget {
horizontalTitleGap: horizontalTitleGap ?? tileTheme.horizontalTitleGap ?? 16, horizontalTitleGap: horizontalTitleGap ?? tileTheme.horizontalTitleGap ?? 16,
minVerticalPadding: minVerticalPadding ?? tileTheme.minVerticalPadding ?? defaults.minVerticalPadding!, minVerticalPadding: minVerticalPadding ?? tileTheme.minVerticalPadding ?? defaults.minVerticalPadding!,
minLeadingWidth: minLeadingWidth ?? tileTheme.minLeadingWidth ?? defaults.minLeadingWidth!, minLeadingWidth: minLeadingWidth ?? tileTheme.minLeadingWidth ?? defaults.minLeadingWidth!,
minTileHeight: minTileHeight ?? tileTheme.minTileHeight,
titleAlignment: effectiveTitleAlignment, titleAlignment: effectiveTitleAlignment,
), ),
), ),
...@@ -978,6 +990,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende ...@@ -978,6 +990,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende
required this.horizontalTitleGap, required this.horizontalTitleGap,
required this.minVerticalPadding, required this.minVerticalPadding,
required this.minLeadingWidth, required this.minLeadingWidth,
this.minTileHeight,
this.subtitleBaselineType, this.subtitleBaselineType,
required this.titleAlignment, required this.titleAlignment,
}); });
...@@ -995,6 +1008,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende ...@@ -995,6 +1008,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende
final double horizontalTitleGap; final double horizontalTitleGap;
final double minVerticalPadding; final double minVerticalPadding;
final double minLeadingWidth; final double minLeadingWidth;
final double? minTileHeight;
final ListTileTitleAlignment titleAlignment; final ListTileTitleAlignment titleAlignment;
@override @override
...@@ -1022,6 +1036,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende ...@@ -1022,6 +1036,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende
horizontalTitleGap: horizontalTitleGap, horizontalTitleGap: horizontalTitleGap,
minVerticalPadding: minVerticalPadding, minVerticalPadding: minVerticalPadding,
minLeadingWidth: minLeadingWidth, minLeadingWidth: minLeadingWidth,
minTileHeight: minTileHeight,
titleAlignment: titleAlignment, titleAlignment: titleAlignment,
); );
} }
...@@ -1037,6 +1052,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende ...@@ -1037,6 +1052,7 @@ class _ListTile extends SlottedMultiChildRenderObjectWidget<_ListTileSlot, Rende
..subtitleBaselineType = subtitleBaselineType ..subtitleBaselineType = subtitleBaselineType
..horizontalTitleGap = horizontalTitleGap ..horizontalTitleGap = horizontalTitleGap
..minLeadingWidth = minLeadingWidth ..minLeadingWidth = minLeadingWidth
..minTileHeight = minTileHeight
..minVerticalPadding = minVerticalPadding ..minVerticalPadding = minVerticalPadding
..titleAlignment = titleAlignment; ..titleAlignment = titleAlignment;
} }
...@@ -1053,7 +1069,8 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_ ...@@ -1053,7 +1069,8 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_
required double horizontalTitleGap, required double horizontalTitleGap,
required double minVerticalPadding, required double minVerticalPadding,
required double minLeadingWidth, required double minLeadingWidth,
required ListTileTitleAlignment titleAlignment, double? minTileHeight,
required ListTileTitleAlignment titleAlignment
}) : _isDense = isDense, }) : _isDense = isDense,
_visualDensity = visualDensity, _visualDensity = visualDensity,
_isThreeLine = isThreeLine, _isThreeLine = isThreeLine,
...@@ -1063,6 +1080,7 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_ ...@@ -1063,6 +1080,7 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_
_horizontalTitleGap = horizontalTitleGap, _horizontalTitleGap = horizontalTitleGap,
_minVerticalPadding = minVerticalPadding, _minVerticalPadding = minVerticalPadding,
_minLeadingWidth = minLeadingWidth, _minLeadingWidth = minLeadingWidth,
_minTileHeight = minTileHeight,
_titleAlignment = titleAlignment; _titleAlignment = titleAlignment;
RenderBox? get leading => childForSlot(_ListTileSlot.leading); RenderBox? get leading => childForSlot(_ListTileSlot.leading);
...@@ -1179,6 +1197,16 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_ ...@@ -1179,6 +1197,16 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_
markNeedsLayout(); markNeedsLayout();
} }
double? _minTileHeight;
double? get minTileHeight => _minTileHeight;
set minTileHeight(double? value) {
if (_minTileHeight == value) {
return;
}
_minTileHeight = value;
markNeedsLayout();
}
ListTileTitleAlignment get titleAlignment => _titleAlignment; ListTileTitleAlignment get titleAlignment => _titleAlignment;
ListTileTitleAlignment _titleAlignment; ListTileTitleAlignment _titleAlignment;
set titleAlignment(ListTileTitleAlignment value) { set titleAlignment(ListTileTitleAlignment value) {
...@@ -1238,7 +1266,7 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_ ...@@ -1238,7 +1266,7 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_
@override @override
double computeMinIntrinsicHeight(double width) { double computeMinIntrinsicHeight(double width) {
return math.max( return math.max(
_defaultTileHeight, minTileHeight ?? _defaultTileHeight,
title!.getMinIntrinsicHeight(width) + (subtitle?.getMinIntrinsicHeight(width) ?? 0.0), title!.getMinIntrinsicHeight(width) + (subtitle?.getMinIntrinsicHeight(width) ?? 0.0),
); );
} }
...@@ -1345,19 +1373,17 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_ ...@@ -1345,19 +1373,17 @@ class _RenderListTile extends RenderBox with SlottedContainerRenderObjectMixin<_
assert(isOneLine); assert(isOneLine);
} }
final double defaultTileHeight = _defaultTileHeight;
double tileHeight; double tileHeight;
double titleY; double titleY;
double? subtitleY; double? subtitleY;
if (!hasSubtitle) { if (!hasSubtitle) {
tileHeight = math.max(defaultTileHeight, titleSize.height + 2.0 * _minVerticalPadding); tileHeight = math.max(minTileHeight ?? _defaultTileHeight, titleSize.height + 2.0 * _minVerticalPadding);
titleY = (tileHeight - titleSize.height) / 2.0; titleY = (tileHeight - titleSize.height) / 2.0;
} else { } else {
assert(subtitleBaselineType != null); assert(subtitleBaselineType != null);
titleY = titleBaseline! - _boxBaseline(title!, titleBaselineType)!; titleY = titleBaseline! - _boxBaseline(title!, titleBaselineType)!;
subtitleY = subtitleBaseline! - _boxBaseline(subtitle!, subtitleBaselineType!)! + visualDensity.vertical * 2.0; subtitleY = subtitleBaseline! - _boxBaseline(subtitle!, subtitleBaselineType!)! + visualDensity.vertical * 2.0;
tileHeight = defaultTileHeight; tileHeight = minTileHeight ?? _defaultTileHeight;
// If the title and subtitle overlap, move the title upwards by half // If the title and subtitle overlap, move the title upwards by half
// the overlap and the subtitle down by the same amount, and adjust // the overlap and the subtitle down by the same amount, and adjust
......
...@@ -63,6 +63,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -63,6 +63,7 @@ class ListTileThemeData with Diagnosticable {
this.enableFeedback, this.enableFeedback,
this.mouseCursor, this.mouseCursor,
this.visualDensity, this.visualDensity,
this.minTileHeight,
this.titleAlignment, this.titleAlignment,
}); });
...@@ -111,6 +112,9 @@ class ListTileThemeData with Diagnosticable { ...@@ -111,6 +112,9 @@ class ListTileThemeData with Diagnosticable {
/// Overrides the default value of [ListTile.minLeadingWidth]. /// Overrides the default value of [ListTile.minLeadingWidth].
final double? minLeadingWidth; final double? minLeadingWidth;
/// Overrides the default value of [ListTile.minTileHeight].
final double? minTileHeight;
/// Overrides the default value of [ListTile.enableFeedback]. /// Overrides the default value of [ListTile.enableFeedback].
final bool? enableFeedback; final bool? enableFeedback;
...@@ -141,6 +145,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -141,6 +145,7 @@ class ListTileThemeData with Diagnosticable {
double? horizontalTitleGap, double? horizontalTitleGap,
double? minVerticalPadding, double? minVerticalPadding,
double? minLeadingWidth, double? minLeadingWidth,
double? minTileHeight,
bool? enableFeedback, bool? enableFeedback,
MaterialStateProperty<MouseCursor?>? mouseCursor, MaterialStateProperty<MouseCursor?>? mouseCursor,
bool? isThreeLine, bool? isThreeLine,
...@@ -163,6 +168,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -163,6 +168,7 @@ class ListTileThemeData with Diagnosticable {
horizontalTitleGap: horizontalTitleGap ?? this.horizontalTitleGap, horizontalTitleGap: horizontalTitleGap ?? this.horizontalTitleGap,
minVerticalPadding: minVerticalPadding ?? this.minVerticalPadding, minVerticalPadding: minVerticalPadding ?? this.minVerticalPadding,
minLeadingWidth: minLeadingWidth ?? this.minLeadingWidth, minLeadingWidth: minLeadingWidth ?? this.minLeadingWidth,
minTileHeight: minTileHeight ?? this.minTileHeight,
enableFeedback: enableFeedback ?? this.enableFeedback, enableFeedback: enableFeedback ?? this.enableFeedback,
mouseCursor: mouseCursor ?? this.mouseCursor, mouseCursor: mouseCursor ?? this.mouseCursor,
visualDensity: visualDensity ?? this.visualDensity, visualDensity: visualDensity ?? this.visualDensity,
...@@ -191,6 +197,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -191,6 +197,7 @@ class ListTileThemeData with Diagnosticable {
horizontalTitleGap: lerpDouble(a?.horizontalTitleGap, b?.horizontalTitleGap, t), horizontalTitleGap: lerpDouble(a?.horizontalTitleGap, b?.horizontalTitleGap, t),
minVerticalPadding: lerpDouble(a?.minVerticalPadding, b?.minVerticalPadding, t), minVerticalPadding: lerpDouble(a?.minVerticalPadding, b?.minVerticalPadding, t),
minLeadingWidth: lerpDouble(a?.minLeadingWidth, b?.minLeadingWidth, t), minLeadingWidth: lerpDouble(a?.minLeadingWidth, b?.minLeadingWidth, t),
minTileHeight: lerpDouble(a?.minTileHeight, b?.minTileHeight, t),
enableFeedback: t < 0.5 ? a?.enableFeedback : b?.enableFeedback, enableFeedback: t < 0.5 ? a?.enableFeedback : b?.enableFeedback,
mouseCursor: t < 0.5 ? a?.mouseCursor : b?.mouseCursor, mouseCursor: t < 0.5 ? a?.mouseCursor : b?.mouseCursor,
visualDensity: t < 0.5 ? a?.visualDensity : b?.visualDensity, visualDensity: t < 0.5 ? a?.visualDensity : b?.visualDensity,
...@@ -215,6 +222,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -215,6 +222,7 @@ class ListTileThemeData with Diagnosticable {
horizontalTitleGap, horizontalTitleGap,
minVerticalPadding, minVerticalPadding,
minLeadingWidth, minLeadingWidth,
minTileHeight,
enableFeedback, enableFeedback,
mouseCursor, mouseCursor,
visualDensity, visualDensity,
...@@ -245,6 +253,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -245,6 +253,7 @@ class ListTileThemeData with Diagnosticable {
&& other.horizontalTitleGap == horizontalTitleGap && other.horizontalTitleGap == horizontalTitleGap
&& other.minVerticalPadding == minVerticalPadding && other.minVerticalPadding == minVerticalPadding
&& other.minLeadingWidth == minLeadingWidth && other.minLeadingWidth == minLeadingWidth
&& other.minTileHeight == minTileHeight
&& other.enableFeedback == enableFeedback && other.enableFeedback == enableFeedback
&& other.mouseCursor == mouseCursor && other.mouseCursor == mouseCursor
&& other.visualDensity == visualDensity && other.visualDensity == visualDensity
...@@ -269,6 +278,7 @@ class ListTileThemeData with Diagnosticable { ...@@ -269,6 +278,7 @@ class ListTileThemeData with Diagnosticable {
properties.add(DoubleProperty('horizontalTitleGap', horizontalTitleGap, defaultValue: null)); properties.add(DoubleProperty('horizontalTitleGap', horizontalTitleGap, defaultValue: null));
properties.add(DoubleProperty('minVerticalPadding', minVerticalPadding, defaultValue: null)); properties.add(DoubleProperty('minVerticalPadding', minVerticalPadding, defaultValue: null));
properties.add(DoubleProperty('minLeadingWidth', minLeadingWidth, defaultValue: null)); properties.add(DoubleProperty('minLeadingWidth', minLeadingWidth, defaultValue: null));
properties.add(DoubleProperty('minTileHeight', minTileHeight, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('enableFeedback', enableFeedback, defaultValue: null)); properties.add(DiagnosticsProperty<bool>('enableFeedback', enableFeedback, defaultValue: null));
properties.add(DiagnosticsProperty<MaterialStateProperty<MouseCursor?>>('mouseCursor', mouseCursor, defaultValue: null)); properties.add(DiagnosticsProperty<MaterialStateProperty<MouseCursor?>>('mouseCursor', mouseCursor, defaultValue: null));
properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: null)); properties.add(DiagnosticsProperty<VisualDensity>('visualDensity', visualDensity, defaultValue: null));
...@@ -488,6 +498,7 @@ class ListTileTheme extends InheritedTheme { ...@@ -488,6 +498,7 @@ class ListTileTheme extends InheritedTheme {
double? horizontalTitleGap, double? horizontalTitleGap,
double? minVerticalPadding, double? minVerticalPadding,
double? minLeadingWidth, double? minLeadingWidth,
double? minTileHeight,
ListTileTitleAlignment? titleAlignment, ListTileTitleAlignment? titleAlignment,
MaterialStateProperty<MouseCursor?>? mouseCursor, MaterialStateProperty<MouseCursor?>? mouseCursor,
VisualDensity? visualDensity, VisualDensity? visualDensity,
...@@ -515,6 +526,7 @@ class ListTileTheme extends InheritedTheme { ...@@ -515,6 +526,7 @@ class ListTileTheme extends InheritedTheme {
horizontalTitleGap: horizontalTitleGap ?? parent.horizontalTitleGap, horizontalTitleGap: horizontalTitleGap ?? parent.horizontalTitleGap,
minVerticalPadding: minVerticalPadding ?? parent.minVerticalPadding, minVerticalPadding: minVerticalPadding ?? parent.minVerticalPadding,
minLeadingWidth: minLeadingWidth ?? parent.minLeadingWidth, minLeadingWidth: minLeadingWidth ?? parent.minLeadingWidth,
minTileHeight: minTileHeight ?? parent.minTileHeight,
titleAlignment: titleAlignment ?? parent.titleAlignment, titleAlignment: titleAlignment ?? parent.titleAlignment,
mouseCursor: mouseCursor ?? parent.mouseCursor, mouseCursor: mouseCursor ?? parent.mouseCursor,
visualDensity: visualDensity ?? parent.visualDensity, visualDensity: visualDensity ?? parent.visualDensity,
......
...@@ -1802,6 +1802,36 @@ void main() { ...@@ -1802,6 +1802,36 @@ void main() {
expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 56.0)); expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 56.0));
expect(right('title'), 708.0); expect(right('title'), 708.0);
}); });
testWidgets('ListTile minTileHeight', (WidgetTester tester) async {
Widget buildFrame(TextDirection textDirection, { double? minTileHeight, }) {
return MediaQuery(
data: const MediaQueryData(),
child: Directionality(
textDirection: textDirection,
child: Material(
child: Container(
alignment: Alignment.topLeft,
child: ListTile(
minTileHeight: minTileHeight,
),
),
),
),
);
}
// Default list tile with height = 56.0
await tester.pumpWidget(buildFrame(TextDirection.ltr));
expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 56.0));
// Set list tile height = 30.0
await tester.pumpWidget(buildFrame(TextDirection.ltr, minTileHeight: 30));
expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 30.0));
// Set list tile height = 60.0
await tester.pumpWidget(buildFrame(TextDirection.ltr, minTileHeight: 60));
expect(tester.getSize(find.byType(ListTile)), const Size(800.0, 60.0));
});
testWidgets('colors are applied to leading and trailing text widgets', (WidgetTester tester) async { testWidgets('colors are applied to leading and trailing text widgets', (WidgetTester tester) async {
final Key leadingKey = UniqueKey(); final Key leadingKey = UniqueKey();
......
...@@ -72,6 +72,7 @@ void main() { ...@@ -72,6 +72,7 @@ void main() {
expect(themeData.horizontalTitleGap, null); expect(themeData.horizontalTitleGap, null);
expect(themeData.minVerticalPadding, null); expect(themeData.minVerticalPadding, null);
expect(themeData.minLeadingWidth, null); expect(themeData.minLeadingWidth, null);
expect(themeData.minTileHeight, null);
expect(themeData.enableFeedback, null); expect(themeData.enableFeedback, null);
expect(themeData.mouseCursor, null); expect(themeData.mouseCursor, null);
expect(themeData.visualDensity, null); expect(themeData.visualDensity, null);
...@@ -108,6 +109,7 @@ void main() { ...@@ -108,6 +109,7 @@ void main() {
horizontalTitleGap: 200, horizontalTitleGap: 200,
minVerticalPadding: 300, minVerticalPadding: 300,
minLeadingWidth: 400, minLeadingWidth: 400,
minTileHeight: 30,
enableFeedback: true, enableFeedback: true,
mouseCursor: MaterialStateMouseCursor.clickable, mouseCursor: MaterialStateMouseCursor.clickable,
visualDensity: VisualDensity.comfortable, visualDensity: VisualDensity.comfortable,
...@@ -137,6 +139,7 @@ void main() { ...@@ -137,6 +139,7 @@ void main() {
'horizontalTitleGap: 200.0', 'horizontalTitleGap: 200.0',
'minVerticalPadding: 300.0', 'minVerticalPadding: 300.0',
'minLeadingWidth: 400.0', 'minLeadingWidth: 400.0',
'minTileHeight: 30.0',
'enableFeedback: true', 'enableFeedback: true',
'mouseCursor: WidgetStateMouseCursor(clickable)', 'mouseCursor: WidgetStateMouseCursor(clickable)',
'visualDensity: VisualDensity#00000(h: -1.0, v: -1.0)(horizontal: -1.0, vertical: -1.0)', 'visualDensity: VisualDensity#00000(h: -1.0, v: -1.0)(horizontal: -1.0, vertical: -1.0)',
...@@ -916,6 +919,7 @@ void main() { ...@@ -916,6 +919,7 @@ void main() {
horizontalTitleGap: 200, horizontalTitleGap: 200,
minVerticalPadding: 300, minVerticalPadding: 300,
minLeadingWidth: 400, minLeadingWidth: 400,
minTileHeight: 30,
enableFeedback: true, enableFeedback: true,
titleAlignment: ListTileTitleAlignment.bottom, titleAlignment: ListTileTitleAlignment.bottom,
); );
...@@ -936,6 +940,7 @@ void main() { ...@@ -936,6 +940,7 @@ void main() {
horizontalTitleGap: 600, horizontalTitleGap: 600,
minVerticalPadding: 700, minVerticalPadding: 700,
minLeadingWidth: 800, minLeadingWidth: 800,
minTileHeight: 80,
enableFeedback: false, enableFeedback: false,
titleAlignment: ListTileTitleAlignment.top, titleAlignment: ListTileTitleAlignment.top,
); );
...@@ -955,6 +960,7 @@ void main() { ...@@ -955,6 +960,7 @@ void main() {
expect(copy.horizontalTitleGap, 600); expect(copy.horizontalTitleGap, 600);
expect(copy.minVerticalPadding, 700); expect(copy.minVerticalPadding, 700);
expect(copy.minLeadingWidth, 800); expect(copy.minLeadingWidth, 800);
expect(copy.minTileHeight, 80);
expect(copy.enableFeedback, false); expect(copy.enableFeedback, false);
expect(copy.titleAlignment, ListTileTitleAlignment.top); expect(copy.titleAlignment, ListTileTitleAlignment.top);
}); });
...@@ -1015,6 +1021,7 @@ void main() { ...@@ -1015,6 +1021,7 @@ void main() {
horizontalTitleGap: 200, horizontalTitleGap: 200,
minVerticalPadding: 300, minVerticalPadding: 300,
minLeadingWidth: 400, minLeadingWidth: 400,
minTileHeight: 30,
enableFeedback: true, enableFeedback: true,
titleAlignment: ListTileTitleAlignment.bottom, titleAlignment: ListTileTitleAlignment.bottom,
mouseCursor: MaterialStateMouseCursor.textable, mouseCursor: MaterialStateMouseCursor.textable,
...@@ -1041,6 +1048,7 @@ void main() { ...@@ -1041,6 +1048,7 @@ void main() {
horizontalTitleGap: 600, horizontalTitleGap: 600,
minVerticalPadding: 700, minVerticalPadding: 700,
minLeadingWidth: 800, minLeadingWidth: 800,
minTileHeight: 80,
enableFeedback: false, enableFeedback: false,
titleAlignment: ListTileTitleAlignment.top, titleAlignment: ListTileTitleAlignment.top,
mouseCursor: MaterialStateMouseCursor.clickable, mouseCursor: MaterialStateMouseCursor.clickable,
...@@ -1071,6 +1079,7 @@ void main() { ...@@ -1071,6 +1079,7 @@ void main() {
expect(theme.horizontalTitleGap, 600); expect(theme.horizontalTitleGap, 600);
expect(theme.minVerticalPadding, 700); expect(theme.minVerticalPadding, 700);
expect(theme.minLeadingWidth, 800); expect(theme.minLeadingWidth, 800);
expect(theme.minTileHeight, 80);
expect(theme.enableFeedback, false); expect(theme.enableFeedback, false);
expect(theme.titleAlignment, ListTileTitleAlignment.top); expect(theme.titleAlignment, ListTileTitleAlignment.top);
expect(theme.mouseCursor, MaterialStateMouseCursor.clickable); expect(theme.mouseCursor, MaterialStateMouseCursor.clickable);
......
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