refactor(auth): simplify to 2 tabs and embed Buerger-Code under Google in registration
This commit is contained in:
@@ -43,7 +43,7 @@ class _AuthDialogState extends State<AuthDialog>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_tabController = TabController(length: 3, vsync: this);
|
_tabController = TabController(length: 2, vsync: this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -316,7 +316,6 @@ class _AuthDialogState extends State<AuthDialog>
|
|||||||
tabs: const [
|
tabs: const [
|
||||||
Tab(text: 'Anmelden'),
|
Tab(text: 'Anmelden'),
|
||||||
Tab(text: 'Registrieren'),
|
Tab(text: 'Registrieren'),
|
||||||
Tab(text: 'Bürger-Code'),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (_errorMessage != null) ...[
|
if (_errorMessage != null) ...[
|
||||||
@@ -433,11 +432,22 @@ class _AuthDialogState extends State<AuthDialog>
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
_buildGoogleButton(label: 'Mit Google anmelden'),
|
_buildGoogleButton(label: 'Mit Google anmelden'),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Center(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () => _tabController.animateTo(1),
|
||||||
|
child: const Text(
|
||||||
|
'Noch kein Konto? Hier registrieren oder Bürger-Code eingeben',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Tab 2: Registrierung
|
// Tab 2: Registrierung & Bürger-Code
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
padding: const EdgeInsets.only(top: 6, bottom: 12),
|
padding: const EdgeInsets.only(top: 6, bottom: 12),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -546,16 +556,25 @@ class _AuthDialogState extends State<AuthDialog>
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
_buildGoogleButton(label: 'Mit Google registrieren'),
|
_buildGoogleButton(label: 'Mit Google registrieren'),
|
||||||
|
const SizedBox(height: 18),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(child: Divider(color: Colors.grey.shade300)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
child: Text(
|
||||||
|
'ODER MIT BÜRGER-CODE',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(child: Divider(color: Colors.grey.shade300)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 14),
|
||||||
|
|
||||||
// Tab 3: Bürger-Code
|
|
||||||
SingleChildScrollView(
|
|
||||||
padding: const EdgeInsets.only(top: 6, bottom: 12),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -564,36 +583,48 @@ class _AuthDialogState extends State<AuthDialog>
|
|||||||
border: Border.all(color: Colors.blue.shade100),
|
border: Border.all(color: Colors.blue.shade100),
|
||||||
),
|
),
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Du möchtest kein persönliches E-Mail-Konto anlegen? Gib einfach den Zugangscode des Bürgerforums ein (z.B. oggau), um sofort Mängel und Ideen melden zu können.',
|
'Kein persönliches Konto gewünscht? Gib den Zugangscode des Bürgerforums ein (z.B. oggau), um sofort Mängel & Ideen melden zu können.',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13, color: Colors.black87),
|
fontSize: 12, color: Colors.black87),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 12),
|
||||||
TextField(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
controller: _codeController,
|
controller: _codeController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Bürger-Zugangscode',
|
labelText: 'Bürger-Zugangscode',
|
||||||
prefixIcon: Icon(Icons.key_outlined),
|
prefixIcon: Icon(Icons.key_outlined),
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
hintText: 'z.B. oggau',
|
hintText: 'z.B. oggau',
|
||||||
|
isDense: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _isLoading ? null : _handleCodeUnlock,
|
onPressed: _isLoading ? null : _handleCodeUnlock,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 13),
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 14, horizontal: 16),
|
||||||
|
backgroundColor: Colors.blue.shade700,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
child: const Text('Freischalten'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Center(
|
||||||
|
child: TextButton(
|
||||||
|
onPressed: () => _tabController.animateTo(0),
|
||||||
|
child: const Text(
|
||||||
|
'Bereits ein Konto? Hier anmelden',
|
||||||
|
style: TextStyle(fontSize: 12),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: _isLoading
|
|
||||||
? const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: CircularProgressIndicator(
|
|
||||||
strokeWidth: 2),
|
|
||||||
)
|
|
||||||
: const Text('Freischalten',
|
|
||||||
style: TextStyle(fontSize: 15)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user