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

[Help] Question Field validation #57

Open The-Mr-L opened 4 months ago

The-Mr-L commented 4 months ago

Hi :) first off thank you for keeping this package alive!

do you know if it is possible in the current state of the lib to somehow add field validations for the underlaying Textfields? or would I have to implement the feature myself?

doonfrs commented 4 months ago

HI @The-Mr-L Please check the change event like this one: https://github.com/bosskmk/pluto_grid/blob/3a2e74190d3d4bc85f82de2793f97d533aea7dbc/demo/lib/screen/feature/editing_state_screen.dart#L76 if it is just read-only, or you may be able to pass a result or cancel ... Generally, I think the easiest way to achieve that is by adding a cancel boolean field to the event and checking the value before committing the change, you don't need to care about the validation rules, the developer will be responsible for the validation and telling the grid to commit or cancel. I believe it would be very useful feature, thank you! 🙏🙏

The-Mr-L commented 4 months ago

Thanks for response, I will take a look and think a little more about it, it would just be really convenient if we had a way to add custom parameters to the underlaying inputfield builder, I might take on the challenge, if I end up needing it. then I will make a PR if that is the case. thanks again :).

doonfrs commented 4 months ago

Great, I will be happy to review it. Good luck !