Skip to content

Commit 567ef32

Browse files
committed
Converted project to use very_good_analysis linter
https://pub.dev/packages/very_good_analysis
1 parent ef44df9 commit 567ef32

File tree

151 files changed

+4004
-3450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+4004
-3450
lines changed

analysis_options.yaml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
1+
include:
2+
- package:very_good_analysis/analysis_options.yaml
73

8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
10-
include: package:flutter_lints/flutter.yaml
4+
analyzer:
5+
language:
6+
strict-raw-types: false
7+
errors:
8+
inference_failure_on_function_return_type: ignore
9+
inference_failure_on_untyped_parameter: ignore
10+
inference_failure_on_instance_creation: ignore
11+
inference_failure_on_function_invocation: ignore
12+
exclude:
13+
- "**/*.freezed.dart"
14+
- "**/*.g.dart"
15+
- "**/generated/**"
1116

1217
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
2418
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
prefer_relative_imports: true
28-
prefer_const_constructors : false # This is often considered as premature optimization
29-
30-
# Additional information about this file can be found at
31-
# https://dart.dev/guides/language/analysis-options
19+
public_member_api_docs: false
20+
lines_longer_than_80_chars: false
21+
avoid_returning_this: false
22+
avoid_equals_and_hash_code_on_mutable_classes: false
23+
discarded_futures: false
24+
unawaited_futures: false
25+
avoid_dynamic_calls: false
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import 'package:flutter/cupertino.dart';
22

33
class NavigationTabModel {
4-
final Widget icon;
5-
final String label;
6-
final Widget child;
7-
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
8-
94
NavigationTabModel({
105
required this.icon,
116
required this.label,
127
required this.child,
138
});
9+
final Widget icon;
10+
final String label;
11+
final Widget child;
12+
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
1413
}

lib/app/model/settings.dart

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import 'package:flutter/material.dart';
22

33
class Settings {
4+
Settings({
5+
this.themeMode = ThemeMode.light,
6+
this.showArchivedItems = false,
7+
this.currentUserId = '',
8+
this.autoJoinGroups = false,
9+
this.autoRejectGroups = false,
10+
this.minGroupMembers = 2,
11+
this.currentLanguage = 'en',
12+
this.closeWithoutConfirmation = false,
13+
this.authenticateProtectedActions = true,
14+
});
415
final ThemeMode themeMode;
516
final bool showArchivedItems;
617
final String currentUserId;
@@ -11,38 +22,29 @@ class Settings {
1122
final bool closeWithoutConfirmation;
1223
final bool authenticateProtectedActions;
1324

14-
Settings(
15-
{this.themeMode = ThemeMode.light,
16-
this.showArchivedItems = false,
17-
this.currentUserId = '',
18-
this.autoJoinGroups = false,
19-
this.autoRejectGroups = false,
20-
this.minGroupMembers = 2,
21-
this.currentLanguage = 'en',
22-
this.closeWithoutConfirmation = false,
23-
this.authenticateProtectedActions = true});
24-
25-
Settings copyWith(
26-
{ThemeMode? themeMode,
27-
bool? showArchivedItems,
28-
String? currentUserId,
29-
bool? autoJoinGroups,
30-
bool? autoRejectGroups,
31-
int? minGroupMembers,
32-
String? currentLanguage,
33-
bool? closeWithoutConfirmation,
34-
bool? authenticateProtectedActions}) {
25+
Settings copyWith({
26+
ThemeMode? themeMode,
27+
bool? showArchivedItems,
28+
String? currentUserId,
29+
bool? autoJoinGroups,
30+
bool? autoRejectGroups,
31+
int? minGroupMembers,
32+
String? currentLanguage,
33+
bool? closeWithoutConfirmation,
34+
bool? authenticateProtectedActions,
35+
}) {
3536
return Settings(
36-
themeMode: themeMode ?? this.themeMode,
37-
showArchivedItems: showArchivedItems ?? this.showArchivedItems,
38-
currentUserId: currentUserId ?? this.currentUserId,
39-
autoJoinGroups: autoJoinGroups ?? this.autoJoinGroups,
40-
autoRejectGroups: autoRejectGroups ?? this.autoRejectGroups,
41-
minGroupMembers: minGroupMembers ?? this.minGroupMembers,
42-
currentLanguage: currentLanguage ?? this.currentLanguage,
43-
closeWithoutConfirmation:
44-
closeWithoutConfirmation ?? this.closeWithoutConfirmation,
45-
authenticateProtectedActions:
46-
authenticateProtectedActions ?? this.authenticateProtectedActions);
37+
themeMode: themeMode ?? this.themeMode,
38+
showArchivedItems: showArchivedItems ?? this.showArchivedItems,
39+
currentUserId: currentUserId ?? this.currentUserId,
40+
autoJoinGroups: autoJoinGroups ?? this.autoJoinGroups,
41+
autoRejectGroups: autoRejectGroups ?? this.autoRejectGroups,
42+
minGroupMembers: minGroupMembers ?? this.minGroupMembers,
43+
currentLanguage: currentLanguage ?? this.currentLanguage,
44+
closeWithoutConfirmation:
45+
closeWithoutConfirmation ?? this.closeWithoutConfirmation,
46+
authenticateProtectedActions:
47+
authenticateProtectedActions ?? this.authenticateProtectedActions,
48+
);
4749
}
4850
}

lib/app/widget/offstage_navigator.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import 'package:flutter/material.dart';
22

3-
import '../model/navigation_tab_model.dart';
3+
import 'package:meesign_client/app/model/navigation_tab_model.dart';
44

55
class OffstageNavigator extends StatelessWidget {
6-
final int index;
7-
final int currentTabIndex;
8-
final NavigationTabModel navigationTab;
9-
106
const OffstageNavigator({
11-
super.key,
127
required this.index,
138
required this.currentTabIndex,
149
required this.navigationTab,
10+
super.key,
1511
});
12+
final int index;
13+
final int currentTabIndex;
14+
final NavigationTabModel navigationTab;
1615

1716
@override
1817
Widget build(BuildContext context) {
@@ -21,9 +20,11 @@ class OffstageNavigator extends StatelessWidget {
2120
child: Navigator(
2221
key: navigationTab.navigatorKey,
2322
onGenerateRoute: (routeSettings) {
24-
return MaterialPageRoute(builder: (context) {
25-
return navigationTab.child;
26-
});
23+
return MaterialPageRoute(
24+
builder: (context) {
25+
return navigationTab.child;
26+
},
27+
);
2728
},
2829
),
2930
);

0 commit comments

Comments
 (0)