You can either download Nylo here or clone the git repository using the below command.
git clone https://github.com/nylo-core/nylo.git nylo_app
flutter pub get when opening the project for the first time to fetch all dependencies.
Adding your .env file
You will also need to add a
.env file to your project at the root level. If you've downloaded Nylo through our site or on GitHub, this file will already be there.
The project must have a
.envfile to build successfully.
Specific .env file per environment
You can create a
.env.production file at the rool level of your project. Add it to your assets in
pubspec.yaml and then run or build your flutter app by specifiying the env file path like below.
ENV_FILE_PATH defaults to
flutter run --dart-define ENV_FILE_PATH=.env.production flutter build --dart-define ENV_FILE_PATH=.env.staging
Running the project
Nylo projects run in the exact 'normal' way you'd build a Flutter app. Depending on which IDE you have chosen, this part will be slightly different.
Once you have done the above steps, try running the project. If the build is successful, the app will display Nylo's default landing screen.
Metro CLI tool
Nylo provides a CLI tool called Metro. It's been built so you can run commands in the terminal to create things. Using Metro, you can create the following in your projects:
- Stateful widgets and stateless widgets
- API Services
flutter pub run nylo_framework:main make:model Property will create a new 'Property' model in your project.
To access the menu, you can run the below in the terminal.
flutter pub run nylo_framework:main
Creating an alias for Metro (Mac guide)
flutter pub run nylo_framework:main each time you want to run a command is long.
So, to make things easier, create an alias.
If you're new to aliases, they allow you to create alternative names for your commands.
flutter pub run nylo_framework:main can become
- Open your bash_profile
sudo open ~/.bash_profile
- Add this alias to your bash_profile
... alias metro='flutter pub run nylo_framework:main'
- Then run the following
Now you can type
metro from your terminal to run commands in your Nylo project.
Can't find your bash_profile?
If you are unsure where to add the above, check out some guides online for where to find your bash_profile file.
The above example assumes that your bash_profile is in your