In this project, we use flutter 2.10.0
. If you have a different version, you should consider installing FVM.
flutter pub get
flutter run
- Flutter 2.5.3 - The framework used
- Dart - The language used
- Erobot App API - By our backend team.
We use JSON Serializable [ https://flutter.dev/docs/development/data-and-backend/json#code-generation ] package build tool to generate a model from JSON to the Class object. In case you want to add more fields model or even change the model data type, you need to run the command:
flutter pub run build_runner build --delete-conflicting-outputs
We also use flutter_gen which is the Flutter code generator for your assets, fonts, colors, … — to Get rid of all String-based APIs. To Generate new assets, run following commands:
fluttergen
Widget build(BuildContext context) {
return Assets.images.profile.image();
}
We use GetX for our state management solution with advantages of CLI. (We have not considered to use other solutions from GetX such as routing, snackbar & bottom sheet yet)
We use get_cli to automated our development process.
// To install:
flutter pub global activate get_cli
// To create a page:
// (Pages have controller, view, and binding)
// Note: you can use any name, ex: `get create page:login`
get create page:home
get install camera
// To install a dev package in your project (dependencies_dev):
get install flutter_launcher_icons --dev
// To remove a package from your project:
get remove http
// For more detail
get help
We also use GetX Snippets.
Even we use getx, we don't use its GetConnect
for communicating with our API.
For example, if we are creating a post API with the endpoint: https://example.com/posts.
We have to create a class in lib/services/apis/
folder, eg:
// - extends BaseResourceOwnerApi: if you need token in request header.
// - extends BaseAppApi: if you don't need token in request header.
class PostApi extends BaseResourceOwnerApi<PostModel> {
Future<dynamic> fetchAllPosts() async {
var queryParameters = {'included': 'images,author'}
var result = await super.fetchAll(queryParameters: queryParameters);
return result;
}
// https://example.com/posts
// => nameInUrl = posts
@override
String get nameInUrl => "posts";
@override
objectTransformer(Map<String, dynamic> json) {
return PostModel.fromJson(json);
}
....
}
Check this file for more:
- Extends your class with BaseResourceOwnerApi, if you need token in request header.
- Extends your class with BaseAppApi, if you don't need token in request header.
We use adaptive_dialog to display the dialog. Available dialogs are:
showOkAlertDialog()
showOkCancelAlertDialog()
showConfirmationDialog()
showModalActionSheet()
showTextInputDialog()
showTextAnswerDialog()
- Find Snackbars solotion
- Find BottomSheets solution
Get info such as Variant, Config, Store, Alias, MD5, SHA1, SHA-256, Valid until
with the following command:
cd android
./gradlew signingReport
We prefer using major versions of most package if supported. To upgrade packages, run commands below:
flutter pub outdated
flutter pub upgrade --major-versions
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details