bosskmk / pluto_grid

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
635 stars 288 forks source link

Use standard datepicker #1064

Open bastaware opened 4 weeks ago

bastaware commented 4 weeks 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: image

After: image

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());
                        }
                        ),