Skip to content

Commit a432b23

Browse files
authored
chore: remove global deprecated member use ignore rule (#681)
1 parent 5d40fc5 commit a432b23

8 files changed

Lines changed: 28 additions & 26 deletions

File tree

analysis_options.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ analyzer:
2828
errors:
2929
# allow self-reference to deprecated members
3030
deprecated_member_use_from_same_package: ignore
31-
# allow deprecated member use in test files and examples
32-
deprecated_member_use: ignore
3331
exclude:
3432
# Ignore generated files
3533
- "**/*.g.dart"

example/lib/pages/markers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ class _MarkersPageState extends ExamplePageState<MarkersPage> {
315315
borderRadius: BorderRadius.circular(8),
316316
boxShadow: <BoxShadow>[
317317
BoxShadow(
318-
color: Colors.black.withOpacity(0.2),
318+
color: Colors.black.withValues(alpha: 0.2),
319319
blurRadius: 6,
320320
offset: const Offset(0, 2),
321321
),

example/patrol_test/shared.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ Widget wrapMapView(GoogleMapsMapView mapView) {
137137

138138
Future<void> _acceptTermsAndConditionsDialog(PatrolIntegrationTester $) async {
139139
if (Platform.isAndroid) {
140-
await $.native.tap(Selector(text: 'Got It'));
140+
await $.platformAutomator.tap(Selector(text: 'Got It'));
141141
} else if (Platform.isIOS) {
142-
await $.native.tap(Selector(text: 'OK'));
142+
await $.platformAutomator.tap(Selector(text: 'OK'));
143143
} else {
144144
fail('Unsupported platform: ${Platform.operatingSystem}');
145145
}
@@ -183,11 +183,11 @@ Future<void> checkLocationDialogAcceptance(PatrolIntegrationTester $) async {
183183
.locationWhenInUse
184184
.request();
185185

186-
if (await $.native.isPermissionDialogVisible(
186+
if (await $.platformAutomator.mobile.isPermissionDialogVisible(
187187
timeout: const Duration(seconds: 5),
188188
)) {
189189
// Grant location permission.
190-
await $.native.grantPermissionWhenInUse();
190+
await $.platformAutomator.mobile.grantPermissionWhenInUse();
191191
}
192192

193193
// Check that the location permission is granted.

example/patrol_test/t02_session_test.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void main() {
3030
) async {
3131
if (!Platform.isIOS) {
3232
// Be sure location is enabled.
33-
await $.native.enableLocation();
33+
await $.platformAutomator.android.enableLocation();
3434
}
3535

3636
// Grant the location permission.
@@ -59,9 +59,9 @@ void main() {
5959

6060
// Tap ok.
6161
if (Platform.isAndroid) {
62-
await $.native.tap(Selector(text: "Got It"));
62+
await $.platformAutomator.tap(Selector(text: "Got It"));
6363
} else if (Platform.isIOS) {
64-
await $.native.tap(Selector(text: "OK"));
64+
await $.platformAutomator.tap(Selector(text: "OK"));
6565
} else {
6666
fail('Unsupported platform: ${Platform.operatingSystem}');
6767
}
@@ -112,9 +112,9 @@ void main() {
112112

113113
// Accept driver awareness disclaimer.
114114
if (Platform.isAndroid) {
115-
await $.native.tap(Selector(text: "Got It"));
115+
await $.platformAutomator.tap(Selector(text: "Got It"));
116116
} else if (Platform.isIOS) {
117-
await $.native.tap(Selector(text: "OK"));
117+
await $.platformAutomator.tap(Selector(text: "OK"));
118118
} else {
119119
fail('Unsupported platform: ${Platform.operatingSystem}');
120120
}
@@ -152,7 +152,7 @@ void main() {
152152
) async {
153153
if (!Platform.isIOS) {
154154
// Be sure location is enabled.
155-
await $.native.enableLocation();
155+
await $.platformAutomator.android.enableLocation();
156156
}
157157

158158
// Grant the location permission.
@@ -188,9 +188,9 @@ void main() {
188188

189189
// Tap ok.
190190
if (Platform.isAndroid) {
191-
await $.native.tap(Selector(text: "Got It"));
191+
await $.platformAutomator.tap(Selector(text: "Got It"));
192192
} else if (Platform.isIOS) {
193-
await $.native.tap(Selector(text: "OK"));
193+
await $.platformAutomator.tap(Selector(text: "OK"));
194194
} else {
195195
fail('Unsupported platform: ${Platform.operatingSystem}');
196196
}

example/patrol_test/t03_navigation_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ void main() {
805805

806806
try {
807807
/// Cut network connection.
808-
await $.native.enableAirplaneMode();
808+
await $.platformAutomator.mobile.enableAirplaneMode();
809809

810810
// Wait a while to ensure network is down.
811811
await $.tester.runAsync(
@@ -839,7 +839,7 @@ void main() {
839839
);
840840
} finally {
841841
/// Re-enable network connection.
842-
await $.native.disableAirplaneMode();
842+
await $.platformAutomator.mobile.disableAirplaneMode();
843843
}
844844
},
845845
// ATD emulator image used in Android CI does not have Settings app,

example/patrol_test/t06_map_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void main() {
214214
);
215215

216216
/// Test that the onMapClicked event comes in.
217-
await $.native.tapAt(const Offset(0.5, 0.5));
217+
await $.platformAutomator.mobile.tapAt(const Offset(0.5, 0.5));
218218

219219
/// Test the default values match with what has been documented in the
220220
/// API documentation in google_navigation_flutter.dart file.

example/patrol_test/t07_event_listener_test.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ void main() {
513513
await $.pumpAndSettle();
514514

515515
/// Set up GPS availability listeners with completers.
516+
// ignore: deprecated_member_use
516517
void onGpsAvailability(GpsAvailabilityUpdatedEvent event) {
517518
$.log('GpsAvailabilityEvent (deprecated): $event');
518519
if (!gpsAvailabilityEventReceived.isCompleted) {
@@ -530,8 +531,11 @@ void main() {
530531
}
531532

532533
/// Set up both the old (deprecated) and new gpsAvailability listeners.
534+
// ignore: deprecated_member_use
533535
final StreamSubscription<GpsAvailabilityUpdatedEvent>
534-
onGpsAvailabilitySubscription =
536+
// ignore: deprecated_member_use
537+
onGpsAvailabilitySubscription =
538+
// ignore: deprecated_member_use
535539
await GoogleMapsNavigator.setOnGpsAvailabilityListener(
536540
onGpsAvailability,
537541
);
@@ -589,7 +593,7 @@ void main() {
589593
await $.pumpAndSettle();
590594

591595
Future<void> cancelSubscriptionsAndResetState() async {
592-
await $.native.enableLocation();
596+
await $.platformAutomator.android.enableLocation();
593597
await onReroutingSubscription.cancel();
594598
await onGpsAvailabilitySubscription.cancel();
595599
await onGpsAvailabilityChangeSubscription.cancel();
@@ -604,7 +608,7 @@ void main() {
604608
},
605609
);
606610

607-
await $.native.disableLocation();
611+
await $.platformAutomator.android.disableLocation();
608612

609613
/// Wait for GPS availability events with timeout.
610614
await gpsAvailabilityEventReceived.future.timeout(

lib/src/types/terms_and_conditions_ui_params.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ class TermsAndConditionsUIParams {
7171
/// for internal use with the platform channels.
7272
TermsAndConditionsUIParamsDto toDto() {
7373
return TermsAndConditionsUIParamsDto(
74-
backgroundColor: backgroundColor?.value,
75-
titleColor: titleColor?.value,
76-
mainTextColor: mainTextColor?.value,
77-
acceptButtonTextColor: acceptButtonTextColor?.value,
78-
cancelButtonTextColor: cancelButtonTextColor?.value,
74+
backgroundColor: backgroundColor?.toARGB32(),
75+
titleColor: titleColor?.toARGB32(),
76+
mainTextColor: mainTextColor?.toARGB32(),
77+
acceptButtonTextColor: acceptButtonTextColor?.toARGB32(),
78+
cancelButtonTextColor: cancelButtonTextColor?.toARGB32(),
7979
);
8080
}
8181
}

0 commit comments

Comments
 (0)