A Flutter app that communicates with a Node.js API to generate and scan QR codes.
QR Code is created with Flutter. Installation instructions for Flutter can be found here.
- Navigate to the
/api
directory. - Run
npm install
. - Run
npm run start
. The API server should be running on port 3000.
-
Before running the mobile app, please ensure you are using the latest stable Flutter channel:
flutter channel stable flutter upgrade
This app was developed on Flutter stable channel 1.22.5
-
Clone this repo.
-
Change the
apiUrl
value in/lib/repositories/qr.dart
depending on the device you are using:- iOS Simulator:
'http://localhost:3000'
- Android Emulator:
'http://10.0.2.2:3000'
- Real Device: Run
ifconfig
to determine your IP address, and set the value to'http://<your_ip>:3000'
- iOS Simulator:
-
Open an emulator and run
flutter run
in the root of the project, or run directly from Android Studio
-
Business logic is managed with the bloc library. All blocs / cubits are located in
/lib/blocs
. flutter_bloc widgets are used in the frontend to handle state changes. -
API wrappers are contained in
/lib/repositories
. Instances of these repositories are declared in /lib/main.dart using RepositoryProviders so that these repositories can be used by any bloc in the application. Repositories should only be accessed by cubits / blocs. -
Tests are written using the flutter_test library and can be run using
flutter test test/<file>.dart
. Test files are located in/test
. Testing Flutter apps -
All screens are located in
/lib/screens
.