[Fix]: showDateRangePicker with "large" helpText cutoffs the save button (#146049)

Fix https://github.com/flutter/flutter/issues/146039

Pre-launch Checklist
This commit is contained in:
zhengzeqin
2024-04-30 02:18:06 +08:00
committed by GitHub
parent 7719f87055
commit aabe53ca36
2 changed files with 16 additions and 1 deletions

View File

@@ -1685,7 +1685,12 @@ class _CalendarRangePickerDialog extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(helpText, style: headlineHelpStyle),
Text(
helpText,
style: headlineHelpStyle,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 8),
Row(
children: <Widget>[

View File

@@ -268,6 +268,16 @@ void main() {
});
});
testWidgets('Long helpText does not cutoff the save button', (WidgetTester tester) async {
helpText = 'long helpText' * 100;
saveText = 'make it so';
await preparePicker(tester, (Future<DateTimeRange?> range) async {
expect(find.text(helpText!), findsOneWidget);
expect(find.text(saveText!), findsOneWidget);
expect(tester.takeException(), null);
});
});
testWidgets('Material3 has sentence case labels', (WidgetTester tester) async {
await preparePicker(tester, (Future<DateTimeRange?> range) async {
expect(find.text('Save'), findsOneWidget);