import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../controllers/signin_controller.dart'; import '../widgets/custom_text_field.dart'; import '../widgets/primary_button.dart'; class SignInPage extends GetView { static const String namedRoute = '/signin-page'; const SignInPage({super.key}); @override Widget build(BuildContext context) { var signInCtrl = controller; return Scaffold( appBar: AppBar( title: const Text('Neuen Benutzer anlegen'), centerTitle: true, backgroundColor: Colors.deepPurple.shade700, foregroundColor: Colors.white, ), body: Container( decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [Colors.blue.shade50, Colors.purple.shade50], ), ), child: SingleChildScrollView( padding: const EdgeInsets.all(24.0), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: 32), Icon( Icons.person_add_rounded, size: 72, color: Colors.deepPurple.shade400, ), const SizedBox(height: 24), Text( 'Konto erstellen', textAlign: TextAlign.center, style: Theme.of(context).textTheme.headlineSmall?.copyWith( fontWeight: FontWeight.bold, color: Colors.deepPurple.shade700, ), ), const SizedBox(height: 32), CustomTextField( controller: signInCtrl.usernameController, label: 'Benutzername', hint: 'Benutzername eingeben', icon: Icons.person_rounded, ), const SizedBox(height: 16), CustomTextField( controller: signInCtrl.passwordController, label: 'Passwort', hint: 'Passwort eingeben', icon: Icons.lock_rounded, isPassword: true, ), const SizedBox(height: 32), buildPrimaryButton( context: context, icon: Icons.person_add_rounded, label: 'Registrieren', onPressed: () => signInCtrl.registerUser(), color: Colors.deepPurple, ), ], ), ), ), ); } }