Flutter is a framework which allows developers to create cross-platform apps using a single programming language.
Flutter uses the Dart programming language which was introduced by Google in 2011.
You can read more at official website.
You can install it with Android Studio and use it with this I.D.E.
I download it and unzip it to flutter folder.
1 2 3 4 5 6 | [mythcat@desk ~]$ cd flutter/ [mythcat@desk flutter]$ ls analysis_options.yaml CONTRIBUTING.md flutter_console.bat PATENTS AUTHORS dartdoc_options.yaml flutter_root.iml README.md bin dev LICENSE version CODE_OF_CONDUCT.md examples packages xkbmap |
Into flutter/bin folder you can find the flutter executable:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | [mythcat@desk flutter]$ flutter --help Manage your Flutter app development. Common commands: flutter create <output directory> Create a new Flutter project in the specified directory. flutter run [options] Run your Flutter application on an attached device or in an emulator. Usage: flutter <command> [arguments] Global options: -h, --help Print this usage information. -v, --verbose Noisy logging, including all shell commands executed. If used with --help, shows hidden options. -d, --device-id Target device id or name (prefixes allowed). --version Reports the version of this tool. --suppress-analytics Suppress analytics reporting when this command runs. --bug-report Captures a bug report file to submit to the Flutter team. Contains local paths, device identifiers, and log snippets. --packages Path to your ".packages" file. (required, since the current directory does not contain a ".packages" file) Available commands: analyze Analyze the project's Dart code. attach Attach to a running application. bash-completion Output command line shell completion setup scripts. build Flutter build commands. channel List or switch flutter channels. clean Delete the build/ and .dart_tool/ directories. config Configure Flutter settings. create Create a new Flutter project. devices List all connected devices. doctor Show information about the installed tooling. drive Runs Flutter Driver tests for the current project. emulators List, launch and create emulators. format Format one or more dart files. help Display help information for flutter. install Install a Flutter app on an attached device. logs Show log output for running Flutter apps. make-host-app-editable Moves host apps from generated directories to non-generated directories so that they can be edited by developers. precache Populates the Flutter tool's cache of binary artifacts. pub Commands for managing Flutter packages. run Run your Flutter app on an attached device. screenshot Take a screenshot from a connected device. test Run Flutter unit tests for the current project. upgrade Upgrade your copy of Flutter. version List or switch flutter versions. Run "flutter help <command>" for more information about a command. Run "flutter help -v" for verbose help output, including less commonly used options. |
You cannot create an application on flutter SDK folder, see:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | [mythcat@desk flutter]$ flutter create myapp001 Cannot create a project within the Flutter SDK. Target directory '/home/mythcat/flutter/myapp001' is within the Flutter SDK at '/home/mythcat/flutter'. [mythcat@desk flutter]$ cd .. [mythcat@desk ~]$ flutter create myapp001 Creating project myapp001... ... Wrote 66 files. All done! [!] Flutter is partially installed; more components are available. (Channel stable, v1.7.8+hotfix.4, on Linux, locale en_US.UTF-8) [!] Android toolchain - develop for Android devices is partially installed; more components are available. (Android SDK version 29.0.2) [✓] Android Studio is fully installed. (version 3.5) [!] Connected device is not available. Run "flutter doctor" for information about installing additional components. In order to run your application, type: $ cd myapp001 $ flutter run Your application code is in myapp001/lib/main.dart. |
This will create a folder named myapp001:
1 2 3 | [mythcat@desk ~]$ cd myapp001/ [mythcat@desk myapp001]$ ls android ios lib myapp001.iml pubspec.lock pubspec.yaml README.md test |
Run the test from the command line using the flutter test command which will execute all tests from the test directory.
1 2 | [mythcat@desk myapp001]$ flutter test test/widget_test.dart 01:11 +1: All tests passed! |
If you want to use emulators then install Android Studio and setup all SDK and AVD devices.
1 2 3 4 5 6 7 8 9 10 11 | [mythcat@desk myapp001]$ flutter emulators 1 available emulator: 4_WVGA_Nexus_S_API_27 • 4in WVGA (Nexus S) • Generic • 4 WVGA (Nexus S) API 27 To run an emulator, run 'flutter emulators --launch <emulator id>'. To create a new emulator, run 'flutter emulators --create [--name xyz]'. You can find more information on managing emulators at the links below: https://developer.android.com/studio/run/managing-avds https://developer.android.com/studio/command-line/avdmanager |
Let’s run the emulator:
1 | [mythcat@desk myapp001]$ flutter emulators --launch 4_WVGA_Nexus_S_API_27 |