Navbar Anpassen #9
@@ -52,7 +52,7 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
|||||||
),
|
),
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
body: tabs[currentIndex],
|
body: tabs[currentIndex],
|
||||||
extendBody: true, // Enables floating effect
|
extendBody: true,
|
||||||
|
flixcoo marked this conversation as resolved
Outdated
|
|||||||
bottomNavigationBar: Padding(
|
bottomNavigationBar: Padding(
|
||||||
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8.0),
|
padding: const EdgeInsets.only(left: 12.0, right: 12.0, bottom: 8.0),
|
||||||
child: Material(
|
child: Material(
|
||||||
@@ -82,12 +82,12 @@ class _CustomNavigationBarState extends State<CustomNavigationBar>
|
|||||||
Widget _buildNavItem(IconData icon, String label, int index) {
|
Widget _buildNavItem(IconData icon, String label, int index) {
|
||||||
|
flixcoo marked this conversation as resolved
Outdated
flixcoo
commented
Ich würde das Widget entweder Auslagern (als Ich würde das Widget entweder Auslagern (als `nav_item.dart` im `widgets` Ordner) oder das `Expanded` Widget direkt in die Row setzen (nicht so geil). Wenn du das Auslagerst sparst du dir ganz viel Code hier und übergibst die Parameter einfach direkt in das Widget.
gelbeinhalb
commented
Ja stimmt. Ja stimmt.
Ich lager das dann aus.
|
|||||||
final isSelected = currentIndex == index;
|
final isSelected = currentIndex == index;
|
||||||
|
|
||||||
return Expanded( // makes each nav item occupy equal width = large horizontal hitbox
|
return Expanded(
|
||||||
|
gelbeinhalb marked this conversation as resolved
Outdated
flixcoo
commented
Chat GPT kommentare? Chat GPT kommentare?
|
|||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => onTabTapped(index),
|
onTap: () => onTabTapped(index),
|
||||||
behavior: HitTestBehavior.opaque, // ensures the entire area is tappable
|
behavior: HitTestBehavior.opaque,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 5.0), // adds comfortable tap height
|
padding: const EdgeInsets.symmetric(vertical: 5.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
Reference in New Issue
Block a user
Chat GPT Kommentar entfernen
Hab ich extra reingemacht weil ich das so unlogisch fand. Also der Code erklärt sich nicht selber finde ich