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

Improve Flutter and Dart SDK using official lint rules #372

Merged
merged 16 commits into from
Feb 23, 2022

Conversation

lohanidamodar
Copy link
Member

No description provided.

Copy link
Contributor

@wess wess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of things to consider. This looks good and will work fine, I just wanted to drop notes on some ideas going forward.

@@ -38,9 +38,9 @@ class {{ service.name | caseUcfirst }} extends Service {
};

{% if method.type == 'location' %}
params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
for(var key in params.keys) {if (params[key] is int || params[key] is double) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a for loop when you could use filter/map/reduce? (Map is faster and resource efficient).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, as I think this was a leftover

@@ -40,15 +40,15 @@ class ClientMixin {
} else if (method == HttpMethod.get) {
final encoded = <String, dynamic>{};
if (params.isNotEmpty) {
params.keys.forEach((key) {
for(var key in params.keys) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a for loop when you could use a map? (Map is faster and resource efficient).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

params.keys.forEach((key) {if (params[key] is int || params[key] is double) {
params[key] = params[key].toString();
}});
for (var key in params.keys) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using a map/filter here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, as I think this was a leftover

message.channels.forEach((channel) {
if (this._channels[channel] != null) {
this._channels[channel]!.forEach((stream) {
for(var channel in message.channels) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since dealing with sinks, for loop looks good here.

Copy link
Contributor

@Meldiron Meldiron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christyjacob4 christyjacob4 changed the base branch from master to feat-preps-for-0.13 February 22, 2022 19:09
@lohanidamodar lohanidamodar merged commit de3ece1 into feat-preps-for-0.13 Feb 23, 2022
@lohanidamodar lohanidamodar deleted the feat-improve-dart-flutter-sdk branch February 23, 2022 10:32
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.

3 participants