Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/salkuadrat/f
A simple shortcut, command line interface (CLI) for Flutter to increase productivity and happiness.
https://github.com/salkuadrat/f
cli dart flutter
Last synced: 2 months ago
JSON representation
A simple shortcut, command line interface (CLI) for Flutter to increase productivity and happiness.
- Host: GitHub
- URL: https://github.com/salkuadrat/f
- Owner: salkuadrat
- License: mit
- Created: 2021-11-11T19:46:16.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-29T08:24:36.000Z (about 3 years ago)
- Last Synced: 2024-10-31T05:34:16.480Z (3 months ago)
- Topics: cli, dart, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/f
- Size: 222 KB
- Stars: 27
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome-list - f
README
# F
A simple shortcut, command line interface (CLI) for Flutter to increase productivity and happiness.
## Installation
To activate f CLI from your terminal.
```bash
pub global activate f
```### Windows Problem
For those of you who use Windows, you might experience a "double run" problem, where some f commands will be called twice.
It's a [known problem](https://github.com/dart-lang/pub/issues/2934) that comes with pub (and affected every CLI package in pub.dev).
The solution for this problem, for now, is to activate f locally, by first cloning the repository to your local drive.
```bash
git clone https://github.com/salkuadrat/f
```Then activate it with this command.
```bash
pub global activate --source path
```As example, if you run `git clone` on the root of drive D, then the activate command will be...
```bash
pub global activate --source path "D:\f"
```This kind of local activation will nicely handle the "double run" problem on Windows.
## Create Project
Use this command to create a Flutter project:
```bash
f c myapp
```It's the same as `flutter create myapp`.
To create Flutter project with some predefined dependencies, you can list them after the project name.
```bash
f c myapp path intl http provider
```The command above will generate `myapp` project in `myapp` directory, and automatically install all the required dependencies (for this example: path, intl, http & provider).
You can also pass other arguments, like project name, organization name, or specify the programming language used for the native platform.
```bash
f c -p myapp -o dev.flutter -a kotlin -i swift myapp path intl http provider
```## Starter Project
Starter project is a Flutter template that you can use for your new project.
To create a starter project:
```bash
f s myapp
```By default `f s` command will generate a starter project with Provider.
If you want starter project with other state management (BLoC, Cubit, GetX, or Riverpod), you can specify it in the `f s` command.
```bash
f s --bloc myappf s --cubit myapp
f s --getx myapp
f s --riverpod myapp
```You can also pass additional arguments.
```bash
f s -p myapp -o dev.flutter -a kotlin -i swift myapp
```To see the structure of starter project generated by `f s` command, you can explore the examples below.
[starter_bloc](starter_bloc)\
[starter_cubit](starter_cubit)\
[starter_getx](starter_getx)\
[starter_riverpod](starter_riverpod)\
[starter_provider](starter_provider)After creating a starter project with `f s`, you can use `f m` command to generate a new module inside the project, like:
```bash
f m posts
```It will auto-detect the state management in your project, and generate all the module files accordingly.
## Run Project
Run your Flutter project with this command.
```bash
f r
```It's the same as `flutter run`.
To run project as `flutter run --profile`:
```bash
f rp
```To run project as `flutter run --release`:
```bash
f rr
```You can add `-v` to the end of f command to display the complete diagnostic informations.
```bash
f r -v
```## Build Project
To build executable for a Flutter project, use:
```bash
f b apkf b arr
f b appbundle
f b bundle
f b web
```To build apk with split per abi:
```bash
f bs apk
```## Other Commands
The complete list of f commands that you can use for Flutter.
Command
Description
f a -d DEVICE_ID
Analyzes the project’s Dart source code.
Alias offlutter analyze
f as -o DIRECTORY
Assemble and build flutter resources.
Alias offlutter assemble
f at -d DEVICE_ID
Attach to a running application.
Alias offlutter attach
f b DIRECTORY
Flutter build commands.
Alias offlutter build
f bs DIRECTORY
Flutter build commands with split per abi.
Alias offlutter build --split-per-abi
f ch CHANNEL_NAME
List or switch flutter channels.
Alias offlutter channel
f cl
Clean a flutter project.
Alias offlutter clean
f dev -d DEVICE_ID
List all connected devices.
Alias offlutter devices
f doc
Show information about the installed tooling.
Alias offlutter doctor
f drv
Runs Flutter Driver tests for the current project.
Alias offlutter drive
f e
List, launch and create emulators.
Alias offlutter emulators
f f DIRECTORY|DART_FILE
Formats Flutter source code.
Alias offlutter format
f i -d DEVICE_ID
Install a Flutter app on an attached device.
Alias offlutter install
f l
Show log output for running Flutter apps.
Alias offlutter logs
f t [DIRECTORY|DART_FILE]
Runs tests in this package.
Alias offlutter test
f up
Upgrade your copy of Flutter.
Alias offlutter upgrade
f down
Downgrade Flutter to the last active version for the current channel. Alias offlutter downgrade