Skip to content

Instantly share code, notes, and snippets.

@adamcyber1
Last active September 15, 2020 13:46
Show Gist options
  • Save adamcyber1/84d64441a9a97f533e6d3b21afac2c33 to your computer and use it in GitHub Desktop.
Save adamcyber1/84d64441a9a97f533e6d3b21afac2c33 to your computer and use it in GitHub Desktop.
Configuring Amplify With Auth
void _configureAmplify() async {
if (!mounted) return;
// add all of the plugins we are currently using
// in our case... just one - Auth
AmplifyAuthCognito authPlugin = AmplifyAuthCognito();
amplifyInstance.addPlugin(authPlugins: [authPlugin]);
try {
await amplifyInstance.configure(amplifyconfig);
setState(() {
_amplifyConfigured = true;
});
} catch (e) {
print(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment