You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-3
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,7 @@ return LitAuth(
183
183
},
184
184
);
185
185
```
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.
187
187
188
188
For example, if you were to wrap this `LitAuth` in `LitAuthState`, such as:
189
189
```dart
@@ -213,11 +213,19 @@ RaisedButton(
213
213
);
214
214
```
215
215
216
-
### Current user
216
+
### Get current user
217
217
Get the current signed-in user:
218
218
```dart
219
-
context.getSignedInUser()
219
+
final user = context.getSignedInUser()
220
220
```
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
+
221
229
### Determine if submitting is active
222
230
Whether Lit Firebase is currently attempting to authenticate. Can be used to show a loading indicator.
223
231
@@ -407,6 +415,18 @@ class YourCustomSignInWidget extends StatelessWidget {
407
415
}
408
416
```
409
417
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.
0 commit comments