diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..ba8a951 Binary files /dev/null and b/assets/logo.png differ diff --git a/fonts/Cinzel-Black.ttf b/fonts/Cinzel-Black.ttf new file mode 100644 index 0000000..35731e9 Binary files /dev/null and b/fonts/Cinzel-Black.ttf differ diff --git a/fonts/Cinzel-Bold.ttf b/fonts/Cinzel-Bold.ttf new file mode 100644 index 0000000..6200673 Binary files /dev/null and b/fonts/Cinzel-Bold.ttf differ diff --git a/fonts/Cinzel-ExtraBold.ttf b/fonts/Cinzel-ExtraBold.ttf new file mode 100644 index 0000000..7652689 Binary files /dev/null and b/fonts/Cinzel-ExtraBold.ttf differ diff --git a/fonts/Cinzel-Medium.ttf b/fonts/Cinzel-Medium.ttf new file mode 100644 index 0000000..830dcf5 Binary files /dev/null and b/fonts/Cinzel-Medium.ttf differ diff --git a/fonts/Cinzel-Regular.ttf b/fonts/Cinzel-Regular.ttf new file mode 100644 index 0000000..c92b3db Binary files /dev/null and b/fonts/Cinzel-Regular.ttf differ diff --git a/fonts/Cinzel-SemiBold.ttf b/fonts/Cinzel-SemiBold.ttf new file mode 100644 index 0000000..cd59bfc Binary files /dev/null and b/fonts/Cinzel-SemiBold.ttf differ diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 3b84cc8..c38395b 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -1,4 +1,5 @@ import 'package:briessenchecker/services/dbhelper.dart'; +import 'package:briessenchecker/widgets/password_textfield.dart'; import 'package:flutter/material.dart'; class LoginPage extends StatelessWidget { @@ -20,6 +21,36 @@ class LoginPage extends StatelessWidget { 'nekro_wallpaper.jpg', ), ), + Align( + alignment: Alignment.topCenter, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'BRISEN', + style: Theme.of(context).textTheme.displayLarge!.copyWith( + fontFamily: 'Cinzel', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 20), + child: Image( + width: 200, + image: AssetImage('logo.png'), + ), + ), + Text( + 'CHECKER', + style: Theme.of(context).textTheme.displayLarge!.copyWith( + fontFamily: 'Cinzel', + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ) + ], + )), Scaffold( backgroundColor: Colors.transparent, body: Center( @@ -32,7 +63,7 @@ class LoginPage extends StatelessWidget { height: 300, width: dialogWidth, child: Padding( - padding: const EdgeInsets.all(10.0), + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20), child: Form( child: Column( mainAxisSize: MainAxisSize.max, @@ -51,13 +82,10 @@ class LoginPage extends StatelessWidget { decoration: const InputDecoration(label: Text('Email')), ), const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), - TextFormField( + PasswordField( controller: passwordController, - autofillHints: const ['password', 'pass', 'login'], - onFieldSubmitted: (value) => _loginSubmitted( + onSubmitted: () => _loginSubmitted( emailController.text, passwordController.text), - decoration: - const InputDecoration(label: Text('Password')), ), const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), FloatingActionButton.extended( diff --git a/lib/widgets/password_textfield.dart b/lib/widgets/password_textfield.dart new file mode 100644 index 0000000..d313094 --- /dev/null +++ b/lib/widgets/password_textfield.dart @@ -0,0 +1,31 @@ +import 'package:flutter/material.dart'; + +class PasswordField extends StatefulWidget { + const PasswordField( + {super.key, required this.controller, required this.onSubmitted}); + final TextEditingController controller; + final VoidCallback onSubmitted; + + @override + State createState() => _PasswordFieldState(); +} + +class _PasswordFieldState extends State { + bool isObscured = true; + @override + Widget build(BuildContext context) { + return TextFormField( + controller: widget.controller, + obscureText: isObscured, + autofillHints: const ['password', 'pass', 'login'], + onFieldSubmitted: (value) => widget.onSubmitted(), + decoration: InputDecoration( + label: const Text('Password'), + suffixIcon: TextButton( + onPressed: () => setState(() => isObscured = !isObscured), + child: Icon(isObscured ? Icons.visibility_off : Icons.visibility), + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 48fc954..6b6d671 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -55,6 +55,15 @@ dev_dependencies: # The following section is specific to Flutter packages. flutter: + fonts: + - family: Cinzel + fonts: + - asset: fonts/Cinzel-Regular.ttf + - asset: fonts/Cinzel-Black.ttf + - asset: fonts/Cinzel-Bold.ttf + - asset: fonts/Cinzel-ExtraBold.ttf + - asset: fonts/Cinzel-Medium.ttf + - asset: fonts/Cinzel-SemiBold.ttf # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in @@ -64,30 +73,4 @@ flutter: # To add assets to your application, add an assets section, like this: assets: - secrets.env - - assets/nekro_wallpaper.jpg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + - assets/nekro_wallpaper.jpg \ No newline at end of file