diff --git a/CHANGELOG.md b/CHANGELOG.md index 55c07fc..4e9115d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.3.2 + +- Fixed size of Date_Time_Picker + ## 3.3.1 - Fixed seperated bar theme from icon color diff --git a/lib/src/widgets/date_time_picker/date_time_picker.dart b/lib/src/widgets/date_time_picker/date_time_picker.dart index 31a65cd..656df6c 100644 --- a/lib/src/widgets/date_time_picker/date_time_picker.dart +++ b/lib/src/widgets/date_time_picker/date_time_picker.dart @@ -38,7 +38,7 @@ class DateTimePicker extends StatefulWidget { final List? disabledTimes; /// a [Size] that indicates the size of the overlay - final Size size; + final Size? size; /// [buttonBuilder] is a method for building the button that can trigger the overlay to appear final Widget Function(Key key, void Function() onPressed)? buttonBuilder; @@ -75,7 +75,7 @@ class DateTimePicker extends StatefulWidget { this.markedDates, this.disabledDates, this.disabledTimes, - required this.size, + this.size, this.buttonBuilder, this.closeOnSelectDate = false, this.showWeekDays = true, @@ -110,6 +110,7 @@ class _DateTimePickerState extends State { ); @override Widget build(BuildContext context) { + var size = MediaQuery.of(context).size; return Container( decoration: (widget.theme.shapeDecoration == null) ? BoxDecoration( @@ -139,14 +140,14 @@ class _DateTimePickerState extends State { : widget.theme.shapeDecoration!.shadows, ), child: SizedBox( - width: widget.size.width, - height: widget.size.height, + width: widget.size?.width ?? size.width, + height: widget.size?.height ?? size.height, child: Padding( padding: widget.theme.calenderPadding, child: OverlayDateTimeContent( theme: widget.theme, weekdayTextStyle: widget.weekdayTextStyle, - size: widget.size, + size: widget.size ?? Size(size.width, size.height), controller: _dateTimePickerController, showWeekDays: true, onNextDate: nextDate, diff --git a/pubspec.yaml b/pubspec.yaml index 681e09e..4f2360a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_date_time_picker description: A Flutter package for date and time picker. -version: 3.3.1 +version: 3.3.2 environment: sdk: ">=3.0.0 <4.0.0"