mike doornenbal 2023-10-06 11:52:03 +02:00
parent 7497cae081
commit 77a16b04ef
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 ## 3.3.1
- Fixed seperated bar theme from icon color - Fixed seperated bar theme from icon color

View file

@ -38,7 +38,7 @@ class DateTimePicker extends StatefulWidget {
final List<TimeOfDay>? disabledTimes; final List<TimeOfDay>? disabledTimes;
/// a [Size] that indicates the size of the overlay /// 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 /// [buttonBuilder] is a method for building the button that can trigger the overlay to appear
final Widget Function(Key key, void Function() onPressed)? buttonBuilder; final Widget Function(Key key, void Function() onPressed)? buttonBuilder;
@ -75,7 +75,7 @@ class DateTimePicker extends StatefulWidget {
this.markedDates, this.markedDates,
this.disabledDates, this.disabledDates,
this.disabledTimes, this.disabledTimes,
required this.size, this.size,
this.buttonBuilder, this.buttonBuilder,
this.closeOnSelectDate = false, this.closeOnSelectDate = false,
this.showWeekDays = true, this.showWeekDays = true,
@ -110,6 +110,7 @@ class _DateTimePickerState extends State<DateTimePicker> {
); );
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return Container( return Container(
decoration: (widget.theme.shapeDecoration == null) decoration: (widget.theme.shapeDecoration == null)
? BoxDecoration( ? BoxDecoration(
@ -139,14 +140,14 @@ class _DateTimePickerState extends State<DateTimePicker> {
: widget.theme.shapeDecoration!.shadows, : widget.theme.shapeDecoration!.shadows,
), ),
child: SizedBox( child: SizedBox(
width: widget.size.width, width: widget.size?.width ?? size.width,
height: widget.size.height, height: widget.size?.height ?? size.height,
child: Padding( child: Padding(
padding: widget.theme.calenderPadding, padding: widget.theme.calenderPadding,
child: OverlayDateTimeContent( child: OverlayDateTimeContent(
theme: widget.theme, theme: widget.theme,
weekdayTextStyle: widget.weekdayTextStyle, weekdayTextStyle: widget.weekdayTextStyle,
size: widget.size, size: widget.size ?? Size(size.width, size.height),
controller: _dateTimePickerController, controller: _dateTimePickerController,
showWeekDays: true, showWeekDays: true,
onNextDate: nextDate, onNextDate: nextDate,

View file

@ -1,6 +1,6 @@
name: flutter_date_time_picker name: flutter_date_time_picker
description: A Flutter package for date and time picker. description: A Flutter package for date and time picker.
version: 3.3.1 version: 3.3.2
environment: environment:
sdk: ">=3.0.0 <4.0.0" sdk: ">=3.0.0 <4.0.0"