Skip to content

Map pub run to flutter package run command or similar #9301

Closed

Description

@dbacinski

https://flutter.io/setup-macos/

Currently in documentation there is an info to export PATH:

export PATH=$HOME/flutter/bin:$PATH

By doing that you do not export path to Dart SDK and you are not able to use pub run command which is used by some of the tools like Intl.

It would be nice to also export Dart SDK which is downloaded with Flutter:

export PATH=$HOME/flutter/bin:$PATH
export PATH=$HOME/flutter/bin/cache/dart-sdk/bin/:$PATH

Activity

  1. abarth commented on Apr 8, 2017

    @abarth
    Contributor

    It's intentional that we don'd add the Dart SDK to the path. We'll need to look at Intl to see what it needs.

  2. dbacinski commented on Apr 8, 2017

    @dbacinski
    ContributorAuthor

    ok, so we need flutter packages run or similar to run Dart scripts

  3. abarth commented on Apr 8, 2017

    @abarth
    Contributor

    Yes, that seems likely. The reason we wrap pub with the flutter tool is the flutter tool tells pub where to find the Flutter SDK on disk. I'm not sure what happens if you try to pub run something with an out-of-date .packages file. If it calls through to pub get, then it's important that we wrap it so that the get operation will know how to find the Flutter SDK.

  4. dbacinski commented on Apr 10, 2017

    @dbacinski
    ContributorAuthor

    Currently to use pub I have to export FLUTTER_ROOT env variable, but it only plays well with the Dart SDK provided by Flutter (flutter/bin/cache/dart-sdk/bin/). I would love to see flutter command to run Dart scripts:)

  5. changed the title [-]Documentation: Setup - missing path to Dart SDK[/-] [+]Map `pub run` to `flutter package run` command or similar[/+] on Apr 10, 2017
  6. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Apr 12, 2017
  7. added this to the milestone on Apr 12, 2017
  8. eseidelGoogle commented on Apr 12, 2017

    @eseidelGoogle
    Contributor

    It looks like the specific user journey being asked for here is the instructions on how to correctly use package:intl with your flutter project?

  9. dbacinski commented on Apr 12, 2017

    @dbacinski
    ContributorAuthor

    I was following Intl documentation here: https://pub.dartlang.org/packages/intl
    There is a paragraph Extracting And Using Translated Messages and there are 2 Dart script to be run: pub run intl_translation:extract_to_arb and pub run intl_translation:generate_from_arb.
    With current Flutter setup guide (https://flutter.io/setup-macos/) it is not possible to run them.
    That is why i have asked to export Dart SDK or proxy pub run method.

    Intl is used in Stocks example app, so I guess this is a recommended solution for i18n for now.

  10. dotdoom commented on Feb 24, 2018

    @dotdoom

    Looks like this is now available with flutter packages pub run. I've just used for the exact same purpose @dbacinski mentioned.

  11. 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.

  12. 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

    toolAffects 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