问题
I am thinking of writing a mobile app in Flutter (which uses dart). However I heavily use AWS and not being able to use their SDK would be troublesome.
Is there any good way to make use of it? As far as I know there is not a Dart version of the SDK. I don't know if it's possible to interrop to other language's libs in Dart or something?
Is my best bet to use the REST apis maybe?
回答1:
There is no official support for Flutter from AWS yet (March 2019)
BUT there is a community plugin that works perfectly fine on IOS and Android with Cognito and Sigv4 to access all AWS services securely.
Here are the details amazon_cognito_identity_dart
回答2:
You probably can use a MethodChannel and write platform specific code (Android) using AWS SDKs.
Refer to Platform Channels
回答3:
I just wrote a flutter plugin for that, but it now only supports Android, welcome PRs for iOS.
https://github.com/yongjhih/flutter_aws
回答4:
You can refer to this example if you can use Amazon API Gateway. A REST call can be something like:
@override
void initState() {
super.initState();
http.get(this._apiGatewayURL)
.then((response) => response.body)
.then(json.decode)
.then((movies) {
movies.forEach(_addMovie);
});
}
来源:https://stackoverflow.com/questions/49618844/flutter-dart-and-aws-sdk