Skip to content

Warn if certain APIs are being used in a way that produce different results on VM and Web builds #58320

@rydmike

Description

@rydmike

Linter rationale and background

Flutter makes cross platform development between VM and Web mainstream. Developers are thus more likely to run across APIs that while they work and are available on both platforms, might in some use-cases produce different results due to underlying implementation differences.

A linter rule that can detect usage of such APIs and use cases, and warn about the risk or issue, can help to avoid such errors and time consuming debugging.

Flutter code that was originally written to only consider VM builds, might later when built for Web as well, inadvertently use such APIs in such ways without the original use case being aware of the limitations in the Web platform. Such errors can be difficult to debug and find in the built Flutter web application.

Rule scope

The rule scope is general purpose for cross platform builds, but certainly driven by Flutter making it mainstream.

Example

An example of a case that occurred due to API's underlying implementation details differences in VM and Web was posted in this issue: #44876

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-linterIssues with the analyzer's support for the linter packagelinter-lint-proposaltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions