Fix deprecation warning in ci failure (#3174)
diff --git a/packages/camera/CHANGELOG.md b/packages/camera/CHANGELOG.md
index 7e1ff85..bd075f4 100644
--- a/packages/camera/CHANGELOG.md
+++ b/packages/camera/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.5.8+10
+
+* Suppress the `deprecated_member_use` warning in the example app for `ScaffoldMessenger.showSnackBar`.
+
## 0.5.8+9
* Update android compileSdkVersion to 29.
diff --git a/packages/camera/example/lib/main.dart b/packages/camera/example/lib/main.dart
index ce8d374..3ec6604 100644
--- a/packages/camera/example/lib/main.dart
+++ b/packages/camera/example/lib/main.dart
@@ -272,6 +272,7 @@
String timestamp() => DateTime.now().millisecondsSinceEpoch.toString();
void showInSnackBar(String message) {
+ // ignore: deprecated_member_use
_scaffoldKey.currentState.showSnackBar(SnackBar(content: Text(message)));
}
diff --git a/packages/camera/pubspec.yaml b/packages/camera/pubspec.yaml
index 95a84d0..b581135 100644
--- a/packages/camera/pubspec.yaml
+++ b/packages/camera/pubspec.yaml
@@ -2,7 +2,7 @@
description: A Flutter plugin for getting information about and controlling the
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
and streaming image buffers to dart.
-version: 0.5.8+9
+version: 0.5.8+10
homepage: https://github.com/flutter/plugins/tree/master/packages/camera
diff --git a/packages/webview_flutter/CHANGELOG.md b/packages/webview_flutter/CHANGELOG.md
index 8cb361c..5823fa4 100644
--- a/packages/webview_flutter/CHANGELOG.md
+++ b/packages/webview_flutter/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.0.4
+
+* Suppress the `deprecated_member_use` warning in the example app for `ScaffoldMessenger.showSnackBar`.
+
## 1.0.3
* Update android compileSdkVersion to 29.
diff --git a/packages/webview_flutter/example/lib/main.dart b/packages/webview_flutter/example/lib/main.dart
index ff25e8a..7ec3008 100644
--- a/packages/webview_flutter/example/lib/main.dart
+++ b/packages/webview_flutter/example/lib/main.dart
@@ -92,6 +92,7 @@
return JavascriptChannel(
name: 'Toaster',
onMessageReceived: (JavascriptMessage message) {
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(
SnackBar(content: Text(message.message)),
);
@@ -107,6 +108,7 @@
return FloatingActionButton(
onPressed: () async {
final String url = await controller.data.currentUrl();
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(
SnackBar(content: Text('Favorited $url')),
);
@@ -215,6 +217,7 @@
WebViewController controller, BuildContext context) async {
final String cookies =
await controller.evaluateJavascript('document.cookie');
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(SnackBar(
content: Column(
mainAxisAlignment: MainAxisAlignment.end,
@@ -230,6 +233,7 @@
void _onAddToCache(WebViewController controller, BuildContext context) async {
await controller.evaluateJavascript(
'caches.open("test_caches_entry"); localStorage["test_localStorage"] = "dummy_entry";');
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(const SnackBar(
content: Text('Added a test entry to cache.'),
));
@@ -243,6 +247,7 @@
void _onClearCache(WebViewController controller, BuildContext context) async {
await controller.clearCache();
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(const SnackBar(
content: Text("Cache cleared."),
));
@@ -254,6 +259,7 @@
if (!hadCookies) {
message = 'There are no cookies.';
}
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(SnackBar(
content: Text(message),
));
@@ -306,6 +312,7 @@
if (await controller.canGoBack()) {
await controller.goBack();
} else {
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(
const SnackBar(content: Text("No back history item")),
);
@@ -321,6 +328,7 @@
if (await controller.canGoForward()) {
await controller.goForward();
} else {
+ // ignore: deprecated_member_use
Scaffold.of(context).showSnackBar(
const SnackBar(
content: Text("No forward history item")),
diff --git a/packages/webview_flutter/pubspec.yaml b/packages/webview_flutter/pubspec.yaml
index 14b1112..35b2932 100644
--- a/packages/webview_flutter/pubspec.yaml
+++ b/packages/webview_flutter/pubspec.yaml
@@ -1,6 +1,6 @@
name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
-version: 1.0.3
+version: 1.0.4
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter
environment: