Flutter Installation and setup guide
Install Flutter on your device
After installation of Flutter, to check the installed version, use the command flutter --version
Note: Version might vary based on the current version used in the project
Run the Flutter Doctor command once the Flutter is installed. The Flutter Doctor performs the following tasks:
Downloads missing files required by the development environment.
Ensures we’ve installed the following:
Android SDK
Apple Xcode (on Mac)
Ensures that we’ve agreed to all software development licenses.
Checks the Android Studio IDE setup and recommends any changes required to get it working with Flutter.
Checks for connected devices.
Verifies that Flutter can recognize any connected hardware devices.
Recommends any changes required to get them connected and working.
Outputs a diagnosis, listing out issues found and recommendations.
If you want to run in local Chrome, make sure web security is disabled to avoid CORS errors.
Find below the steps to disable the web security of Chrome
Go to the folder where your flutter is added--flutter\bin\cache and remove a file named: flutter_tools.stamp
Go to flutter\packages\flutter_tools\lib\src\web and open the file chrome.dart.
Find '--disable-extensions'
Add '--disable-web-security'
Setting up device emulators/simulators for testing
For Android Studio IDE:
For Visual Studio Code IDE:
Once the development environment setup is completed, we have to run the application locally. This document provides steps on how to run the works_shg_app on a local device.
Clone the repo
git clone https://github.com/egovernments/DIGIT-Works.git
To run the application in the local environment, add the .env
file in the root folder of the project (frontend/works_shg_app
)-
Sample .env config:
BASE_URL='https://works-dev.digit.org/'
MDMS_API_PATH='egov-mds-service/v1/_search'
GLOBAL_ASSETS='https://works-dev.digit.org/works-dev-asset/worksGlobalConfig.json'
ENV_NAME="DEV"
Run the below commands in your terminal from the root of the project (frontend/works_shg_app)
flutter clean: To clean the build cache.
flutter pub get: To install the dependencies packages
Enable the desired device or browser to run the application using the command - flutter run: To start the application
Access the Flutter development tools for debugging purposes from the link in the terminal.