month_picker_dialog
month_picker_dialog copied to clipboard
The year becomes zero
When switching from vertical to horizontal mode, the year becomes zero.
Same issue here
I noticed this same issue on _2 version gonna try fix
This error happens because of these lines on header.dart:
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
if (isMonthSelector) GestureDetector(
onTap: onSelectYear,
child: StreamBuilder<UpDownPageLimit>(
stream: upDownPageLimitPublishSubject,
initialData: const UpDownPageLimit(0, 0),
builder:
(_, AsyncSnapshot<UpDownPageLimit> snapshot) =>
Text(
DateFormat.y(locale).format(DateTime(snapshot.data!.upLimit)),
style: headline5,
),
),
) else StreamBuilder<UpDownPageLimit>(
stream: upDownPageLimitPublishSubject,
initialData: const UpDownPageLimit(0, 0),
builder: (_, AsyncSnapshot<UpDownPageLimit> snapshot) =>
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
DateFormat.y(locale).format(DateTime(snapshot.data!.upLimit)),
style: headline5,
),
Text(
'-',
style: headline5,
),
Text(
DateFormat.y(locale).format(DateTime(snapshot.data!.downLimit)),
style: headline5,
),
],
),
),
],
),
To be more specific, bacuse of the initial data parameter:
initialData: const UpDownPageLimit(0, 0),
Will be fixed with #55
Hey Team, thanks for all the efforts put into this package. I've manage to replicate the year 0 bug...
To replicate, the device keyboard has to be open before calling the showMonthPicker
dialog. As a workaround, I've added a short delay between closing the keyboard and calling the showMonthPicker
dialog.
Did you send a PR?