@@ -14,17 +14,17 @@ import 'core/auth_config.dart';
14
14
import 'core/notifications.dart' ;
15
15
import 'lit_standard_sign_in_screen.dart' ;
16
16
17
- /// A widget to switch between child widgets, depending on the
18
- /// current authentication state.
19
- ///
20
- /// Updates will automatically be triggered when the user's authentication state
21
- /// changes.
22
- ///
23
- /// You can easily create your own auth state subscription by calling the
24
- /// following in a widget build method:
25
- /// `final user = context.watch<User>();`
26
- /// Which will listen to the current [User] object.
27
17
class LitAuthState extends StatelessWidget {
18
+ /// A widget to switch between child widgets, depending on the
19
+ /// current authentication state.
20
+ ///
21
+ /// Updates will automatically be triggered when the user's authentication state
22
+ /// changes.
23
+ ///
24
+ /// You can easily create your own auth state subscription by calling the
25
+ /// following in a widget build method:
26
+ /// `final user = context.watch<User>();`
27
+ /// Which will listen to the current [User] object.
28
28
const LitAuthState ({
29
29
Key key,
30
30
@required this .authenticated,
@@ -68,50 +68,6 @@ class LitAuthState extends StatelessWidget {
68
68
/// TypeDef callback for authentication failure
69
69
typedef AuthFailureCallback = void Function (AuthFailure failure);
70
70
71
- /// The main widget to do any form of Authentication using **LitFirebaseAuth**.
72
- ///
73
- /// Must be below a [Scaffold] .
74
- ///
75
- /// This widget is used to configure the UI, provide decorations/themes, or
76
- /// create a completely custom sign-in form.
77
- ///
78
- /// To get started:
79
- /// ```dart
80
- /// LitAuth()
81
- /// ```
82
- /// {@end-tool}
83
- /// This will use the defaults configuration and UI theming.
84
- ///
85
- /// Provide an [AuthConfig] parameter to override theming and decoration of the
86
- /// standard sign-in form.
87
- ///
88
- /// Or, to create a completely custom sign-in form, make use of:
89
- /// ```dart
90
- /// LitAuth.custom(
91
- /// child: YourCustomSignInWidget(),
92
- /// )
93
- /// ```
94
- ///
95
- /// For more theming and custom sign-in widgets, please see the README.md file
96
- ///
97
- /// **Auth Success / Auth Failure**
98
- ///
99
- /// You can provide callbacks for authentication, with [onAuthSuccess] and
100
- /// [onAuthFailure]
101
- /// ```dart
102
- /// LitAuth(
103
- /// onAuthFailure: (failure) {
104
- /// print('Auth failed.');
105
- /// // todo: show error message
106
- /// },
107
- /// onAuthSuccess: () {
108
- /// print('Auth success.');
109
- /// // todo: navigate to authenticated screen
110
- /// },
111
- /// )
112
- /// ```
113
- /// {@end-tool}
114
- ///
115
71
class LitAuth extends StatelessWidget {
116
72
/// Configure the sign-in UI and provide custom decoration/configuration for
117
73
/// the sign-in elements. Leaving this empty will show the standard sign-in
@@ -140,6 +96,50 @@ class LitAuth extends StatelessWidget {
140
96
/// Configuration for custom success notifications
141
97
final NotificationConfig successNotification;
142
98
99
+ /// The main widget to do any form of Authentication using **LitFirebaseAuth**.
100
+ ///
101
+ /// Must be below a [Scaffold] .
102
+ ///
103
+ /// This widget is used to configure the UI, provide decorations/themes, or
104
+ /// create a completely custom sign-in form.
105
+ ///
106
+ /// To get started:
107
+ /// ```dart
108
+ /// LitAuth()
109
+ /// ```
110
+ /// {@end-tool}
111
+ /// This will use the defaults configuration and UI theming.
112
+ ///
113
+ /// Provide an [AuthConfig] parameter to override theming and decoration of the
114
+ /// standard sign-in form.
115
+ ///
116
+ /// Or, to create a completely custom sign-in form, make use of:
117
+ /// ```dart
118
+ /// LitAuth.custom(
119
+ /// child: YourCustomSignInWidget(),
120
+ /// )
121
+ /// ```
122
+ ///
123
+ /// For more theming and custom sign-in widgets, please see the README.md file
124
+ ///
125
+ /// **Auth Success / Auth Failure**
126
+ ///
127
+ /// You can provide callbacks for authentication, with [onAuthSuccess] and
128
+ /// [onAuthFailure]
129
+ /// ```dart
130
+ /// LitAuth(
131
+ /// onAuthFailure: (failure) {
132
+ /// print('Auth failed.');
133
+ /// // todo: show error message
134
+ /// },
135
+ /// onAuthSuccess: () {
136
+ /// print('Auth success.');
137
+ /// // todo: navigate to authenticated screen
138
+ /// },
139
+ /// )
140
+ /// ```
141
+ /// {@end-tool}
142
+ ///
143
143
const LitAuth ({
144
144
Key key,
145
145
this .config,
0 commit comments