@@ -6,22 +6,48 @@ import 'constants.dart';
66
77class SignUp extends StatelessWidget {
88 const SignUp ({Key ? key}) : super (key: key);
9-
109 @override
1110 Widget build (BuildContext context) {
11+ void navigateHome (AuthResponse response) {
12+ Navigator .of (context).pushReplacementNamed ('/home' );
13+ }
14+
15+ final darkModeThemeData = ThemeData .dark ().copyWith (
16+ colorScheme: const ColorScheme .dark (
17+ primary: Color .fromARGB (248 , 183 , 183 , 183 ), // text below main button
18+ ),
19+ textSelectionTheme: TextSelectionThemeData (
20+ cursorColor: Colors .blueGrey[300 ], // cursor when typing
21+ ),
22+ inputDecorationTheme: InputDecorationTheme (
23+ fillColor: Colors .grey[800 ], // background of text entry
24+ filled: true ,
25+ border: OutlineInputBorder (
26+ borderRadius: BorderRadius .circular (8 ),
27+ borderSide: BorderSide .none,
28+ ),
29+ labelStyle: const TextStyle (color: Color .fromARGB (179 , 255 , 255 , 255 )), // text labeling text entry
30+ ),
31+ elevatedButtonTheme: ElevatedButtonThemeData (
32+ style: ElevatedButton .styleFrom (
33+ backgroundColor: const Color .fromARGB (255 , 22 , 135 , 188 ), // main button
34+ foregroundColor: const Color .fromARGB (255 , 255 , 255 , 255 ), // main button text
35+ shape: RoundedRectangleBorder (
36+ borderRadius: BorderRadius .circular (8 ),
37+ ),
38+ ),
39+ ),
40+ );
41+
1242 return Scaffold (
1343 appBar: appBar ('Sign In' ),
1444 body: ListView (
1545 padding: const EdgeInsets .all (24.0 ),
1646 children: [
1747 SupaEmailAuth (
1848 redirectTo: kIsWeb ? null : 'io.supabase.flutter://' ,
19- onSignInComplete: (response) {
20- Navigator .of (context).pushReplacementNamed ('/home' );
21- },
22- onSignUpComplete: (response) {
23- Navigator .of (context).pushReplacementNamed ('/home' );
24- },
49+ onSignInComplete: navigateHome,
50+ onSignUpComplete: navigateHome,
2551 metadataFields: [
2652 MetaDataField (
2753 prefixIcon: const Icon (Icons .person),
@@ -36,6 +62,34 @@ class SignUp extends StatelessWidget {
3662 ),
3763 ],
3864 ),
65+
66+ const Divider (),
67+ optionText,
68+ spacer,
69+
70+ // Dark theme example
71+ Card (
72+ elevation: 10 ,
73+ color: const Color .fromARGB (255 , 24 , 24 , 24 ),
74+ child: Padding (
75+ padding: const EdgeInsets .all (30 ),
76+ child: Theme (
77+ data: darkModeThemeData,
78+ child: SupaEmailAuth (
79+ redirectTo: kIsWeb ? null : 'io.supabase.flutter://' ,
80+ onSignInComplete: navigateHome,
81+ onSignUpComplete: navigateHome,
82+ prefixIconEmail: null ,
83+ prefixIconPassword: null ,
84+ localization: const SupaEmailAuthLocalization (
85+ enterEmail: "email" ,
86+ enterPassword: "password" ,
87+ dontHaveAccount: "sign up" ,
88+ forgotPassword: "forgot password" ),
89+ ),
90+ ),
91+ )),
92+
3993 const Divider (),
4094 optionText,
4195 spacer,
0 commit comments