Files
flutter_tank_web_app/lib/widgets/my_signin_widget.dart
2026-01-23 07:33:20 +01:00

147 lines
4.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart' show GoogleFonts;
import '../controller/signin_controller.dart';
class MySigninWidget extends StatelessWidget {
final void Function()? onButtonPressed;
final void Function()? logInOnTab;
final SigninController signCtrl;
const MySigninWidget({
super.key,
this.onButtonPressed,
this.logInOnTab,
required this.signCtrl,
});
@override
Widget build(BuildContext context) {
final googleFont = GoogleFonts.righteous().fontFamily;
return Column(
children: [
Stack(
children: [
// Umriss (Outline)
Text(
"Signin Page",
style: TextStyle(
fontSize: 44,
fontFamily: googleFont,
fontStyle: FontStyle.normal,
letterSpacing: 5.0,
foreground: Paint()
..style = PaintingStyle.stroke
..strokeWidth = 5
..color = Colors.blue.shade900,
),
),
// Füllung
Text(
"Signin Page",
style: TextStyle(
fontSize: 44,
fontFamily: googleFont,
fontStyle: FontStyle.normal,
color: Colors.orange.shade300,
letterSpacing: 5.0,
),
),
],
),
SizedBox(height: 20),
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.orange.shade400, width: 8),
borderRadius: BorderRadius.circular(30),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: Image.asset(
'assets/images/guru01.png',
width: 400,
height: 400,
),
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50.0),
child: TextField(
controller: signCtrl.userNameController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Username',
),
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50.0),
child: TextField(
controller: signCtrl.emailController,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Email',
),
),
),
SizedBox(height: 20),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50.0),
child: TextField(
obscureText: true,
controller: signCtrl.passwordController,
keyboardType: TextInputType.visiblePassword,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Password',
),
),
),
SizedBox(height: 30),
ElevatedButton(
style: ButtonStyle(
backgroundColor: WidgetStatePropertyAll<Color>(
Colors.orange.shade500,
),
foregroundColor: WidgetStatePropertyAll<Color>(
Colors.blue.shade900,
),
minimumSize: WidgetStatePropertyAll<Size>(Size(430, 60)),
),
onPressed: onButtonPressed,
child: Text(
'Register',
style: TextStyle(fontSize: 34, fontFamily: googleFont),
),
),
SizedBox(height: 10),
RichText(
text: TextSpan(
style: TextStyle(fontSize: 16, color: Colors.black),
children: [
TextSpan(text: 'Zum login '),
WidgetSpan(
child: GestureDetector(
onTap: logInOnTab,
child: Text(
'Log in',
style: TextStyle(
fontSize: 16,
color: Colors.blue.shade700,
decoration: TextDecoration.underline,
),
),
),
),
TextSpan(text: ' clicken!!'),
],
),
),
],
);
}
}