Merge pull request #37 from Iconica-Development/bugfix/date_picker_size

https://github.com/Iconica-Development/flutter_date_time_picker/issues/30
This commit is contained in:
Gorter-dev 2023-10-06 11:54:34 +02:00 committed by GitHub
commit e38f4db301
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,7 @@
## 3.3.2
- Fixed size of Date_Time_Picker
## 3.3.1
- Fixed seperated bar theme from icon color

View file

@ -38,7 +38,7 @@ class DateTimePicker extends StatefulWidget {
final List<TimeOfDay>? 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<DateTimePicker> {
);
@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<DateTimePicker> {
: 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,

View file

@ -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"