Skip to content

Commit 2193e8f

Browse files
Peter Gordon HayesPeter Gordon Hayes
Peter Gordon Hayes
authored and
Peter Gordon Hayes
committed
feat: push v0.2.2
1 parent 68b47f1 commit 2193e8f

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.2.2
2+
3+
- feat: add `context.watchSignedInUser()` method to watch the `User` object for changes in sign-in state.
4+
- feat: add `context.resetSignInForm()` method to reset clear the sign-in form state (password and email). To assist in more complicated UI builds.
5+
- fix: add notification configuration for `LitAuth.custom`
6+
- refactor: log all 'server errors' to console to provide help in debugging
7+
- docs: various documentation updates
8+
19
# 0.2.1
210

311
- fix: revert to meta 1.1.8 package for testing

README.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ return LitAuth(
183183
},
184184
);
185185
```
186-
**Note**: these handlers will not be called if `LitAuth` is already disposed.
186+
**NOTE**: these handlers will not be called if `LitAuth` is already disposed.
187187

188188
For example, if you were to wrap this `LitAuth` in `LitAuthState`, such as:
189189
```dart
@@ -213,11 +213,19 @@ RaisedButton(
213213
);
214214
```
215215

216-
### Current user
216+
### Get current user
217217
Get the current signed-in user:
218218
```dart
219-
context.getSignedInUser()
219+
final user = context.getSignedInUser()
220220
```
221+
222+
### Watch user for changes
223+
Watches the `User` object for changes.
224+
```dart
225+
final user = context.watchSignedInUser()
226+
```
227+
Should only be used in the build method.
228+
221229
### Determine if submitting is active
222230
Whether Lit Firebase is currently attempting to authenticate. Can be used to show a loading indicator.
223231

@@ -407,6 +415,18 @@ class YourCustomSignInWidget extends StatelessWidget {
407415
}
408416
```
409417

418+
**NOTE**: `SignInForm` needs to be provided above the `EmailTextFormField` and `PasswordTextFormField`.
419+
420+
The state of the password and email can be cleared manually by calling:
421+
422+
```dart
423+
context.resetSignInForm()
424+
```
425+
426+
This will reset the form to it's initial state.
427+
428+
It's a good idea to do this when you have multiple `EmailTextFormField` and `PasswordTextFormField` widgets in seperate locations, for example when you have a separate Sign-in form and a Registration form.
429+
410430
## Planned features
411431

412432

example/pubspec.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ packages:
225225
path: ".."
226226
relative: true
227227
source: path
228-
version: "0.2.1"
228+
version: "0.2.2"
229229
matcher:
230230
dependency: transitive
231231
description:

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Pre-lit Firebase Authentication. Drop in and add Firebase Auth in j
33
repository: https://github.com/funwithflutter/lit_firebase_auth
44
homepage: https://github.com/funwithflutter/lit_firebase_auth
55

6-
version: 0.2.1
6+
version: 0.2.2
77

88
environment:
99
sdk: ">=2.7.0 <3.0.0"

0 commit comments

Comments
 (0)