Feat: Fügt das Erstellen von Konten hinzu
This commit is contained in:
@@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
|
||||
import 'package:routemaster/routemaster.dart';
|
||||
|
||||
import '../Controller/account_controller.dart';
|
||||
|
||||
/// Eine Seite, die als Container für die verschiedenen Tabs der App dient.
|
||||
///
|
||||
/// Diese Seite enthält eine App-Bar mit einer Kontoauswahl sowie ein
|
||||
@@ -17,6 +19,8 @@ class HomePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> {
|
||||
final AccountController _accountController = AccountController();
|
||||
|
||||
String selected = 'Konto 1';
|
||||
|
||||
@override
|
||||
@@ -89,29 +93,42 @@ class _HomePageState extends State<HomePage> {
|
||||
type: ExpandableFabType.up,
|
||||
childrenAnimation: ExpandableFabAnimation.none,
|
||||
distance: 70,
|
||||
children: const <Widget>[
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Text('Neue Transaktion'),
|
||||
SizedBox(width: 20),
|
||||
FloatingActionButton.small(
|
||||
heroTag: null,
|
||||
onPressed: null,
|
||||
child: Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
children: <Widget>[
|
||||
_expandableButton(
|
||||
label: 'Neue Transaktion',
|
||||
icon: Icons.add,
|
||||
onPressed: () {},
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Text('Neues Konto'),
|
||||
SizedBox(width: 20),
|
||||
FloatingActionButton.small(
|
||||
heroTag: null,
|
||||
onPressed: null,
|
||||
child: Icon(Icons.account_balance_wallet),
|
||||
),
|
||||
],
|
||||
_expandableButton(
|
||||
label: 'Neues Konto',
|
||||
icon: Icons.account_balance_wallet,
|
||||
onPressed: () {
|
||||
_accountController.newAccountHandler(context);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Widget _expandableButton({
|
||||
required final String label,
|
||||
required final IconData icon,
|
||||
required final VoidCallback onPressed,
|
||||
}) => GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(8)),
|
||||
child: Text(label),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
FloatingActionButton.small(
|
||||
heroTag: null,
|
||||
onPressed: onPressed,
|
||||
child: Icon(icon),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user