diff --git a/lib/components/main_menu.dart b/lib/components/main_menu.dart index 0a1314b..1740360 100644 --- a/lib/components/main_menu.dart +++ b/lib/components/main_menu.dart @@ -23,19 +23,6 @@ class _MainMenuState extends State { ProfileScreen(), ]; - // void _onItemTapped(int index) { - // Future.delayed(Duration(milliseconds: 100), () { - // Navigator.pushReplacement( - // context, - // MaterialPageRoute(builder: (context) => _screens[index]), - // ); - // }); - - // setState(() { - // selectedIndex = index; - // }); - // } - @override Widget build(BuildContext context) { final Size size = MediaQuery.of(context).size; @@ -44,37 +31,41 @@ class _MainMenuState extends State { return Container( color: Colors.transparent, padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 5), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.min, - children: [ - MenuButton( - label: "E-furibuddy", - icon: 'assets/icons/furrybuddy.svg', - onPress: () => _onItemTapped(context, 0), - isSelected: selectedIndex == 0, - ), - MenuButton( - label: "Koleksi", - icon: 'assets/icons/Koleksi.svg', - onPress: () => _onItemTapped(context, 1), - isSelected: selectedIndex == 1, - ), - SizedBox(width: 100), - MenuButton( - label: "Pustaka", - icon: 'assets/icons/Pustaka.svg', - onPress: () => _onItemTapped(context, 2), - isSelected: selectedIndex == 2, - ), - MenuButton( - label: "Saya", - icon: 'assets/icons/Saya.svg', - onPress: () => _onItemTapped(context, 3), - isSelected: selectedIndex == 3, - ), - ], - ), + child: _btns(context, selectedIndex), + ); + } + + Row _btns(BuildContext context, int selectedIndex) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.min, + children: [ + MenuButton( + label: "E-furibuddy", + icon: 'assets/icons/furrybuddy.svg', + onPress: () => _onItemTapped(context, 0), + isSelected: selectedIndex == 0, + ), + MenuButton( + label: "Koleksi", + icon: 'assets/icons/Koleksi.svg', + onPress: () => _onItemTapped(context, 1), + isSelected: selectedIndex == 1, + ), + SizedBox(width: 100), + MenuButton( + label: "Pustaka", + icon: 'assets/icons/Pustaka.svg', + onPress: () => _onItemTapped(context, 2), + isSelected: selectedIndex == 2, + ), + MenuButton( + label: "Saya", + icon: 'assets/icons/Saya.svg', + onPress: () => _onItemTapped(context, 3), + isSelected: selectedIndex == 3, + ), + ], ); } diff --git a/lib/screen/pustaka/list_education.dart b/lib/screen/pustaka/list_education.dart index 8c0ec45..1bf3641 100644 --- a/lib/screen/pustaka/list_education.dart +++ b/lib/screen/pustaka/list_education.dart @@ -5,12 +5,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:freekake/components/card_list.dart'; import 'package:freekake/components/collection_container%20copy.dart'; -// import 'package:freekake/components/main_menu.dart'; -// import 'package:freekake/components/topbar_container.dart'; import 'package:freekake/helpers/color_helper.dart'; import 'package:list_detail_extension/list_detail_extension.dart'; - -// import 'package:freekake/screen/pustaka/pustaka_detail_screen.dart'; import 'package:webview_flutter/webview_flutter.dart'; import 'package:flutter/foundation.dart' show kIsWeb;