You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commands that have --offline as an option should recommend it when unable to connect. #15717
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.
Reacted by Tim Sneath, Tao Dong, Patrick Boos, Levi Lesches, pedia, Tim Whiting and Pablo Jiménez Pascual
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.
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
Reacted by Phil Quitslund, Thomas Burkhart and Tim Whiting
@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.
Activity
wmleler commentedon Mar 19, 2018
Or have those commands ask if the user wants to run
--offline.gspencergoog commentedon Mar 19, 2018
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
--yesoption 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.abmoudz commentedon Mar 20, 2018
@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
Hixie commentedon Mar 20, 2018
Yes please.
Ideally:
flutter foo-- do foo online if possible, offline if not, fail if offline and online is requiredflutter foo --offline-- do foo offline, fail if online is requiredflutter foo --no-offline-- do foo online, fail if offlinemit-mit commentedon Apr 13, 2018
cc @jcollins-g is this something you can help with?
jcollins-g commentedon Apr 13, 2018
@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.
mit-mit commentedon Apr 16, 2018
I believe @filiph mentioned this is required for I/O?
jcollins-g commentedon Apr 16, 2018
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.
filiph commentedon Apr 16, 2018
That was my mistake. I though each
flutter runrequires 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.
mit-mit commentedon Jan 12, 2022
Now that we have Dart FFI, perhaps we could wrap some OS APIs for getting the network state?