-
Notifications
You must be signed in to change notification settings - Fork 41
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
Add Flutter lint #253
base: main
Are you sure you want to change the base?
Add Flutter lint #253
Conversation
408c287
to
0f457d3
Compare
852984c
to
0cba11a
Compare
e32b93e
to
317c607
Compare
0cba11a
to
d317e21
Compare
317c607
to
a2f61a8
Compare
a2f61a8
to
8a3f628
Compare
import 'package:mobile_nebula/services/theme.dart'; | ||
import 'package:mobile_nebula/services/utils.dart'; | ||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
|
||
Future<void> main() async { | ||
usePathUrlStrategy(); |
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.
According to git blame (https://github.com/DefinedNet/mobile_nebula/blame/bcfcadec8ef46f2ed628ab9334088e1f142f22a6/lib/main.dart#L18), this was added as part of the work to support DN enrollment. We need to be able to process a url deep-link when enrolling, so I do not think we can remove this package or this line.
@@ -11,51 +11,51 @@ class MaterialTheme { | |||
static ColorScheme lightScheme() { | |||
return const ColorScheme( | |||
brightness: Brightness.light, | |||
primary: Color(4284700303), |
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 wonder if we should ignore this file, since it was auto-generated and it will be easier to compare changes in the future if we don't muck around with it too much.
@@ -41,10 +41,10 @@ class Utils { | |||
|
|||
static String itemCountFormat(int items, {singleSuffix = "item", multiSuffix = "items"}) { | |||
if (items == 1) { | |||
return items.toString() + " " + singleSuffix; | |||
return "$items " + singleSuffix; |
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.
This is still using concatenation, and does it need to be ${items}
? (same below)
@@ -11,7 +11,7 @@ bool DEFAULT_TRACK_ERRORS = true; | |||
class Settings { | |||
final _storage = Storage(); | |||
final StreamController _change = StreamController.broadcast(); | |||
var _settings = Map<String, dynamic>(); | |||
var _settings = <String, dynamic>{}; |
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.
Not a huge fan of this rule, seems stylistic and more obtuse, but if that's the recommended way, I guess we can roll with it. Just seems like there's no good reason not to be explicit. /shrug
Add https://pub.dev/packages/flutter_lints and fix the complaining lints
See https://dart.dev/tools/analysis#lints for more
This surfaced two package imports that weren't tracked by pubspec.yaml:
path
was imported w/o being registered as a dep, andflutter_web_plugins
, an internal tool of Flutter, was being imported, and is unused since we aren't a web tool.