Skip to content

Commit

Permalink
Prepare release 0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
finkmoritz committed Dec 22, 2021
1 parent 7ba05ba commit 93b4697
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.5 (2021-12-22)

- Upgrade to flutter '>=2.8.0' (including fix for *Stepper#controlsBuilder*)
- Enhance readme documentation (root and example)

## 0.1.4 (2021-08-15)

- Add multi-factor authentication
Expand Down
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Flutter plugin that automatically generates authentication widget templates base

<img src="https://github.com/finkmoritz/flutter_amplify_auth_ui/raw/main/example/screenshots/Demo.gif" alt="Demo" height="500px"/>

---

## Features

### SignInPage
Expand Down Expand Up @@ -54,22 +56,26 @@ Flutter plugin that automatically generates authentication widget templates base
### PasswordChangePage
- Change password by providing the old and a new password

---

## Prerequisites

If you have not already done so, follow the
[official Amplify documentation](https://docs.amplify.aws/start/q/integration/flutter)
in order to integrate [Amplify](https://docs.amplify.aws/start/q/integration/flutter)
with [Authentication](https://docs.amplify.aws/lib/auth/getting-started/q/platform/flutter)
into your project.

## Install

To use this plugin, add `flutter_amplify_auth_ui` as a `dev_dependency` in your pubspec.yaml:
```
dev_dependencies:
flutter_amplify_auth_ui: ^0.1.4
flutter_amplify_auth_ui: ^0.1.5
```

Run `flutter pub get` to install the plugin.

If you have not already done so, follow the
[official Amplify documentation](https://docs.amplify.aws/start/q/integration/flutter)
in order to integrate [Amplify](https://docs.amplify.aws/start/q/integration/flutter)
with [Authentication](https://docs.amplify.aws/lib/auth/getting-started/q/platform/flutter)
into your project.

## Generate Authentication Widgets

Execute the following command in your project's root folder in order to generate authentication widgets
Expand Down Expand Up @@ -152,6 +158,8 @@ class _MyAppState extends State<MyApp> {
}
```

---

## Showroom

The following images display the outcome of a particular Amplify configuration.
Expand Down Expand Up @@ -187,3 +195,9 @@ The following images display the outcome of a particular Amplify configuration.
<img src="https://github.com/finkmoritz/flutter_amplify_auth_ui/raw/main/example/screenshots/PasswordChangePage_light.png" alt="Preview" height="500px"/>
<img src="https://github.com/finkmoritz/flutter_amplify_auth_ui/raw/main/example/screenshots/PasswordChangePage_dark.png" alt="Preview" height="500px"/>
</p>

---

## Support

If you like this project, please support by starring the [Github repository](https://github.com/finkmoritz/flutter_amplify_auth_ui).
72 changes: 61 additions & 11 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,68 @@
# Flutter Amplify Auth UI Example
# Flutter Amplify Auth UI

This example demonstrates how the flutter_amplify_auth_ui plugin uses an Amplify configuration
to generate Authentication widgets.
Execute the following command in your project's root folder in order to generate authentication widgets
based on your Amplify configuration:

By executing the command from [example.sh](example.sh)
you generate Flutter widgets into the [target](target) folder that are based on the sample
Amplify configuration in the [amplify](amplify) folder.
```
flutter packages pub run flutter_amplify_auth_ui:main
```

## Usage
Easily integrate the generated authentication widgets in your project, e.g.:

`./example.sh`
``` dart
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify.dart';
import 'package:flutter/material.dart';
or
import 'generated_auth_classes/sign_in/sign_in_page.dart'; // <-- Import the generated widget
```
flutter packages pub run flutter_amplify_auth_ui:main --amplifyDir=./example/amplify --targetDir=./example/target
import 'amplifyconfiguration.dart';
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
initState() {
super.initState();
_configureAmplify();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Amplify Auth UI Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
debugShowCheckedModeBanner: false,
home: SignInPage( // <-- Include the generated widget in your widget tree
onSignIn: (context) => Navigator.push( //TODO Define what to do after sign in
context,
MaterialPageRoute(
builder: (context) =>
const MyHomePage(title: 'Flutter Demo Home Page'),
),
),
),
);
}
void _configureAmplify() async {
if (!mounted) return;
Amplify.addPlugins([
AmplifyAuthCognito(),
]);
try {
await Amplify.configure(amplifyconfig);
} on AmplifyAlreadyConfiguredException {
print("Tried to reconfigure Amplify; this can occur when your app restarts on Android.");
}
}
}
```
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: flutter_amplify_auth_ui
description: Flutter plugin that automatically generates authentication widget templates based on your Amplify CLI Authentication configuration.
version: 0.1.4
version: 0.1.5
homepage: https://github.com/finkmoritz/flutter_amplify_auth_ui
repository: https://github.com/finkmoritz/flutter_amplify_auth_ui
issue_tracker: https://github.com/finkmoritz/flutter_amplify_auth_ui/issues
documentation: https://github.com/finkmoritz/flutter_amplify_auth_ui/blob/main/README.md

environment:
sdk: '>=2.12.3 <3.0.0'
flutter: '>=2.0.0'
flutter: '>=2.8.0'

dependencies:
flutter:
Expand Down

0 comments on commit 93b4697

Please sign in to comment.