Skip to content

Commit ab9706c

Browse files
committed
chore: repoint analyzer to local copy of Flutter lint
1 parent 7589c1b commit ab9706c

File tree

8 files changed

+486
-107
lines changed

8 files changed

+486
-107
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.pub/
66
pubspec.lock
77

8+
.build/
89
build/
910
.claude/
1011

@@ -38,4 +39,4 @@ docs/node_modules/
3839

3940
# Android build artifacts
4041
example/android/app/.cxx/
41-
*.cxx/
42+
*.cxx/

analysis_options.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
include: package:flutter_lints/flutter.yaml
1+
# Local copy of flutter_lints 3.0.2 to avoid package resolution issues in CI.
2+
include: tool/lints/flutter.yaml
23

34
linter:
45
rules:

example/lib/src/screens/purchase_flow_screen.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ class _PurchaseFlowScreenState extends State<PurchaseFlowScreen> {
148148

149149
if (Platform.isAndroid) {
150150
// For Android, check multiple conditions since fields can be null
151-
final bool condition1 =
152-
purchase.purchaseState == PurchaseState.Purchased;
151+
final bool condition1 = purchase.purchaseState == PurchaseState.Purchased;
153152
final bool condition2 = purchase.isAcknowledgedAndroid == false &&
154153
purchase.purchaseToken != null &&
155154
purchase.purchaseToken!.isNotEmpty &&

lib/flutter_inapp_purchase.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,14 @@ class RequestPurchaseAndroid {
286286

287287
class RequestSubscriptionAndroid extends RequestPurchaseAndroid {
288288
RequestSubscriptionAndroid({
289-
required List<String> skus,
289+
required super.skus,
290290
this.purchaseTokenAndroid,
291291
this.replacementModeAndroid,
292292
this.subscriptionOffers,
293-
String? obfuscatedAccountIdAndroid,
294-
String? obfuscatedProfileIdAndroid,
295-
bool? isOfferPersonalized,
296-
}) : super(
297-
skus: skus,
298-
obfuscatedAccountIdAndroid: obfuscatedAccountIdAndroid,
299-
obfuscatedProfileIdAndroid: obfuscatedProfileIdAndroid,
300-
isOfferPersonalized: isOfferPersonalized,
301-
);
293+
super.obfuscatedAccountIdAndroid,
294+
super.obfuscatedProfileIdAndroid,
295+
super.isOfferPersonalized,
296+
});
302297

303298
final String? purchaseTokenAndroid;
304299
final int? replacementModeAndroid;

lib/types.dart

Lines changed: 357 additions & 93 deletions
Large diffs are not rendered by default.

tool/lints/core.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copied from flutter_lints 3.0.2 (lib/core.yaml)
2+
# See https://github.com/dart-lang/lints for updates.
3+
4+
linter:
5+
rules:
6+
- avoid_empty_else
7+
- avoid_relative_lib_imports
8+
- avoid_shadowing_type_parameters
9+
- avoid_types_as_parameter_names
10+
- await_only_futures
11+
- camel_case_extensions
12+
- camel_case_types
13+
- collection_methods_unrelated_type
14+
- curly_braces_in_flow_control_structures
15+
- dangling_library_doc_comments
16+
- depend_on_referenced_packages
17+
- empty_catches
18+
- file_names
19+
- hash_and_equals
20+
- implicit_call_tearoffs
21+
- no_duplicate_case_values
22+
- non_constant_identifier_names
23+
- null_check_on_nullable_type_parameter
24+
- package_prefixed_library_names
25+
- prefer_generic_function_type_aliases
26+
- prefer_is_empty
27+
- prefer_is_not_empty
28+
- prefer_iterable_whereType
29+
- prefer_typing_uninitialized_variables
30+
- provide_deprecation_message
31+
- secure_pubspec_urls
32+
- type_literal_in_constant_pattern
33+
- unnecessary_overrides
34+
- unrelated_type_equality_checks
35+
- use_string_in_part_of_directives
36+
- valid_regexps
37+
- void_checks

tool/lints/flutter.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copied from flutter_lints 3.0.2 (lib/flutter.yaml)
2+
# Depends on recommended.yaml in the same directory.
3+
4+
include: recommended.yaml
5+
6+
linter:
7+
rules:
8+
- avoid_print
9+
- avoid_unnecessary_containers
10+
- avoid_web_libraries_in_flutter
11+
- no_logic_in_create_state
12+
- prefer_const_constructors
13+
- prefer_const_constructors_in_immutables
14+
- prefer_const_declarations
15+
- prefer_const_literals_to_create_immutables
16+
- sized_box_for_whitespace
17+
- sort_child_properties_last
18+
- use_build_context_synchronously
19+
- use_full_hex_values_for_flutter_colors
20+
- use_key_in_widget_constructors

tool/lints/recommended.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copied from flutter_lints 3.0.2 (lib/recommended.yaml)
2+
# Depends on core.yaml in the same directory.
3+
4+
include: core.yaml
5+
6+
linter:
7+
rules:
8+
- annotate_overrides
9+
- avoid_function_literals_in_foreach_calls
10+
- avoid_init_to_null
11+
- avoid_null_checks_in_equality_operators
12+
- avoid_renaming_method_parameters
13+
- avoid_return_types_on_setters
14+
- avoid_returning_null_for_void
15+
- avoid_single_cascade_in_expression_statements
16+
- constant_identifier_names
17+
- control_flow_in_finally
18+
- empty_constructor_bodies
19+
- empty_statements
20+
- exhaustive_cases
21+
- implementation_imports
22+
- library_names
23+
- library_prefixes
24+
- library_private_types_in_public_api
25+
- no_leading_underscores_for_library_prefixes
26+
- no_leading_underscores_for_local_identifiers
27+
- null_closures
28+
- overridden_fields
29+
- package_names
30+
- prefer_adjacent_string_concatenation
31+
- prefer_collection_literals
32+
- prefer_conditional_assignment
33+
- prefer_contains
34+
- prefer_final_fields
35+
- prefer_for_elements_to_map_fromIterable
36+
- prefer_function_declarations_over_variables
37+
- prefer_if_null_operators
38+
- prefer_initializing_formals
39+
- prefer_inlined_adds
40+
- prefer_interpolation_to_compose_strings
41+
- prefer_is_not_operator
42+
- prefer_null_aware_operators
43+
- prefer_spread_collections
44+
- recursive_getters
45+
- slash_for_doc_comments
46+
- type_init_formals
47+
- unnecessary_brace_in_string_interps
48+
- unnecessary_const
49+
- unnecessary_constructor_name
50+
- unnecessary_getters_setters
51+
- unnecessary_late
52+
- unnecessary_new
53+
- unnecessary_null_aware_assignments
54+
- unnecessary_null_in_if_null_operators
55+
- unnecessary_nullable_for_final_variable_declarations
56+
- unnecessary_string_escapes
57+
- unnecessary_string_interpolations
58+
- unnecessary_this
59+
- unnecessary_to_list_in_spreads
60+
- use_function_type_syntax_for_parameters
61+
- use_rethrow_when_possible
62+
- use_super_parameters

0 commit comments

Comments
 (0)