month_picker_dialog icon indicating copy to clipboard operation
month_picker_dialog copied to clipboard

The year becomes zero

Open doomkin opened this issue 4 years ago • 1 comments

When switching from vertical to horizontal mode, the year becomes zero. Screenshot_2020-08-07-19-11-10-165_ru parusinf timesheets

doomkin avatar Aug 08 '20 15:08 doomkin

Same issue here

maboumra avatar Sep 10 '21 19:09 maboumra

I noticed this same issue on _2 version gonna try fix

Macacoazul01 avatar Feb 25 '23 11:02 Macacoazul01

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,
                ),
              ],
            ),
          ),
  ],
),

Macacoazul01 avatar Feb 25 '23 12:02 Macacoazul01

To be more specific, bacuse of the initial data parameter: initialData: const UpDownPageLimit(0, 0),

Macacoazul01 avatar Feb 25 '23 12:02 Macacoazul01

Will be fixed with #55

Macacoazul01 avatar Feb 28 '23 17:02 Macacoazul01

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.

Ayush412 avatar Nov 16 '23 13:11 Ayush412

Did you send a PR?

Macacoazul01 avatar Nov 16 '23 20:11 Macacoazul01