doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
27 stars 28 forks source link

Added an option to use either the standard Material Da… #43

Closed bastaware closed 4 months ago

bastaware commented 5 months ago

Added functionality to allow developers to choose between the standard Material DatePicker or a custom datepicker.

Without this, PlutoGrid will always use the build in date picker that does not handle localization.

Before:

before

After:

after

Example of usage:

                    child: PlutoGrid(
                        columns: controller.createTableColumns(),
                        rows: rows,
                        selectDateCallback: (PlutoCell cell, PlutoColumn column) async {
                          return showDatePicker(
                              context: context,
                              initialDate: PlutoDateTimeHelper.parseOrNullWithFormat(
                                    cell.value,
                                    column.type.date.format,
                                  ) ??
                                  DateTime.now(),
                              firstDate: startDate,
                              lastDate: DateTime.now());
                        }
                        ),
Macacoazul01 commented 5 months ago

@bastaware isOpenedPopup will be true even if you force it to false during the custom date picker creation. Is this the expected behavior? line 73 of lib/src/ui/cells/pluto_date_cell.dart