Skip to content

Merge the web platform support with mainline Flutter. #34082

Closed

Description

@kf6gpe

To date, the Flutter web platform support has been in its own fork. While you can now build an application for the web using Flutter (see here, doing so causes the flutter tool to pull a bunch of cached artifacts that are forked, rather than directly derived from, the mainline.

This can have numerous unforeseen consequences --- impacts to network use and disk space, and because it's a fork, bugs you expect to be fixed in the mainline for a given channel may still not be fixed in the fork.

Flutter for web remains experimental at least until this is resolved, and in all likelihood longer.

Activity

  1. added
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-webWeb applications specifically
    on Jun 7, 2019
  2. kf6gpe commented on Jun 7, 2019

    @kf6gpe
    ContributorAuthor
  3. modified the milestones: June 2019, on Jun 10, 2019
  4. jonahwilliams commented on Jul 5, 2019

    @jonahwilliams
    Contributor

    @gedw99 yes, this would involving having a project import flutter and not flutter_web and using all of the existing flutter tooling.

  5. sgon00 commented on Aug 20, 2019

    @sgon00

    Hi, sorry to interrupt. I have two questions related to the new approach.

    (1) I am wondering wether flutter run -d chrome will call webdev in the background or not? If it calls webdev, should I install or update the webdev program manually? OR can I remove webdev completely?

    (2) What is the best practice to manage the project for both mobile and web support?
    I am thinking of two ways.
    One way is creating three projects, one for common, one for mobile and one for web. And both mobile and web projects import the common project.
    Another way is only using one project and use some switch/if tests to determine which platform it's on and then execute the corresponding code. (btw I am not sure how to test the platform for web at present though. It seems TargetPlatform does not have a web value)

    Thanks a lot.

  6. zTrix commented on Aug 23, 2019

    @zTrix

    @sgon00 regarding how to test the platform for web, I can provide something.

    Since http is a cross-platform library in dart, supporting both web environment and native app environment, we could dig into its source code to find out how this is done.

    https://github.com/dart-lang/http/blob/master/lib/src/client.dart#L14

    Looking at the source code, http lib defines a browser_client.dart for browser env, and io_client.dart for native app, and combine them by conditional import using dart.library.html variable. Using this technique, you could also detect web platform.

    Some more info about conditional import: https://medium.com/@dvargahali/dart-2-conditional-imports-update-16147a776aa8

  7. yjbanov commented on Oct 1, 2019

    @yjbanov
    Contributor

    This is done.

  8. github-actions commented on Aug 17, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.platform-webWeb applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions