-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkdependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
There are some memebers in the web-only "version" of dart:ui that are not found in the mobile version of dart:ui:
webOnlyInstantiateImageCodecFromUrlwebOnlySetPluginHandlerdebugEmulateFlutterTesterEnvironment
These cause the following static analysis errors:
error: The function 'webOnlyInstantiateImageCodecFromUrl' isn't defined - packages/flutter/lib/src/painting/_network_image_web.dart:64:15 - undefined_function
error: The function 'webOnlySetPluginHandler' isn't defined - packages/flutter_web_plugins/lib/src/plugin_registry.dart:29:8 - undefined_function
error: The name 'debugEmulateFlutterTesterEnvironment' is being referenced through the prefix 'ui', but it isn't defined in any of the libraries imported using that prefix - packages/flutter_web_plugins/test/plugin_event_channel_test.dart:16:6 - undefined_prefixed_name
error: The name 'debugEmulateFlutterTesterEnvironment' is being referenced through the prefix 'ui', but it isn't defined in any of the libraries imported using that prefix - packages/flutter_web_plugins/test/plugin_registry_test.dart:33:6 • undefined_prefixed_name
To satisfy CI, these errors are ignored inline, e.g.
| ui.debugEmulateFlutterTesterEnvironment = false; // ignore: undefined_prefixed_name |
The Dart Analyzer will stop allowing issues with severity error to be ignore (see dart-lang/sdk#27218).
To me it seems that, aside from static analysis, this is awkward code that exists in one version of a library but not another. I spoke to @yjbanov at length about this and we thought of a few solutions:
- Define these members in the mobile version of dart:ui, and declare them to
throw UnsupportedError, and don't document them. - Define these members in a new library, something like
dart:web_ui.
mkiisoft, renefloor, Zazo032, hisaichi5518 and doradsoftmkiisoft
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkdependency: dartDart team may need to help usDart team may need to help usframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team