Skip to content

Commit d854206

Browse files
Peter Gordon HayesPeter Gordon Hayes
authored andcommitted
docs: move comments to constructor
1 parent b0ea54b commit d854206

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

lib/src/presentation/lit_auth_ui.dart

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ import 'core/auth_config.dart';
1414
import 'core/notifications.dart';
1515
import 'lit_standard_sign_in_screen.dart';
1616

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.
2717
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.
2828
const LitAuthState({
2929
Key key,
3030
@required this.authenticated,
@@ -68,50 +68,6 @@ class LitAuthState extends StatelessWidget {
6868
/// TypeDef callback for authentication failure
6969
typedef AuthFailureCallback = void Function(AuthFailure failure);
7070

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-
///
11571
class LitAuth extends StatelessWidget {
11672
/// Configure the sign-in UI and provide custom decoration/configuration for
11773
/// the sign-in elements. Leaving this empty will show the standard sign-in
@@ -140,6 +96,50 @@ class LitAuth extends StatelessWidget {
14096
/// Configuration for custom success notifications
14197
final NotificationConfig successNotification;
14298

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+
///
143143
const LitAuth({
144144
Key key,
145145
this.config,

0 commit comments

Comments
 (0)