Unverified Commit 9e46c67e authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Fix code sample failing in smoke test (#144709)

This fixes the silent failure reported in https://github.com/flutter/flutter/issues/144353. I am experimenting in https://github.com/flutter/flutter/pull/144706 with whether the failure should have been non-silent.
parent f38c5ad4
......@@ -188,6 +188,9 @@ class _DynamicColorExampleState extends State<DynamicColorExample> {
Future<void> _updateImage(ImageProvider provider) async {
final ColorScheme newColorScheme = await ColorScheme.fromImageProvider(
provider: provider, brightness: isLight ? Brightness.light : Brightness.dark);
if (!mounted) {
return;
}
setState(() {
selectedImage = widget.images.indexOf(provider);
currentColorScheme = newColorScheme;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment