Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Update role.dart #146

wants to merge 1 commit into from

Conversation

raman04-byte
Copy link

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

Well, I try to optimize the code.
@stnguyen90 stnguyen90 self-requested a review May 10, 2023 15:40
Copy link
Contributor

@stnguyen90 stnguyen90 left a 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='';
Copy link
Contributor

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]) {
Copy link
Contributor

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]) {
Copy link
Contributor

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.

@raman04-byte
Copy link
Author

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.

Thanks for the clarification 💕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants