From e7e43306f3701c90f4137e23c5b4a704e7368ee4 Mon Sep 17 00:00:00 2001 From: DatDang Date: Mon, 11 Mar 2024 16:50:05 +0700 Subject: [PATCH 1/2] Fix bottom buttons overflow when button content is too long --- lib/multiple_view_date_range_picker.dart | 133 +++++++++++++++++------ 1 file changed, 99 insertions(+), 34 deletions(-) diff --git a/lib/multiple_view_date_range_picker.dart b/lib/multiple_view_date_range_picker.dart index 3497090..1c85d62 100644 --- a/lib/multiple_view_date_range_picker.dart +++ b/lib/multiple_view_date_range_picker.dart @@ -66,6 +66,11 @@ class MultipleViewDateRangePicker extends StatefulWidget { class _MultipleViewDateRangePickerState extends State { final String dateTimePattern = 'dd/MM/yyyy'; + static const _desktopDateRangePickerWidth = 650.0; + static const _tabletDateRangePickerBottomPadding = 16.0; + final _startAndEndDateInputTabletKey = GlobalKey(); + final _bottomViewTabletConfirmationButtonsKey = GlobalKey(); + bool _bottomViewTabletConfirmationButtonsOverflow = false; late DateRangePickerController _datePickerController; late TextEditingController _startDateInputController; @@ -88,6 +93,30 @@ class _MultipleViewDateRangePickerState extends State _desktopDateRangePickerWidth - _tabletDateRangePickerBottomPadding * 2) { + setState(() { + _bottomViewTabletConfirmationButtonsOverflow = true; + }); + } + }); } void _initDebounceTimeForDate() { @@ -112,7 +141,7 @@ class _MultipleViewDateRangePickerState extends State Date: Tue, 12 Mar 2024 14:42:19 +0700 Subject: [PATCH 2/2] Add padding to bottom buttons in mobile --- lib/multiple_view_date_range_picker.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/multiple_view_date_range_picker.dart b/lib/multiple_view_date_range_picker.dart index 1c85d62..76af817 100644 --- a/lib/multiple_view_date_range_picker.dart +++ b/lib/multiple_view_date_range_picker.dart @@ -414,6 +414,7 @@ class _MultipleViewDateRangePickerState extends State