Skip to content

Commit 1e8f48a

Browse files
rrousselGitSalakar
andauthored
refactor: Migrate firebase auth to nnbd (#4633)
Co-authored-by: Salakar <mike.diarmid@gmail.com>
1 parent 21c77d4 commit 1e8f48a

File tree

107 files changed

+3268
-2697
lines changed

Some content is hidden

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

107 files changed

+3268
-2697
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
flutter config --no-analytics
4-
flutter pub global activate melos
4+
flutter pub global activate melos 0.4.0-dev.2
55
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
66
echo "$GITHUB_WORKSPACE/_flutter/.pub-cache/bin" >> $GITHUB_PATH
77
echo "$GITHUB_WORKSPACE/_flutter/bin/cache/dart-sdk/bin" >> $GITHUB_PATH

melos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ scripts:
136136
test:web_e2e:
137137
run: |
138138
melos exec -c 1 --fail-fast -- \
139-
"flutter drive -d web --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart"
139+
"flutter drive --device-id=web-server --no-pub --target=./test_driver/MELOS_PARENT_PACKAGE_NAME_e2e.dart"
140140
description: |
141141
Run all Web test driver e2e tests in a specific example app.
142142
- Requires `flutter channel master` (or beta).

packages/cloud_firestore/cloud_firestore/example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependency_overrides:
2020
path: ../../../firebase_core/firebase_core_platform_interface
2121
cloud_firestore_platform_interface:
2222
path: ../../cloud_firestore_platform_interface
23+
http_parser: ^4.0.0-nullsafety
2324

2425
dev_dependencies:
2526
pedantic: ^1.8.0

packages/cloud_firestore/cloud_firestore/pubspec.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ dev_dependencies:
2727
test: any
2828
mockito: ^5.0.0-nullsafety.2
2929

30+
dependency_overrides:
31+
http_parser: ^4.0.0-nullsafety
32+
3033
flutter:
3134
plugin:
3235
platforms:

packages/cloud_firestore/cloud_firestore_web/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
sdk: flutter
1313
flutter_web_plugins:
1414
sdk: flutter
15-
http_parser: ^3.1.3
15+
http_parser: ^4.0.0-nullsafety
1616
meta: ^1.1.7
1717
firebase_core: ^0.7.0
1818
firebase_core_web: ^0.2.1+3
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# Copyright 2021 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# in the LICENSE file.
4+
5+
linter:
6+
rules:
7+
- always_declare_return_types
8+
- always_put_control_body_on_new_line
9+
- always_put_required_named_parameters_first
10+
- always_require_non_null_named_parameters
11+
- always_specify_types
12+
- always_use_package_imports
13+
- annotate_overrides
14+
- avoid_annotating_with_dynamic
15+
- avoid_as
16+
- avoid_bool_literals_in_conditional_expressions
17+
- avoid_catches_without_on_clauses
18+
- avoid_catching_errors
19+
- avoid_classes_with_only_static_members
20+
- avoid_double_and_int_checks
21+
- avoid_empty_else
22+
- avoid_equals_and_hash_code_on_mutable_classes
23+
- avoid_escaping_inner_quotes
24+
- avoid_field_initializers_in_const_classes
25+
- avoid_function_literals_in_foreach_calls
26+
- avoid_implementing_value_types
27+
- avoid_init_to_null
28+
- avoid_js_rounded_ints
29+
- avoid_null_checks_in_equality_operators
30+
- avoid_positional_boolean_parameters
31+
- avoid_print
32+
- avoid_private_typedef_functions
33+
- avoid_redundant_argument_values
34+
- avoid_relative_lib_imports
35+
- avoid_renaming_method_parameters
36+
- avoid_return_types_on_setters
37+
- avoid_returning_null
38+
- avoid_returning_null_for_future
39+
- avoid_returning_null_for_void
40+
- avoid_returning_this
41+
- avoid_setters_without_getters
42+
- avoid_shadowing_type_parameters
43+
- avoid_single_cascade_in_expression_statements
44+
- avoid_slow_async_io
45+
- avoid_type_to_string
46+
- avoid_types_as_parameter_names
47+
- avoid_types_on_closure_parameters
48+
- avoid_unnecessary_containers
49+
- avoid_unused_constructor_parameters
50+
- avoid_void_async
51+
- avoid_web_libraries_in_flutter
52+
- await_only_futures
53+
- camel_case_extensions
54+
- camel_case_types
55+
- cancel_subscriptions
56+
- cascade_invocations
57+
- cast_nullable_to_non_nullable
58+
- close_sinks
59+
- comment_references
60+
- constant_identifier_names
61+
- control_flow_in_finally
62+
- curly_braces_in_flow_control_structures
63+
- diagnostic_describe_all_properties
64+
- directives_ordering
65+
- do_not_use_environment
66+
- empty_catches
67+
- empty_constructor_bodies
68+
- empty_statements
69+
- exhaustive_cases
70+
- file_names
71+
- flutter_style_todos
72+
- hash_and_equals
73+
- implementation_imports
74+
- invariant_booleans
75+
- iterable_contains_unrelated_type
76+
- join_return_with_assignment
77+
- leading_newlines_in_multiline_strings
78+
- library_names
79+
- library_prefixes
80+
- lines_longer_than_80_chars
81+
- list_remove_unrelated_type
82+
- literal_only_boolean_expressions
83+
- missing_whitespace_between_adjacent_strings
84+
- no_adjacent_strings_in_list
85+
- no_default_cases
86+
- no_duplicate_case_values
87+
- no_logic_in_create_state
88+
- no_runtimeType_toString
89+
- non_constant_identifier_names
90+
- null_check_on_nullable_type_parameter
91+
- null_closures
92+
- omit_local_variable_types
93+
- one_member_abstracts
94+
- only_throw_errors
95+
- overridden_fields
96+
- package_api_docs
97+
- package_names
98+
- package_prefixed_library_names
99+
- parameter_assignments
100+
- prefer_adjacent_string_concatenation
101+
- prefer_asserts_in_initializer_lists
102+
- prefer_asserts_with_message
103+
- prefer_collection_literals
104+
- prefer_conditional_assignment
105+
- prefer_const_constructors
106+
- prefer_const_constructors_in_immutables
107+
- prefer_const_declarations
108+
- prefer_const_literals_to_create_immutables
109+
- prefer_constructors_over_static_methods
110+
- prefer_contains
111+
- prefer_double_quotes
112+
- prefer_equal_for_default_values
113+
- prefer_expression_function_bodies
114+
- prefer_final_fields
115+
- prefer_final_in_for_each
116+
- prefer_final_locals
117+
- prefer_for_elements_to_map_fromIterable
118+
- prefer_foreach
119+
- prefer_function_declarations_over_variables
120+
- prefer_generic_function_type_aliases
121+
- prefer_if_elements_to_conditional_expressions
122+
- prefer_if_null_operators
123+
- prefer_initializing_formals
124+
- prefer_inlined_adds
125+
- prefer_int_literals
126+
- prefer_interpolation_to_compose_strings
127+
- prefer_is_empty
128+
- prefer_is_not_empty
129+
- prefer_is_not_operator
130+
- prefer_iterable_whereType
131+
- prefer_mixin
132+
- prefer_null_aware_operators
133+
- prefer_relative_imports
134+
- prefer_single_quotes
135+
- prefer_spread_collections
136+
- prefer_typing_uninitialized_variables
137+
- prefer_void_to_null
138+
- provide_deprecation_message
139+
- public_member_api_docs
140+
- recursive_getters
141+
- sized_box_for_whitespace
142+
- slash_for_doc_comments
143+
- sort_child_properties_last
144+
- sort_constructors_first
145+
- sort_pub_dependencies
146+
- sort_unnamed_constructors_first
147+
- test_types_in_equals
148+
- throw_in_finally
149+
- tighten_type_of_initializing_formals
150+
- type_annotate_public_apis
151+
- type_init_formals
152+
- unawaited_futures
153+
- unnecessary_await_in_return
154+
- unnecessary_brace_in_string_interps
155+
- unnecessary_const
156+
- unnecessary_final
157+
- unnecessary_getters_setters
158+
- unnecessary_lambdas
159+
- unnecessary_new
160+
- unnecessary_null_aware_assignments
161+
- unnecessary_null_checks
162+
- unnecessary_null_in_if_null_operators
163+
- unnecessary_nullable_for_final_variable_declarations
164+
- unnecessary_overrides
165+
- unnecessary_parenthesis
166+
- unnecessary_raw_strings
167+
- unnecessary_statements
168+
- unnecessary_string_escapes
169+
- unnecessary_string_interpolations
170+
- unnecessary_this
171+
- unrelated_type_equality_checks
172+
- unsafe_html
173+
- use_full_hex_values_for_flutter_colors
174+
- use_function_type_syntax_for_parameters
175+
- use_is_even_rather_than_modulo
176+
- use_key_in_widget_constructors
177+
- use_late_for_private_fields_and_variables
178+
- use_raw_strings
179+
- use_rethrow_when_possible
180+
- use_setters_to_change_properties
181+
- use_string_buffers
182+
- use_to_and_as_if_applicable
183+
- valid_regexps
184+
- void_checks
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Copyright 2021 The Chromium Authors. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# in the LICENSE file.
4+
5+
include: all_lint_rules.yaml
6+
analyzer:
7+
# TODO(rrousselGit): disable implicit-cast/implicit-dynamic
8+
errors:
9+
import_of_legacy_library_into_null_safe: ignore
10+
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
11+
# We explicitly enabled even conflicting rules and are fixing the conflict
12+
# in this file
13+
included_file_warning: ignore
14+
15+
linter:
16+
rules:
17+
## Disabled rules because the repository doesn't respect them (yet)
18+
19+
directives_ordering: false
20+
prefer_final_fields: false
21+
comment_references: false
22+
sort_constructors_first: false
23+
sort_unnamed_constructors_first: false
24+
always_put_control_body_on_new_line: false
25+
omit_local_variable_types: false
26+
prefer_constructors_over_static_methods: false
27+
prefer_final_locals: false
28+
only_throw_errors: false
29+
prefer_relative_imports: false
30+
non_constant_identifier_names: false
31+
avoid_returning_this: false
32+
avoid_catching_errors: false
33+
constant_identifier_names: false
34+
prefer_function_declarations_over_variables: false
35+
avoid_classes_with_only_static_members: false
36+
avoid_function_literals_in_foreach_calls: false
37+
use_key_in_widget_constructors: false
38+
prefer_mixin: false
39+
40+
#############
41+
42+
# Personal preference. I don't find it more readable
43+
cascade_invocations: false
44+
45+
# Conflicts with `prefer_single_quotes`
46+
# Single quotes are easier to type and don't compromise on readability.
47+
prefer_double_quotes: false
48+
49+
# Conflicts with `omit_local_variable_types` and other rules.
50+
# As per Dart guidelines, we want to avoid unnecessary types to make the code
51+
# more readable.
52+
# See https://dart.dev/guides/language/effective-dart/design#avoid-type-annotating-initialized-local-variables
53+
always_specify_types: false
54+
55+
# Incompatible with `prefer_final_locals`
56+
# Having immutable local variables makes larger functions more predictible
57+
# so we will use `prefer_final_locals` instead.
58+
unnecessary_final: false
59+
60+
# Not quite suitable for Flutter, which may have a `build` method with a single
61+
# return, but that return is still complex enough that a "body" is worth it.
62+
prefer_expression_function_bodies: false
63+
64+
# Conflicts with the convention used by flutter, which puts `Key key`
65+
# and `@required Widget child` last.
66+
always_put_required_named_parameters_first: false
67+
68+
# `as` is not that bad (especially with the upcoming non-nullable types).
69+
# Explicit exceptions is better than implicit exceptions.
70+
avoid_as: false
71+
72+
# This project doesn't use Flutter-style todos
73+
flutter_style_todos: false
74+
75+
# There are situations where we voluntarily want to catch everything,
76+
# especially as a library.
77+
avoid_catches_without_on_clauses: false
78+
79+
# Boring as it sometimes force a line of 81 characters to be split in two.
80+
# As long as we try to respect that 80 characters limit, going slightly
81+
# above is fine.
82+
lines_longer_than_80_chars: false
83+
84+
# Conflicts with disabling `implicit-dynamic`
85+
avoid_annotating_with_dynamic: false
86+
87+
# conflicts with `prefer_relative_imports`
88+
always_use_package_imports: false
89+
90+
# Disabled for now until we have NNBD as it otherwise conflicts with `missing_return`
91+
no_default_cases: false
92+
93+
# False positive, null checks don't need a message
94+
prefer_asserts_with_message: false
95+
96+
# Cumbersome with `context.select`
97+
avoid_types_on_closure_parameters: false
98+
99+
# Too many false positive (builders)
100+
diagnostic_describe_all_properties: false
101+
102+
# false positives (setter-like functions)
103+
avoid_positional_boolean_parameters: false
104+
105+
# Does not apply to providers
106+
prefer_const_constructors_in_immutables: false
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include: ../../analysis_options.yaml
2+
3+
linter:
4+
rules:
5+
avoid_print: false
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
23
#include "Generated.xcconfig"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
23
#include "Generated.xcconfig"

0 commit comments

Comments
 (0)