a small class helper (Getx service) that facilitate and speed up the development mobile apps with amazon web services
link to pub.dev: https://pub.dev/packages/flutter_amplify_helper
Run this command: With Flutter:
$ flutter pub add flutter_amplify_helper
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
flutter_amplify_helper: ^latest_version
- To get the sub id from the current user :
FlutterAmplifyHelper().getSub();
- To get the access token from the current user use the method below :
FlutterAmplifyHelper().getToken();
- To get started with flutter aws please follow the official documents from the link below :
https://docs.amplify.aws/start/q/integration/flutter/
- Install the package and import the file
FlutterAmplifyHelper
await Get.putAsync<FlutterAmplifyHelper>(
() => FlutterAmplifyHelper().init<ModelProvider>(amplifyConfig: amplifyconfig, modelProvider: ModelProvider.instance));
- To enable datastore category
await Get.putAsync<FlutterAmplifyHelper>(
() => FlutterAmplifyHelper().init<ModelProvider>(amplifyConfig: amplifyconfig, modelProvider: ModelProvider.instance,enableDatastore: true));
- Additional helpful streams :
to listen to auth events use the following stream function :
flutterAmplifyHelper.listenAuthChanges();
to listen to Datastore events use the following stream function :
flutterAmplifyHelper.listenDatastoreChanges();
All pull requests are welcome