Skip to content

Suggest using package:os_detect #13146

@jonasfj

Description

@jonasfj

Page URL

https://docs.flutter.dev/platform-integration/web/faq

Page source

https://github.com/flutter/website/blob/main/src/content/platform-integration/web/faq.md

Describe the problem

FAQ: Does Platform.is work on the web?

Not currently.

Expected fix

Suggest people use:

https://pub.dev/packages/os_detect

Or maybe package:platform when dart-lang/core#936
has landed.

Both are maintained by the Dart team, and are better options than Platform.is... from dart:io.

CC: @lrhn

As far as I recall, os_detect should allow tree shaking. But again that's not really something the language promises.

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from.page-issueReported in a reader-filed concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions