Skip to content

Commands that have --offline as an option should recommend it when unable to connect. #15717

Open

Description

@gspencergoog

flutter create and flutter packages get (and others?) have an --offline flag that allows them to work offline if the pub cache is sufficiently full. We should have those commands recommend using --offline if they fail to connect to the server.

Alternatively, we could just go ahead and try to run offline automatically (with a great big warning that we've done so) if we can't connect.

Activity

  1. wmleler commented on Mar 19, 2018

    @wmleler

    Or have those commands ask if the user wants to run --offline.

  2. gspencergoog commented on Mar 19, 2018

    @gspencergoog
    ContributorAuthor

    Well, but asking for user input in a command-line process is not ideal: if it runs inside of a script, then it waits forever, and you end up needing a --yes option or something. I'd rather it either do it automatically (and you can turn it off with --no-offline) or not doing it automatically and suggest using --offline.

  3. abmoudz commented on Mar 20, 2018

    @abmoudz

    @gspencergoog hi can you help me how to add the --offline i am new to this and i would like to work offline can you please help

  4. Hixie commented on Mar 20, 2018

    @Hixie
    Contributor

    Alternatively, we could just go ahead and try to run offline automatically (with a great big warning that we've done so) if we can't connect.

    Yes please.

    Ideally:
    flutter foo -- do foo online if possible, offline if not, fail if offline and online is required
    flutter foo --offline -- do foo offline, fail if online is required
    flutter foo --no-offline -- do foo online, fail if offline

  5. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Apr 13, 2018
  6. mit-mit commented on Apr 13, 2018

    @mit-mit
    Member

    cc @jcollins-g is this something you can help with?

  7. jcollins-g commented on Apr 13, 2018

    @jcollins-g
    Contributor

    @mit-mit This looks a little in-depth for me to jump in and fix quickly, currently focused on dartdoc issues. If you need it urgently though assign to me and I'll try and make the time.

  8. mit-mit commented on Apr 16, 2018

    @mit-mit
    Member

    I believe @filiph mentioned this is required for I/O?

  9. jcollins-g commented on Apr 16, 2018

    @jcollins-g
    Contributor

    It's too late to get this change in for I/O, way too risky. However I'll take a look at this interleaved with other work.

  10. self-assigned this
    on Apr 16, 2018
  11. filiph commented on Apr 16, 2018

    @filiph
    Contributor

    That was my mistake. I though each flutter run requires an internet connection, but it turns out only the first one does. We're good for I/O.

    For reference, this is about #9393 (comment), resolved offline.

  12. removed their assignment
    on Jun 15, 2018
  13. added this to the milestone on Jan 22, 2019
  14. modified the milestones: , on Feb 11, 2020
  15. added
    P3Issues that are less important to the Flutter project
    on May 29, 2020
  16. modified the milestone: on Jun 1, 2020
  17. removed this from the milestone on Jun 16, 2020
  18. removed this from the milestone on Jul 22, 2020
  19. removed this from the milestone on Aug 17, 2020
  20. mit-mit commented on Jan 12, 2022

    @mit-mit
    Member

    Now that we have Dart FFI, perhaps we could wrap some OS APIs for getting the network state?

  21. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jun 30, 2025
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

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions