diff --git a/assets/nekro_wallpaper.jpg b/assets/nekro_wallpaper.jpg new file mode 100644 index 0000000..cd0b88b Binary files /dev/null and b/assets/nekro_wallpaper.jpg differ diff --git a/lib/assets/example_data.dart b/lib/example_data.dart similarity index 100% rename from lib/assets/example_data.dart rename to lib/example_data.dart diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index a378805..3b84cc8 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -10,39 +10,68 @@ class LoginPage extends StatelessWidget { final TextEditingController emailController = TextEditingController(); final TextEditingController passwordController = TextEditingController(); Size screenSize = MediaQuery.of(context).size; - double dialogWidth = screenSize.width > 400 ? 400 : screenSize.width; - return Scaffold( - body: Center( - child: SizedBox( - width: dialogWidth, - child: Form( - child: Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - TextFormField( - controller: emailController, - textInputAction: TextInputAction.next, - decoration: const InputDecoration(label: Text('Email')), + double dialogWidth = screenSize.width > 300 ? 300 : screenSize.width; + return Stack(children: [ + Image( + width: screenSize.width, + height: screenSize.height, + fit: BoxFit.cover, + image: const AssetImage( + 'nekro_wallpaper.jpg', + ), + ), + Scaffold( + backgroundColor: Colors.transparent, + body: Center( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).dialogBackgroundColor, + backgroundBlendMode: BlendMode.luminosity, + borderRadius: BorderRadius.circular(10), + ), + height: 300, + width: dialogWidth, + child: Padding( + padding: const EdgeInsets.all(10.0), + child: Form( + child: Column( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextFormField( + controller: emailController, + autofillHints: const [ + 'email', + 'username', + 'name', + 'login', + 'mail' + ], + textInputAction: TextInputAction.next, + decoration: const InputDecoration(label: Text('Email')), + ), + const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), + TextFormField( + controller: passwordController, + autofillHints: const ['password', 'pass', 'login'], + onFieldSubmitted: (value) => _loginSubmitted( + emailController.text, passwordController.text), + decoration: + const InputDecoration(label: Text('Password')), + ), + const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), + FloatingActionButton.extended( + onPressed: () => _loginSubmitted( + emailController.text, passwordController.text), + label: const Text('Login')) + ], ), - const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), - TextFormField( - controller: passwordController, - onFieldSubmitted: (value) => _loginSubmitted( - emailController.text, passwordController.text), - decoration: const InputDecoration(label: Text('Password')), - ), - const Padding(padding: EdgeInsets.symmetric(vertical: 8.0)), - FloatingActionButton.extended( - onPressed: () => _loginSubmitted( - emailController.text, passwordController.text), - label: const Text('Login')) - ], + ), ), ), ), ), - ); + ]); } void _loginSubmitted(String email, String password) { diff --git a/pubspec.yaml b/pubspec.yaml index 8c0d179..48fc954 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -64,6 +64,7 @@ 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