-
Notifications
You must be signed in to change notification settings - Fork 97
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
fix(lints): avoid_unnecessary_containers #151
Conversation
…o fix-lints-2 � Conflicts: � analysis_options.yaml � lib/ui/views/about/about_tos_view.dart
Pull Request Test Coverage Report for Build 1315008201
💛 - Coveralls |
@@ -33,9 +33,9 @@ linter: | |||
directives_ordering: false | |||
|
|||
# In case of production should be set to true | |||
avoid_print: false | |||
avoid_print: true |
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.
better remove these rules instead of making them true since they are true by default
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.
Okay, I will remove this rule from analysis_options.yaml file.
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.
Also here if I remove this rule from that file then after running flutter analyze, I am getting 7 warnings of avoid_prints.
So Can I use the debugPrint overthere instead of removing that rule or commenting in that specific file wherever we used print()?
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.
Yes
@@ -55,6 +55,7 @@ class AboutPrivacyPolicyView extends StatelessWidget { | |||
? Theme.of(context).textTheme.headline5 | |||
: Theme.of(context).textTheme.headline6; | |||
|
|||
// ignore: avoid_unnecessary_containers |
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 cannot remove the unnecessary container here and other places ?
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.
I tried to run the app, but I got some error that's why I ignored that warning.
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.
What should I do here now?
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.
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.
Okay, So can I remove that unnecessary containers from that UI?
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.
Yes
@@ -34,7 +34,7 @@ class DatabaseServiceImpl implements DatabaseService { | |||
try { | |||
await Hive.initFlutter(); | |||
} catch (e) { | |||
print('Hive Initialization Failed'); | |||
// print('Hive Initialization Failed'); |
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.
What are the options if we want to debug the log but exclude them from production as Dart rule says ?
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 can use "debugPrint()" instead of "print".
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.
Yes
The multiple commits that are being pushed doesn't matter since we can Squash and Merge them as a single commit. |
Yes, I will be creating a new PR of these changes in one commit right now. Is it okay? |
Yes It's fine. Even though multiple commits come, we can squash and merge. |
Okay |
Fixes #149
Fix lints for these rule: