|
1 | | -# team-mobile-app |
| 1 | +# [VaahFlutter by WebReinvent](https://docs.vaah.dev/vaahflutter) |
| 2 | + |
| 3 | +VaahFlutter is a Flutter-based framework that provides common features required in any application. |
| 4 | + |
| 5 | +The purpose of developing VaahFlutter is to create a framework that can be extended in a manageable and structured manner in order to develop large applications while not having to reinvent all essential functionalities every time. |
| 6 | + |
| 7 | +For More Info Please Check: [docs.vaah.dev/vaahflutter](https://docs.vaah.dev/vaahflutter) |
| 8 | + |
| 9 | +## Prerequisites |
| 10 | + |
| 11 | +Project requires Dart and flutter versions: |
| 12 | + |
| 13 | +```yaml |
| 14 | + sdk: ">=2.19.6" |
| 15 | + flutter: ">=3.7.11" |
| 16 | +``` |
| 17 | +
|
| 18 | +To change minimum requirement of dart and flutter change the `sdk and flutter` versions under `environment` in the `pubspec.yaml` file. |
| 19 | +<hr /> |
| 20 | + |
| 21 | +## How to run app in different environments: |
| 22 | + |
| 23 | +| **Environment name** | **Command** | |
| 24 | +| --- | --- | |
| 25 | +| Default | `flutter run` OR `flutter run --dart-define="environment=default"` | |
| 26 | +| Development | `flutter run --dart-define="environment=develop"` | |
| 27 | +| Staging/ QA | `flutter run --dart-define="environment=stage"` | |
| 28 | +| Production | `flutter run --dart-define="environment=production"` | |
| 29 | + |
| 30 | +## How to build app? |
| 31 | + |
| 32 | +### Building app with different environments |
| 33 | + |
| 34 | +| **Platform** | **Environment name** | **Command** | |
| 35 | +| --- | --- | --- | |
| 36 | +| Android | Default | `flutter build apk` OR `flutter build apk --dart-define="environment=default"` | |
| 37 | +| Android | Development | `flutter build apk --dart-define="environment=develop"` | |
| 38 | +| Android | Staging/ QA | `flutter build apk --dart-define="environment=stage"` | |
| 39 | +| Android | Production | `flutter build apk --dart-define="environment=production"` | |
| 40 | +| Android (appbundle) | Default | `flutter build appbundle` OR `flutter build appbundle --dart-define="environment=default"` | |
| 41 | +| Android (appbundle) | Development | `flutter build appbundle --dart-define="environment=develop"` | |
| 42 | +| Android (appbundle) | Staging/ QA | `flutter build appbundle --dart-define="environment=stage"` | |
| 43 | +| Android (appbundle) | Production | `flutter build appbundle --dart-define="environment=production"` | |
| 44 | + |
| 45 | +| **Platform** | **Environment name** | **Command** | |
| 46 | +| --- | --- | --- | |
| 47 | +| iOS | Default | `flutter build ipa` OR `flutter build ipa --dart-define="environment=default"` | |
| 48 | +| iOS | Development | `flutter build ipa --dart-define="environment=develop"` | |
| 49 | +| iOS | Staging/ QA | `flutter build ipa --dart-define="environment=stage"` | |
| 50 | +| iOS | Production | `flutter build ipa --dart-define="environment=production"` | |
| 51 | +| iOS (.app) | Default | `flutter build ios` OR `flutter build ipa --dart-define="environment=default"` | |
| 52 | +| iOS (.app) | Development | `flutter build ios --dart-define="environment=develop"` | |
| 53 | +| iOS (.app) | Staging/ QA | `flutter build ios --dart-define="environment=stage"` | |
| 54 | +| iOS (.app) | Production | `flutter build ios --dart-define="environment=production"` | |
| 55 | + |
| 56 | +### Building in different modes. |
| 57 | + |
| 58 | +Pass additional arguments with your build commands. |
| 59 | + |
| 60 | +| **mode** | **Command** | |
| 61 | +| --- | --- | |
| 62 | +| Debug | `flutter build ipa --debug`, `flutter build apk --debug` | |
| 63 | +| Profile | `flutter build ipa --profile`, `flutter build apk --profile` | |
| 64 | +| Release | `flutter build ipa --release`, `flutter build apk --release` | |
| 65 | + |
| 66 | +### Building ipa without signing it |
| 67 | +| **flag** | **command** | |
| 68 | +| --- | --- | |
| 69 | +| --no-codesign | `flutter build ipa --no-codesign`, `flutter build ios --no-codesign` | |
| 70 | + |
| 71 | +Note: building for `ipa` will give `Runner.xcarchive`. To check the app, you should right click on `Runner.xcarchive` > then select `show package contents` > then open `products` > `application` > There you will be able to find the application. |
| 72 | + |
| 73 | +## Packages: |
| 74 | +In `pubspec.yaml` file > Add essential packages in `dependencies`, and packages that a developer need in `dev_dependencies`. |
| 75 | + |
| 76 | +To automatically upgrade your package dependencies to the latest versions consider running |
| 77 | +``` |
| 78 | +flutter pub upgrade --major-versions |
| 79 | +``` |
| 80 | +
|
| 81 | +To see which dependencies have newer versions available, run |
| 82 | +``` |
| 83 | +flutter pub outdated |
| 84 | +``` |
| 85 | +<hr /> |
| 86 | +
|
| 87 | +## Project structure and coding conventions: |
| 88 | +
|
| 89 | +### [Official dart conventions](https://dart.dev/guides/language/effective-dart/style) |
| 90 | +
|
| 91 | +- 2 spaces for indentation |
| 92 | +- test files have `_test.ext` suffix in the file name > example `widget_test.dart` |
| 93 | +- Libraries, packages, directories, and source files name convention: snake_case(lowercase_with_underscores). |
| 94 | +- Classes, Enums, Typedefs, and extensions naming convention: UpperCamelCase. |
| 95 | +- Variables, constants, parameters naming convention: lowerCamelCase. |
| 96 | +- Method/ functions naming convention: lowerCamelCase. |
| 97 | +- Use relative path |
| 98 | + - ✘ `import 'package:demo/home.dart';` → This should be avoided. |
| 99 | + - ✔ `import './home.dart';` → Correct way |
| 100 | + - to fix imports you can use [dart-import](https://marketplace.visualstudio.com/items?itemName=luanpotter.dart-import) |
| 101 | +- Avoid using as instead, use is operator |
| 102 | +- Avoid print()/ debugPrint() calls |
| 103 | +
|
| 104 | +Android Production |
| 105 | +- universal package: `com.webreinvent.vaahflutter` |
| 106 | +
|
| 107 | +iOS Production |
| 108 | +- universal package: `com.webreinvent.vaahflutter` |
0 commit comments