add basic oauth methods
This commit is contained in:
		
							parent
							
								
									387d58dfa2
								
							
						
					
					
						commit
						beaa70fe8b
					
				
					 15 changed files with 351 additions and 9 deletions
				
			
		|  | @ -1,6 +1,7 @@ | |||
| import 'package:flutter/material.dart'; | ||||
| import 'package:slothmu/api/user.dart'; | ||||
| import 'package:slothmu/business_logic/user.dart'; | ||||
| import 'package:localization/localization.dart'; | ||||
| import '../business_logic/auth/oauth.dart' as oauth; | ||||
| 
 | ||||
| class Login extends StatefulWidget { | ||||
|   const Login({Key? key}) : super(key: key); | ||||
|  | @ -64,6 +65,13 @@ class _LoginFormState extends State<LoginForm> { | |||
|                 if (!isValid) { | ||||
|                   ScaffoldMessenger.of(context).showSnackBar(SnackBar( | ||||
|                       content: Text("login-failed-snackbar-text".i18n()))); | ||||
|                 } else { | ||||
|                   Navigator.push( | ||||
|                       context, | ||||
|                       MaterialPageRoute( | ||||
|                         builder: (context) => | ||||
|                             const AuthPage(baseurl: "kittycat.homes"), | ||||
|                       )); | ||||
|                 } | ||||
|               }, | ||||
|               icon: const Icon(Icons.login), | ||||
|  | @ -73,3 +81,21 @@ class _LoginFormState extends State<LoginForm> { | |||
|     ); | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class AuthPage extends StatefulWidget { | ||||
|   const AuthPage({Key? key, required String baseurl}) : super(key: key); | ||||
| 
 | ||||
|   @override | ||||
|   State<AuthPage> createState() => _AuthPageState(); | ||||
| } | ||||
| 
 | ||||
| class _AuthPageState extends State<AuthPage> { | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Scaffold( | ||||
|       body: Center( | ||||
|         child: Text("hello"), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue