Ref: Extrahiert den accountSelect in eine eigene Funktion
This commit is contained in:
@@ -28,26 +28,7 @@ class _HomePageState extends State<HomePage> {
|
||||
titleSpacing: 0,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: DropdownSearch<String>(
|
||||
items:
|
||||
(final String filter, final LoadProps? infiniteScrollProps) =>
|
||||
<String>['Konto 1', 'Konto 2', 'Konto 3', 'Konto 4'],
|
||||
selectedItem: selected,
|
||||
onChanged: (final String? value) =>
|
||||
setState(() => selected = value!),
|
||||
popupProps: const PopupProps<String>.menu(
|
||||
showSearchBox: true,
|
||||
searchFieldProps: TextFieldProps(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Suchen...',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: _accountSelect(),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -64,11 +45,12 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
),
|
||||
|
||||
bottomNavigationBar: _buildBottomNav(tabPage),
|
||||
bottomNavigationBar: _bottomNav(tabPage),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomNav(final TabPageState tabPage) => BottomNavigationBar(
|
||||
Widget _bottomNav(final TabPageState tabPage) =>
|
||||
BottomNavigationBar(
|
||||
currentIndex: tabPage.index,
|
||||
onTap: tabPage.controller.animateTo,
|
||||
items: const <BottomNavigationBarItem>[
|
||||
@@ -80,4 +62,26 @@ class _HomePageState extends State<HomePage> {
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Widget _accountSelect() =>
|
||||
DropdownSearch<String>(
|
||||
items:
|
||||
(final String filter, final LoadProps? infiniteScrollProps) =>
|
||||
<String>['Konto 1', 'Konto 2', 'Konto 3', 'Konto 4'],
|
||||
selectedItem: selected,
|
||||
onChanged: (final String? value) =>
|
||||
setState(() => selected = value!),
|
||||
popupProps: const PopupProps<String>.menu(
|
||||
showSearchBox: true,
|
||||
searchFieldProps: TextFieldProps(
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Suchen...',
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user