From 609fce1ac4d877d74290728711a1e3629e29ed3c Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 20 Mar 2023 13:34:01 +0700 Subject: [PATCH] i2 - Add option `maxWidth` for input date field --- lib/multiple_view_date_range_picker.dart | 4 ++++ lib/widgets/text_field_builder.dart | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/multiple_view_date_range_picker.dart b/lib/multiple_view_date_range_picker.dart index 83ca752..3497090 100644 --- a/lib/multiple_view_date_range_picker.dart +++ b/lib/multiple_view_date_range_picker.dart @@ -35,6 +35,7 @@ class MultipleViewDateRangePicker extends StatefulWidget { final DateTime? endDate; final List? customDateRangeButtons; final double? radius; + final double? tabletInputFieldMaxWidth; final bool autoClose; const MultipleViewDateRangePicker({ @@ -55,6 +56,7 @@ class MultipleViewDateRangePicker extends StatefulWidget { this.endDateInputController, this.customDateRangeButtons, this.radius, + this.tabletInputFieldMaxWidth, this.autoClose = true }) : super(key: key); @@ -331,6 +333,7 @@ class _MultipleViewDateRangePickerState extends State? inputFormatters; @@ -31,6 +32,7 @@ class TextFieldBuilder extends StatelessWidget { this.focusNode, this.borderRadius = 12.0, this.hintText, + this.maxWidth, this.inputFormatters }) : super(key: key); @@ -79,7 +81,7 @@ class TextFieldBuilder extends StatelessWidget { fontSize: 16, fontWeight: FontWeight.normal), filled: true, - constraints: const BoxConstraints(maxWidth: 120), + constraints: BoxConstraints(maxWidth: maxWidth ?? 130), fillColor: ColorsUtils.colorDefault ), keyboardAppearance: Brightness.light,