[Discussion] big breaking changes
Hi,
while using flutter_commands in a real-world project, a lot of new ideas and thoughts have appeared. I would like to use this place to discuss them before going forward to implement them.
- renaming properties
The current names of the properties are all based on the RxCommand of the RxUI libraries of the .Net world. Quite often they feel a bit cumbersome so I want to discuss if and which we should rename. My current proposal would be:
isExecuting -> isBusy or just busy
thrownExceptions -> errors
Not sure about canExecute and results if someone has a better idea, let us hear it.
- Improved Error Handling
Currently you only can decide if errors should be caught if there is no local handler. But when writing real world apps, it turns out that it is very comfortable to handle some errors globally (like no network) but others should be handled locally by a listener on
thrownExceptions
My Proposal would be that Commands get a global Errorfilter object that can be overruled if a Errorfilter is passed when creating a new command.
Please see: https://github.com/escamoteur/flutter_command/blob/next_generation/lib/error_handler.dart
@kekland
Since we have .execute() and .canExecute, in my opinion, keeping .isExecuting is better. But I agree on .thrownExceptions -> errors part.
@kamranbekirovyz any thoughts on the error handling?
@escamoteur To be honest, I haven't used that part of the package much, but, what you suggest seems better than what we have right now.
it's actually one of the real strengths of the package as it lets you focus on the happy path of your code and still handles errors elegantly, which I discovered during my current project too
cc @albertodev01
Hi, i totally agree with all naming convention but i have only one idea about architecture and file structuration so I wish flutter_command would have also a cli to allow us to create flutter project depends on your recommandation architecture for get_it and have some helper method such us to create pages with useful default boilerplate etc .
@AdamMusa have you ever watched my talk https://youtu.be/lewl6h4kfa8
Thank you @escamoteur . I didn't see this talk but i have just downloaded to see it .