Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ linter:
- unnecessary_this
- unrelated_type_equality_checks
- unsafe_html
# - use_build_context_synchronously # LOCAL CHANGE - Needs to be enabled and violations fixed.
- use_build_context_synchronously
# - use_colored_box # not yet tested
# - use_decorated_box # not yet tested
# - use_enums # not yet tested
Expand Down
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.0+4

* Updates example code for `use_build_context_synchronously` lint.

## 0.1.0+3

* Changes XTypeGroup initialization from final to const.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class _MyHomePageState extends State<MyHomePage> {
}
}

Future<void> _handleMultiImagePicked(BuildContext? context) async {
await _displayPickImageDialog(context!,
Future<void> _handleMultiImagePicked(BuildContext context) async {
await _displayPickImageDialog(context,
(double? maxWidth, double? maxHeight, int? quality) async {
try {
final List<PickedFile>? pickedFileList = await _picker.pickMultiImage(
Expand All @@ -91,8 +91,8 @@ class _MyHomePageState extends State<MyHomePage> {
}

Future<void> _handleSingleImagePicked(
BuildContext? context, ImageSource source) async {
await _displayPickImageDialog(context!,
BuildContext context, ImageSource source) async {
await _displayPickImageDialog(context,
(double? maxWidth, double? maxHeight, int? quality) async {
try {
final PickedFile? pickedFile = await _picker.pickImage(
Expand All @@ -113,10 +113,13 @@ class _MyHomePageState extends State<MyHomePage> {
}

Future<void> _onImageButtonPressed(ImageSource source,
{BuildContext? context, bool isMultiImage = false}) async {
{required BuildContext context, bool isMultiImage = false}) async {
if (_controller != null) {
await _controller!.setVolume(0.0);
}
if (!context.mounted) {
return;
}
if (_isVideo) {
final PickedFile? file = await _picker.pickVideo(
source: source, maxDuration: const Duration(seconds: 10));
Expand Down Expand Up @@ -269,7 +272,7 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.red,
onPressed: () {
_isVideo = true;
_onImageButtonPressed(ImageSource.gallery);
_onImageButtonPressed(ImageSource.gallery, context: context);
},
heroTag: 'video0',
tooltip: 'Pick Video from gallery',
Expand All @@ -282,7 +285,7 @@ class _MyHomePageState extends State<MyHomePage> {
backgroundColor: Colors.red,
onPressed: () {
_isVideo = true;
_onImageButtonPressed(ImageSource.camera);
_onImageButtonPressed(ImageSource.camera, context: context);
},
heroTag: 'video1',
tooltip: 'Take a Video',
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_windows/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker_windows
description: Windows platform implementation of image_picker
repository: https://github.com/flutter/plugins/tree/main/packages/image_picker/image_picker_windows
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 0.1.0+3
version: 0.1.0+4

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/in_app_purchase/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 3.0.8

* Updates example code for `use_build_context_synchronously` lint.
* Updates minimum Flutter version to 2.10.

## 3.0.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ class _MyAppState extends State<_MyApp> {
await androidAddition.launchPriceChangeConfirmationFlow(
sku: 'purchaseId',
);
if (!context.mounted) {
return;
}
if (priceChangeConfirmationResult.responseCode == BillingResponse.ok) {
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Price change accepted'),
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
repository: https://github.com/flutter/plugins/tree/main/packages/in_app_purchase/in_app_purchase
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 3.0.7
version: 3.0.8

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/webview_flutter/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 3.0.5

* Updates example code for `use_build_context_synchronously` lint.
* Updates code for `no_leading_underscores_for_local_identifiers` lint.
* Updates minimum Flutter version to 2.10.
* Fixes avoid_redundant_argument_values lint warnings and minor typos.
Expand Down
22 changes: 21 additions & 1 deletion packages/webview_flutter/webview_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ class _WebViewExampleState extends State<WebViewExample> {
if (controller.hasData) {
url = await controller.data!.currentUrl();
}
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
Expand Down Expand Up @@ -321,6 +324,9 @@ class SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
final String cookies =
await controller.runJavascriptReturningResult('document.cookie');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Column(
mainAxisAlignment: MainAxisAlignment.end,
Expand All @@ -337,6 +343,9 @@ class SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
await controller.runJavascript(
'caches.open("test_caches_entry"); localStorage["test_localStorage"] = "dummy_entry";');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Added a test entry to cache.'),
));
Expand All @@ -353,6 +362,9 @@ class SampleMenu extends StatelessWidget {
Future<void> _onClearCache(
WebViewController controller, BuildContext context) async {
await controller.clearCache();
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Cache cleared.'),
));
Expand All @@ -364,6 +376,9 @@ class SampleMenu extends StatelessWidget {
if (!hadCookies) {
message = 'There are no cookies.';
}
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(message),
));
Expand Down Expand Up @@ -470,6 +485,9 @@ class NavigationControls extends StatelessWidget {
if (await controller!.canGoBack()) {
await controller.goBack();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No back history item')),
);
Expand All @@ -485,11 +503,13 @@ class NavigationControls extends StatelessWidget {
if (await controller!.canGoForward()) {
await controller.goForward();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('No forward history item')),
);
return;
}
},
),
Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
repository: https://github.com/flutter/plugins/tree/main/packages/webview_flutter/webview_flutter
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 3.0.4
version: 3.0.5

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.10.5

* Updates example code for `use_build_context_synchronously` lint.

## 2.10.4

* Updates code for `no_leading_underscores_for_local_identifiers` lint.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ class _WebViewExampleState extends State<_WebViewExample> {
return FloatingActionButton(
onPressed: () async {
final String url = (await controller.data!.currentUrl())!;
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Favorited $url')),
);
Expand Down Expand Up @@ -317,6 +320,9 @@ class _SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
final String cookies =
await controller.runJavascriptReturningResult('document.cookie');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Column(
mainAxisAlignment: MainAxisAlignment.end,
Expand All @@ -333,6 +339,9 @@ class _SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
await controller.runJavascript(
'caches.open("test_caches_entry"); localStorage["test_localStorage"] = "dummy_entry";');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Added a test entry to cache.'),
));
Expand All @@ -349,6 +358,9 @@ class _SampleMenu extends StatelessWidget {
Future<void> _onClearCache(
WebViewController controller, BuildContext context) async {
await controller.clearCache();
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Cache cleared.'),
));
Expand All @@ -357,6 +369,9 @@ class _SampleMenu extends StatelessWidget {
Future<void> _onClearCookies(
WebViewController controller, BuildContext context) async {
final bool hadCookies = await WebViewCookieManager.instance.clearCookies();
if (!context.mounted) {
return;
}
String message = 'There were cookies. Now, they are gone!';
if (!hadCookies) {
message = 'There are no cookies.';
Expand Down Expand Up @@ -465,6 +480,9 @@ class _NavigationControls extends StatelessWidget {
if (await controller!.canGoBack()) {
await controller.goBack();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No back history item')),
);
Expand All @@ -480,6 +498,9 @@ class _NavigationControls extends StatelessWidget {
if (await controller!.canGoForward()) {
await controller.goForward();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('No forward history item')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_android
description: A Flutter plugin that provides a WebView widget on Android.
repository: https://github.com/flutter/plugins/tree/main/packages/webview_flutter/webview_flutter_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 2.10.4
version: 2.10.5

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.9.6

* Updates example code for `use_build_context_synchronously` lint.
* Updates code for `no_leading_underscores_for_local_identifiers` lint.

## 2.9.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ class _WebViewExampleState extends State<_WebViewExample> {
return FloatingActionButton(
onPressed: () async {
final String url = (await controller.data!.currentUrl())!;
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Favorited $url')),
);
Expand Down Expand Up @@ -302,6 +305,9 @@ class _SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
final String cookies =
await controller.runJavascriptReturningResult('document.cookie');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Column(
mainAxisAlignment: MainAxisAlignment.end,
Expand All @@ -318,6 +324,9 @@ class _SampleMenu extends StatelessWidget {
WebViewController controller, BuildContext context) async {
await controller.runJavascript(
'caches.open("test_caches_entry"); localStorage["test_localStorage"] = "dummy_entry";');
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Added a test entry to cache.'),
));
Expand All @@ -334,6 +343,9 @@ class _SampleMenu extends StatelessWidget {
Future<void> _onClearCache(
WebViewController controller, BuildContext context) async {
await controller.clearCache();
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
content: Text('Cache cleared.'),
));
Expand All @@ -342,6 +354,9 @@ class _SampleMenu extends StatelessWidget {
Future<void> _onClearCookies(
WebViewController controller, BuildContext context) async {
final bool hadCookies = await WebView.platform.clearCookies();
if (!context.mounted) {
return;
}
String message = 'There were cookies. Now, they are gone!';
if (!hadCookies) {
message = 'There are no cookies.';
Expand Down Expand Up @@ -451,10 +466,12 @@ class _NavigationControls extends StatelessWidget {
if (await controller!.canGoBack()) {
await controller.goBack();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No back history item')),
);
return;
}
},
),
Expand All @@ -466,11 +483,13 @@ class _NavigationControls extends StatelessWidget {
if (await controller!.canGoForward()) {
await controller.goForward();
} else {
if (!context.mounted) {
return;
}
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('No forward history item')),
);
return;
}
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview
description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control.
repository: https://github.com/flutter/plugins/tree/main/packages/webview_flutter/webview_flutter_wkwebview
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22
version: 2.9.5
version: 2.9.6

environment:
sdk: ">=2.17.0 <3.0.0"
Expand Down