macosdartcoderunner

How to add dart language to CodeRunner App in MacOS?


I want to add new language in coderunner app [MacOS]. which just works like DartPad. I installed flutter sdk. but I got this error message when I tried to compile the code after selecting the dart language which I added by Preferences/Languages/Add new language (+ symbol) :

/bin/sh: dart: command not found

Solution

    1. Open CodeRunner app.
    2. Go to CodeRunner/Preferences/Languages.
    3. Click on the + button at the end of the languages to add another language. CodeRunner Preferences
    4. Do the following steps to setup Dart as language mode in coderunner app :

    Dart language setup in coderunner 5. Install Dart using HomeBrew in Terminal :

    - brew tap dart-lang/dart
    - brew install dart
    

    If you get any error, try this before executing above commands :

    export ALL_PROXY=$http_proxy:port
    

    If you get any error like : Error: Your Command Line Tools are too outdated.

    then try this : Update them from Software Update in System Preferences or run:

    softwareupdate --all --install --force
    

    If that doesn't show you any updates, run:

    sudo rm -rf /Library/Developer/CommandLineTools
      sudo xcode-select --install
    
    1. Now, let’s run sample dart code by selecting Dart as language and writing Hello World dart code : sample dart code run

    Dart setup successfully :)