diff --git a/fonts/summerbreeze.ttf b/fonts/summerbreeze.ttf new file mode 100644 index 0000000..5be8e9d Binary files /dev/null and b/fonts/summerbreeze.ttf differ diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 3c5e50f..55a03aa 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -6,6 +6,7 @@ import 'package:supabase_flutter/supabase_flutter.dart'; class LoginPage extends StatefulWidget { const LoginPage({super.key}); + static const routeName = '/login'; @override @@ -15,6 +16,14 @@ class LoginPage extends StatefulWidget { class _LoginPageState extends State { final TextEditingController emailController = TextEditingController(); final TextEditingController passwordController = TextEditingController(); + + void _loginSubmitted(String email, String password, BuildContext context) { + DbHelper.login(email, password).onError( + (AuthException error, stackTrace) => + Messenger.showError(context, error.message), + ); + } + @override Widget build(BuildContext context) { Size screenSize = MediaQuery.of(context).size; @@ -28,36 +37,7 @@ class _LoginPageState extends State { ), Align( alignment: Alignment.topCenter, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (screenSize.width > 760) - Text( - 'BRISEN', - style: Theme.of(context).textTheme.displayLarge!.copyWith( - fontFamily: 'Cinzel', - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: Image.network( - 'https://vkyxfurwyfjfvjlseegf.supabase.co/storage/v1/object/sign/assets/logo.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhc3NldHMvbG9nby5wbmciLCJpYXQiOjE2OTE1OTUyNTcsImV4cCI6MTcyMzEzMTI1N30.EZeMK8bfz83jk1ELdPga0VhyedwZ4ZKDsUEGPR0QBBM&t=2023-08-09T15%3A34%3A17.513Z', - width: 200, - ), - ), - if (screenSize.width > 760) - Text( - 'CHECKER', - style: Theme.of(context).textTheme.displayLarge!.copyWith( - fontFamily: 'Cinzel', - fontWeight: FontWeight.bold, - color: Colors.white, - ), - ) - ], - )), + child: _tilteBuilder(screenSize.width, context)), Scaffold( backgroundColor: Colors.transparent, body: Center( @@ -108,11 +88,72 @@ class _LoginPageState extends State { ), ]); } +} - void _loginSubmitted(String email, String password, BuildContext context) { - DbHelper.login(email, password).onError( - (AuthException error, stackTrace) => - Messenger.showError(context, error.message), +Widget _tilteBuilder(double screenWidth, BuildContext context) { + if (screenWidth > 840) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 286, + child: Text( + textAlign: TextAlign.end, + 'BRISEN', + style: Theme.of(context).textTheme.displayLarge!.copyWith( + fontFamily: 'Summerbreeze', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Image.network( + 'https://vkyxfurwyfjfvjlseegf.supabase.co/storage/v1/object/sign/assets/logo.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhc3NldHMvbG9nby5wbmciLCJpYXQiOjE2OTE1OTUyNTcsImV4cCI6MTcyMzEzMTI1N30.EZeMK8bfz83jk1ELdPga0VhyedwZ4ZKDsUEGPR0QBBM&t=2023-08-09T15%3A34%3A17.513Z', + width: 200, + ), + ), + SizedBox( + width: 286, + child: Text( + 'CHECKER', + style: Theme.of(context).textTheme.displayLarge!.copyWith( + fontFamily: 'Summerbreeze', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ) + ], + ); + } else { + return Column( + children: [ + Text( + 'BRISEN', + style: Theme.of(context).textTheme.displayMedium!.copyWith( + fontFamily: 'Summerbreeze', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 15), + child: Image.network( + 'https://vkyxfurwyfjfvjlseegf.supabase.co/storage/v1/object/sign/assets/logo.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhc3NldHMvbG9nby5wbmciLCJpYXQiOjE2OTE1OTUyNTcsImV4cCI6MTcyMzEzMTI1N30.EZeMK8bfz83jk1ELdPga0VhyedwZ4ZKDsUEGPR0QBBM&t=2023-08-09T15%3A34%3A17.513Z', + width: 150, + ), + ), + Text( + 'CHECKER', + style: Theme.of(context).textTheme.displayMedium!.copyWith( + fontFamily: 'Summerbreeze', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ) + ], ); } } diff --git a/lib/services/dbhelper.dart b/lib/services/dbhelper.dart index 3973312..77e5b9d 100644 --- a/lib/services/dbhelper.dart +++ b/lib/services/dbhelper.dart @@ -12,8 +12,9 @@ import 'package:provider/provider.dart' as provider; class DbHelper { static const checkedItemsTableName = 'checkedItems'; static const checklistsTableName = 'checklists'; - static ChecklistProvider? clProvider; static const itemsTableName = 'items'; + static const profilesTableName = 'profiles'; + static ChecklistProvider? clProvider; static late final SupabaseClient _client; diff --git a/pubspec.yaml b/pubspec.yaml index 5ff8b90..f256b0b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,6 +64,9 @@ flutter: - asset: fonts/Cinzel-ExtraBold.ttf - asset: fonts/Cinzel-Medium.ttf - asset: fonts/Cinzel-SemiBold.ttf + - family: Summerbreeze + fonts: + - asset: fonts/summerbreeze.ttf # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in