Feat: Fügt einen FloatingActionButton zum Hinzufügen von Konten und Transaktionen hinzu

This commit is contained in:
2025-12-22 01:26:31 +01:00
parent 721e7c4bdf
commit 0f066c67d1
2 changed files with 52 additions and 22 deletions

View File

@@ -191,7 +191,7 @@ class _SettingsState extends State<Settings> {
); );
Widget _versionNumber(final ThemeData theme) => Align( Widget _versionNumber(final ThemeData theme) => Align(
alignment: Alignment.bottomRight, alignment: Alignment.bottomLeft,
child: Text( child: Text(
'Version 0.0.0+0', 'Version 0.0.0+0',
style: theme.textTheme.bodySmall?.copyWith( style: theme.textTheme.bodySmall?.copyWith(

View File

@@ -1,5 +1,6 @@
import 'package:dropdown_search/dropdown_search.dart'; import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_expandable_fab/flutter_expandable_fab.dart';
import 'package:routemaster/routemaster.dart'; import 'package:routemaster/routemaster.dart';
/// Eine Seite, die als Container für die verschiedenen Tabs der App dient. /// Eine Seite, die als Container für die verschiedenen Tabs der App dient.
@@ -46,11 +47,13 @@ class _HomePageState extends State<HomePage> {
), ),
bottomNavigationBar: _bottomNav(tabPage), bottomNavigationBar: _bottomNav(tabPage),
floatingActionButtonLocation: ExpandableFab.location,
floatingActionButton: _floatingActionButton(),
); );
} }
Widget _bottomNav(final TabPageState tabPage) => Widget _bottomNav(final TabPageState tabPage) => BottomNavigationBar(
BottomNavigationBar(
currentIndex: tabPage.index, currentIndex: tabPage.index,
onTap: tabPage.controller.animateTo, onTap: tabPage.controller.animateTo,
items: const <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
@@ -63,25 +66,52 @@ class _HomePageState extends State<HomePage> {
], ],
); );
Widget _accountSelect() => Widget _accountSelect() => DropdownSearch<String>(
DropdownSearch<String>( items: (final String filter, final LoadProps? infiniteScrollProps) =>
items:
(final String filter, final LoadProps? infiniteScrollProps) =>
<String>['Konto 1', 'Konto 2', 'Konto 3', 'Konto 4'], <String>['Konto 1', 'Konto 2', 'Konto 3', 'Konto 4'],
selectedItem: selected, selectedItem: selected,
onChanged: (final String? value) => onChanged: (final String? value) => setState(() => selected = value!),
setState(() => selected = value!), popupProps: const PopupProps<String>.menu(
popupProps: const PopupProps<String>.menu( showSearchBox: true,
showSearchBox: true, searchFieldProps: TextFieldProps(
searchFieldProps: TextFieldProps( decoration: InputDecoration(
decoration: InputDecoration( hintText: 'Suchen...',
hintText: 'Suchen...', contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
contentPadding: EdgeInsets.symmetric(
horizontal: 12,
vertical: 8,
),
),
),
), ),
); ),
),
);
Widget _floatingActionButton() => ExpandableFab(
openButtonBuilder: RotateFloatingActionButtonBuilder(
child: const Icon(Icons.add),
),
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),
),
],
),
Row(
children: <Widget>[
Text('Neues Konto'),
SizedBox(width: 20),
FloatingActionButton.small(
heroTag: null,
onPressed: null,
child: Icon(Icons.account_balance_wallet),
),
],
),
],
);
} }