added title in loginscreen
This commit is contained in:
BIN
assets/logo.png
Normal file
BIN
assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 KiB |
BIN
fonts/Cinzel-Black.ttf
Normal file
BIN
fonts/Cinzel-Black.ttf
Normal file
Binary file not shown.
BIN
fonts/Cinzel-Bold.ttf
Normal file
BIN
fonts/Cinzel-Bold.ttf
Normal file
Binary file not shown.
BIN
fonts/Cinzel-ExtraBold.ttf
Normal file
BIN
fonts/Cinzel-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
fonts/Cinzel-Medium.ttf
Normal file
BIN
fonts/Cinzel-Medium.ttf
Normal file
Binary file not shown.
BIN
fonts/Cinzel-Regular.ttf
Normal file
BIN
fonts/Cinzel-Regular.ttf
Normal file
Binary file not shown.
BIN
fonts/Cinzel-SemiBold.ttf
Normal file
BIN
fonts/Cinzel-SemiBold.ttf
Normal file
Binary file not shown.
@@ -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(
|
||||
|
||||
31
lib/widgets/password_textfield.dart
Normal file
31
lib/widgets/password_textfield.dart
Normal file
@@ -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<PasswordField> createState() => _PasswordFieldState();
|
||||
}
|
||||
|
||||
class _PasswordFieldState extends State<PasswordField> {
|
||||
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),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
37
pubspec.yaml
37
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
|
||||
Reference in New Issue
Block a user