-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nullability support #47
Comments
yep will come, I only have to have time :-) |
Morning everyone, is this coming anytime soon? This library is currently the only one that is left to update our production code. Thanks for your support! |
@mk-dev-1 , do you have migrated version? I've run into issues while trying to migrate. @escamoteur , hopefully you 'll have time to look into this. As been said, I'll take care of rx_widgets. |
@josh-ksr have you already done something on this side? |
@mk-dev-1 could you make a PR, so that we could have a look at it? |
@escamoteur: Please have a look at #49. I am struggling with an issue, but I am sure it can be resolved rather easily ;-) |
@escamoteur , would you have time to work on it any time soon? This seems too challenging to me to migrate myself, and this issue is blocking for full project migration to null-safety. |
Will try to do it over the weekend |
ok the weekend wasn't long enough. I'm thinking of making the API exactly (almost) the same as that of flutter_command. This would be a breaking change, though nothing that isn't quickly fixable. What are your thoughts? |
The whole null-safety is breaking change, so I think now it's the perfect time to introduce it. All logic will be re-tested anyway. |
just pushed first version 6.0.0-null-safety https://github.com/fluttercommunity/rx_command/tree/null-safety please have a close look and tell me what you think! |
Thank you so much for your work, much appreciated!! I can see that In any case, maybe there is a way to avoid making |
Totally right. This came because for flutter_command it's mandatory as every ValueNotifier needs to have an initial value What would be absolutely awesome if someone could update the readme to the changed API, namely:
That would be a great help |
Here's another observation / question: static RxCommand<TParam, void> createAsyncNoResult<TParam>(
AsyncAction1<TParam> action,
{Stream<bool>? restriction,
bool emitInitialCommandResult = false,
bool emitsLastValueToNewSubscriptions = false,
String? debugName}) { where typedef AsyncAction1<TParam> = Future Function(TParam? param); Should it not be this? typedef AsyncAction1<TParam> = Future Function(TParam param); After all, final Future<TResult> Function(TParam)? _func; ... same question for these two: typedef Action1<TParam> = void Function(TParam? param);
typedef AsyncFunc1<TParam, TResult> = Future<TResult> Function(TParam? param); Generally, we would not expect a null value to be returned from a command that is set up like Thanks for your feedback! Edit: Looking at the API of |
you are probably right |
could you make a PR and try if it works? I'm kind a busy at the moment |
Hi, |
Everything's looking good as far as I can see. What we are left with is this "issue" here: Hi all, I have put together an initial PR for migrating the package to null-safety. However, I can't seem to find a way to migrate the package in a way that this late RxCommand<bool, bool> myCommand;
[...]
RxCommand.createSync<bool, bool>(_myFunc)
[...]
bool void _myFunc(bool param) {
return bool;
}
[...]
myCommand();
myCommand.execute(); You would expect myCommand() to give you an error, because /// Calls the wrapped handler function with an option input parameter
void execute([TParam? param]);
/// This makes RxCommand a callable class, so instead of `myCommand.execute()` you can write `myCommand()`
void call([TParam? param]) => execute(param); I've played around with this, but it seems there is no way to make I am okay to live with this. Any thoughts? |
Actually I would call this not a problem but a feature. It took me quite some work to get it work like this so that you don't have to pass null explicitly. |
Thanks a lot for all your help. Migrating a complex package like rx_command isn't easy without people testing and giving feedback!!! |
Thanks for the feedback. If it is a design decision that is okay, of course. I just thought I'd ask about it ;-) |
I think we leave the package another week in prerelease mode to see if we get any complaints |
I've successfully tested the null-safety release in our app's beta program without experiencing any issues. I'd suggest to go ahead with releasing... |
If we don't get any comments till monday I push a new release version |
@escamoteur , guess we don't have any comments besides updating docs PR. Please push new version. I'll use it for RxWidgets as well. |
Just pushed V6.0.0 |
Hey, do you have in plans nullability support for the library? I can take care about nullability support for Rx_widgets.
The text was updated successfully, but these errors were encountered: