-
Notifications
You must be signed in to change notification settings - Fork 3
Project Setup
You can use the create.sh
or create.ps1
scripts which will create a new project. It will clone the repository to the current directory and rename the project for you and the other files based on the configurations you will provide.
For Bash Copy the following and execute it in your terminal. Do not forget to add the parameters mentioned above.
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ERNI-Academy/starterkit-mobile-application-flutter/HEAD/scripts/create.sh)"
For PowerShell
iex ((iwr -useb 'https://raw.githubusercontent.com/ERNI-Academy/starterkit-mobile-application-flutter/HEAD/scripts/create.ps1').Content)
After running either script, it will prompt you to enter the project name, app id, and directory where the project will be created. It will print out the app name, app id, and directory where the project will be created. It will also ask you to confirm if you want to continue.
Running this script will create a new project based on the starterkit.
It will clone the starterkit-mobile-application-flutter repository to the current directory and rename the project.
You will be prompted to enter the project name, app id, and directory where the project will be created.
Enter project name: sample
Enter app id: com.sample.app
Enter directory where the project will be created: $HOME\repos # ~/repos for Linux/Mac
Project name: sample
Project repo name: sample
Project Directory: C:\Users\your-name\repos\sample # or /Users/your-name/repos/sample for Mac and /home/your-name/repos/sample for Linux
App id: com.sample.app
App name: Sample
Are you sure you want to continue? (y/n):
💡 NOTE
- The script will check if you already have FVM installed.
- If FVM is installed, the script will continue to install the configured Flutter SDK version, get the pub dependencies, generate the code, and resolve the lint issues that can be automatically fixed.
- You may need to manually resolve minor lint issues in the project, specifically the import ordering, after running the script.
Update the contents of .secrets/dev.json
, and add the other .json
file for each of your environment.
Read more about setting up your environments here.
Run the following commands to generate code. Note that this project uses FVM to manage its Flutter SDK versions.
# Install the Flutter SDK version specified in .fvmrc
fvm install
# Run this command if appropriate
fvm flutter pub get
# Run this command to generate localization files
fvm dart run intl_utils:generate
# Run this command whenever you use build_runner
fvm dart run build_runner build --delete-conflicting-outputs
Read more about code generation here.
❗ IMPORTANT
- Be sure to open the Flutter project (i.e.
starterkit_app
) in VSCode, and not the root directory of the repository. This is because the.vscode
folder is configured with additional settings such as launch configurations, code snippets, and project-scoped settings. - The same goes when running
fvm flutter <command>
, be sure to run it in the Flutter project directory. - Do not use the
flutter
ordart
command directly. Always usefvm flutter
orfvm dart
to ensure that the correct Flutter SDK version is used.