From 32b9e8021d8de1df7dd3a0ad1033e94cc460bea2 Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Wed, 21 Jun 2023 14:54:31 +0200 Subject: [PATCH 1/2] Re-enable `platform_channels` CI --- tool/flutter_ci_script_beta.sh | 3 +-- tool/flutter_ci_script_master.sh | 3 +-- tool/flutter_ci_script_stable.sh | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index da43b3366a5..8fede7de2d9 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -55,8 +55,7 @@ declare -ar PROJECT_NAMES=( # "navigation_and_routing" "next_gen_ui_demo" "place_tracker" - # TODO: https://github.com/flutter/samples/issues/1765 - # "platform_channels" + "platform_channels" "platform_design" "platform_view_swift" "provider_counter" diff --git a/tool/flutter_ci_script_master.sh b/tool/flutter_ci_script_master.sh index afd6d5e9548..420a9e4b145 100755 --- a/tool/flutter_ci_script_master.sh +++ b/tool/flutter_ci_script_master.sh @@ -56,8 +56,7 @@ declare -ar PROJECT_NAMES=( # TODO: Dependency 'gap-3.0.0' fails to compile # "next_gen_ui_demo" "place_tracker" - # TODO: https://github.com/flutter/samples/issues/1765 - # "platform_channels" + "platform_channels" "platform_design" "platform_view_swift" "provider_counter" diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index 59b04e10bee..f3854fded1c 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -49,8 +49,7 @@ declare -ar PROJECT_NAMES=( "navigation_and_routing" "next_gen_ui_demo" "place_tracker" - # TODO: https://github.com/flutter/samples/issues/1765 - # "platform_channels" + "platform_channels" "platform_design" "platform_view_swift" "provider_counter" From b5004681c24d7570b6d650fe88660b0646e3610e Mon Sep 17 00:00:00 2001 From: Brett Morgan Date: Wed, 21 Jun 2023 17:10:42 +0200 Subject: [PATCH 2/2] Don't use `BuildContext`s across async gaps. --- platform_channels/lib/src/method_channel_demo.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform_channels/lib/src/method_channel_demo.dart b/platform_channels/lib/src/method_channel_demo.dart index 0758ca9efb4..f4810c61ecd 100644 --- a/platform_channels/lib/src/method_channel_demo.dart +++ b/platform_channels/lib/src/method_channel_demo.dart @@ -46,6 +46,7 @@ class _MethodChannelDemoState extends State { final value = await Counter.increment(counterValue: count); setState(() => count = value); } catch (error) { + if (!mounted) return; showErrorMessage( context, (error as PlatformException).message!, @@ -64,6 +65,7 @@ class _MethodChannelDemoState extends State { final value = await Counter.decrement(counterValue: count); setState(() => count = value); } catch (error) { + if (!mounted) return; showErrorMessage( context, (error as PlatformException).message!,