@@ -8,7 +8,7 @@ class MyApp extends StatelessWidget {
8
8
Widget build (BuildContext context) {
9
9
return LitAuthInit (
10
10
authProviders: AuthProviders (
11
- emailAndPassword: true ,
11
+ emailAndPassword: true , // enabled by default
12
12
google: true ,
13
13
anonymous: true ,
14
14
),
@@ -43,13 +43,19 @@ class SplashScreen extends StatelessWidget {
43
43
child: Text ('Sign out' ),
44
44
),
45
45
unauthenticated: LitAuth (
46
+ /// STANDARD
46
47
config: AuthConfig .standard (
47
48
title: Text (
48
49
'🔥Welcome to Lit Firebase!🔥' ,
49
50
textAlign: TextAlign .center,
50
51
style: Theme .of (context).textTheme.headline4,
51
52
),
52
53
),
54
+
55
+ /// CUSTOM
56
+ // config: AuthConfig.custom(
57
+ // signIn: CustomSignInWidget(),
58
+ // ),
53
59
),
54
60
),
55
61
),
@@ -58,6 +64,7 @@ class SplashScreen extends StatelessWidget {
58
64
}
59
65
}
60
66
67
+ /// A custom Sign-in widget built with Lit Firebase components
61
68
class CustomSignInWidget extends StatelessWidget {
62
69
const CustomSignInWidget ({Key key}) : super (key: key);
63
70
@@ -66,31 +73,40 @@ class CustomSignInWidget extends StatelessWidget {
66
73
return Column (
67
74
children: [
68
75
Text ('Welcome' , style: Theme .of (context).textTheme.headline4),
69
- RaisedButton (
70
- onPressed: () {
71
- context.signInAnonymously ();
72
- },
73
- child: Text ('Anony Sign In' ),
74
- ),
75
76
SignInForm (
76
77
formChild: Column (
77
78
children: [
78
- Text (
79
- 'This is my custom form' ,
80
- style: Theme .of (context).textTheme.headline5,
79
+ Padding (
80
+ padding: const EdgeInsets .all (8.0 ),
81
+ child: Text (
82
+ 'A custom form' ,
83
+ style: Theme .of (context).textTheme.headline5,
84
+ ),
81
85
),
82
- EmailTextFormField (
83
- decoration: InputDecoration (labelText: 'My Email Label' ),
86
+ Padding (
87
+ padding: const EdgeInsets .all (8.0 ),
88
+ child: EmailTextFormField (
89
+ decoration: InputDecoration (labelText: 'My Email Label' ),
90
+ ),
84
91
),
85
- PasswordTextFormField (
86
- decoration: InputDecoration (labelText: 'My Password Label' ),
92
+ Padding (
93
+ padding: const EdgeInsets .all (8.0 ),
94
+ child: PasswordTextFormField (
95
+ decoration: InputDecoration (labelText: 'My Password Label' ),
96
+ ),
87
97
),
88
98
RaisedButton (
89
99
onPressed: () {
90
100
context.signInWithEmailAndPassword ();
91
101
},
92
102
child: Text ('Sign In' ),
93
- )
103
+ ),
104
+ FlatButton (
105
+ onPressed: () {
106
+ context.signInAnonymously ();
107
+ },
108
+ child: Text ('Anony Sign In' ),
109
+ ),
94
110
],
95
111
),
96
112
),
0 commit comments