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

Add Flutter lint #253

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Add Flutter lint #253

wants to merge 23 commits into from

Conversation

jasikpark
Copy link
Contributor

@jasikpark jasikpark commented Feb 13, 2025

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, and flutter_web_plugins, an internal tool of Flutter, was being imported, and is unused since we aren't a web tool.

@jasikpark jasikpark force-pushed the flutter-lint branch 3 times, most recently from 408c287 to 0f457d3 Compare February 13, 2025 20:20
@jasikpark jasikpark force-pushed the flutter-lint branch 2 times, most recently from e32b93e to 317c607 Compare February 13, 2025 20:54
Base automatically changed from flutter-fmt to main February 13, 2025 21:37
@jasikpark jasikpark marked this pull request as ready for review February 13, 2025 21:40
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();
Copy link
Contributor

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

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;
Copy link
Contributor

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>{};
Copy link
Contributor

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

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