-
Notifications
You must be signed in to change notification settings - Fork 111
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
Update role.dart #146
Update role.dart #146
Conversation
Well, I try to optimize the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this PR! Unfortunately, this is a read-only repo as the code is generated by our SDK Generator, and changes made only here would be wiped in the next release.
I've also left some feedback on the code you've added.
|
||
static String user(String id, [String status = '']) { | ||
static String any() => 'any'; | ||
String status=''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't really make sense to add this as a instance attribute since you never instantiate a Role object..
static String user(String id, [String status = '']) { | ||
static String any() => 'any'; | ||
String status=''; | ||
static String user(String id, status]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to do this because this makes status required.
if(status.isEmpty) { | ||
return 'user:$id'; | ||
} | ||
return 'user:$id/$status'; | ||
} | ||
|
||
static String users([String status = '']) { | ||
static String users(status]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, status shouldn't be required. In addition, there's an extra bracket here and missing type.
Thanks for the clarification 💕 |
Well, I try to optimize the code.
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)