Macacoazul01 / month_picker_dialog

Internationalized dialog for picking a single month from an infinite list of years.
https://pub.dev/packages/month_picker_dialog
MIT License
70 stars 97 forks source link

MonthUpDownPageProvider pageLimit.upLimit returns 0, when bring app to a foreground (IOS) #106

Closed BigMenya closed 1 month ago

BigMenya commented 1 month ago

From my perspective its in month_selector.dart (method initialize()) only gets call on initState), when just a build method gets called, bringing to foreground is leading to it. Up limit of MonthUpDownPageProvider doesn't update which lead to a zero.

Screenshot 2024-09-03 at 15 24 37

Macacoazul01 commented 1 month ago

Can you send any sample code that generates this error?

BigMenya commented 1 month ago

Unfortunately I don't. I have tried to create an example but it doesn't reproduces since build is not triggered. At least I know that is a part of a project environment. But anyway there is to many options why builder can be triggered.

it's triggered by builder function here when app goes to background final DateTime? dialogDate = await showDialog( context: context, barrierDismissible: dismissible, builder: (BuildContext context) { return MultiProvider( providers: [ ChangeNotifierProvider.value( value: YearUpDownPageProvider(), ), ChangeNotifierProvider.value( value: MonthUpDownPageProvider(), ), ], child: MonthPickerDialog(controller: controller), ); }, );

Macacoazul01 commented 1 month ago

Tested here with the new 5.1.3 and everything seems to be ok. Please reopen if not