flutter_command icon indicating copy to clipboard operation
flutter_command copied to clipboard

[Discussion] big breaking changes

Open escamoteur opened this issue 2 years ago • 8 comments

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.

  1. 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.

  1. 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

escamoteur avatar Apr 25 '23 09:04 escamoteur

Since we have .execute() and .canExecute, in my opinion, keeping .isExecuting is better. But I agree on .thrownExceptions -> errors part.

kamranbekirovyz avatar Apr 25 '23 10:04 kamranbekirovyz

@kamranbekirovyz any thoughts on the error handling?

escamoteur avatar Apr 25 '23 12:04 escamoteur

@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.

kamranbekirovyz avatar Apr 25 '23 13:04 kamranbekirovyz

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

escamoteur avatar Apr 25 '23 14:04 escamoteur

cc @albertodev01

escamoteur avatar Apr 25 '23 14:04 escamoteur

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 avatar Apr 27 '23 16:04 AdamMusa

@AdamMusa have you ever watched my talk https://youtu.be/lewl6h4kfa8

escamoteur avatar May 05 '23 09:05 escamoteur

Thank you @escamoteur . I didn't see this talk but i have just downloaded to see it .

AdamMusa avatar May 05 '23 09:05 AdamMusa