This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Commit 81bbcd4
authored
[google_maps_flutter] Clean up google_maps_flutter plugin (#3206)
1. A few minor formatting changes and additions of @nullable annotations
2. Removed pass-through of activityHashCode. In the legacy plugin use case, the value is always -1 (which has been inlined). In the new plugin use case, the value should never be used because it uses DefaultLifecycleCallbacks instead of ActivityLifecycleCallbacks.
3. Replaced custom lifecycle state ints with androidx.lifecycle.Lifecycle.State enum. Also simplify paused/stopped states, which don't need their own dedicated states. Paused == started and stopped == created.
4. Fixed a bug where the Lifecycle object was being leaked onDetachFromActivity by nulling out the field.
5. Moved GoogleMapListener to its own file. Declaring multiple top level classes in the same file is bad practice.1 parent 64d7334 commit 81bbcd4
9 files changed
Lines changed: 94 additions & 119 deletions
File tree
- packages/google_maps_flutter/google_maps_flutter
- android
- src/main/java/io/flutter/plugins/googlemaps
- example/android/app/src/test/java/io/flutter/plugins/googlemaps
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 43 | + | |
| 44 | + | |
53 | 45 | | |
54 | 46 | | |
55 | 47 | | |
| |||
Lines changed: 18 additions & 57 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 7 | | |
15 | 8 | | |
16 | 9 | | |
| |||
26 | 19 | | |
27 | 20 | | |
28 | 21 | | |
| 22 | + | |
29 | 23 | | |
30 | 24 | | |
31 | 25 | | |
| |||
53 | 47 | | |
54 | 48 | | |
55 | 49 | | |
56 | | - | |
57 | 50 | | |
58 | 51 | | |
59 | 52 | | |
| |||
68 | 61 | | |
69 | 62 | | |
70 | 63 | | |
71 | | - | |
72 | 64 | | |
73 | 65 | | |
74 | 66 | | |
| |||
83 | 75 | | |
84 | 76 | | |
85 | 77 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 78 | + | |
89 | 79 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
93 | 84 | | |
94 | 85 | | |
95 | 86 | | |
| |||
102 | 93 | | |
103 | 94 | | |
104 | 95 | | |
105 | | - | |
106 | 96 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
111 | 100 | | |
112 | 101 | | |
113 | 102 | | |
114 | | - | |
115 | 103 | | |
116 | 104 | | |
117 | 105 | | |
| |||
120 | 108 | | |
121 | 109 | | |
122 | 110 | | |
123 | | - | |
124 | 111 | | |
125 | 112 | | |
126 | 113 | | |
| |||
132 | 119 | | |
133 | 120 | | |
134 | 121 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 122 | + | |
| 123 | + | |
150 | 124 | | |
151 | 125 | | |
152 | 126 | | |
| |||
160 | 134 | | |
161 | 135 | | |
162 | 136 | | |
163 | | - | |
| 137 | + | |
| 138 | + | |
164 | 139 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 140 | | |
169 | 141 | | |
170 | 142 | | |
| |||
556 | 528 | | |
557 | 529 | | |
558 | 530 | | |
559 | | - | |
| 531 | + | |
560 | 532 | | |
561 | 533 | | |
562 | 534 | | |
563 | 535 | | |
564 | 536 | | |
565 | 537 | | |
566 | | - | |
| 538 | + | |
567 | 539 | | |
568 | 540 | | |
569 | 541 | | |
| |||
880 | 852 | | |
881 | 853 | | |
882 | 854 | | |
883 | | - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
884 | 858 | | |
885 | 859 | | |
886 | 860 | | |
| |||
916 | 890 | | |
917 | 891 | | |
918 | 892 | | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
Lines changed: 13 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | | - | |
| 23 | + | |
22 | 24 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 67 | + | |
76 | 68 | | |
77 | 69 | | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments