feat(App): update Finlytic Flutter app UI and blocs
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Password reset request dialog widget.
|
||||
class ForgotPasswordDialog extends StatefulWidget {
|
||||
const ForgotPasswordDialog({super.key});
|
||||
|
||||
@override
|
||||
State<ForgotPasswordDialog> createState() => _ForgotPasswordDialogState();
|
||||
}
|
||||
|
||||
class _ForgotPasswordDialogState extends State<ForgotPasswordDialog> {
|
||||
final _emailController = TextEditingController();
|
||||
bool _sent = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Passwort zurücksetzen'),
|
||||
content: _sent
|
||||
? const Text('Ein Link zum Zurücksetzen des Passworts wurde an Ihre E-Mail gesendet.')
|
||||
: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Text('Geben Sie Ihre E-Mail-Adresse ein, um einen Zurücksetzungslink zu erhalten:'),
|
||||
const SizedBox(height: 16),
|
||||
TextField(
|
||||
controller: _emailController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'E-Mail-Adresse',
|
||||
prefixIcon: Icon(Icons.email_outlined),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(_sent ? 'Schließen' : 'Abbrechen'),
|
||||
),
|
||||
if (!_sent)
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (_emailController.text.contains('@')) {
|
||||
setState(() => _sent = true);
|
||||
}
|
||||
},
|
||||
child: const Text('Link Anfordern'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user