import 'package:flutter/material.dart'; import 'package:pwa_ios/utils/apicall.dart'; import 'package:pwa_ios/views/interaction_module/interactionlistscreen.dart'; import 'package:pwa_ios/views/konectarpage.dart'; import 'package:pwa_ios/views/notifications.dart'; import 'package:pwa_ios/views/profile.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); } class _HomeScreenState extends State { int _selectedIndex = 0; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override void initState() { // TODO: implement initState super.initState(); // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { // init(); // }); } init() async { await ApiCall().parseInfo(); } @override Widget build(BuildContext context) { return Scaffold( bottomNavigationBar: BottomNavigationBar( type: BottomNavigationBarType.fixed, currentIndex: _selectedIndex, //backgroundColor: Color.fromARGB(255, 35, 79, 150), selectedItemColor: const Color.fromARGB(255, 35, 79, 150), unselectedItemColor: const Color.fromARGB(255, 153, 153, 163), iconSize: 40, onTap: _onItemTapped, elevation: 1, items: [ BottomNavigationBarItem( icon: SizedBox( width: 30, height: 30, child: Image.asset( "assets/images/konectar.png", ), ), label: 'Konectar', backgroundColor: const Color.fromARGB(255, 168, 170, 173)), const BottomNavigationBarItem( icon: Icon( Icons.notifications, size: 30, ), label: 'frappe', backgroundColor: Colors.blue, ), const BottomNavigationBarItem( icon: Icon( Icons.edit_document, size: 30, ), label: 'Add Record', backgroundColor: Colors.blue, ), const BottomNavigationBarItem( icon: Icon( Icons.settings, size: 30, ), label: 'Settings', backgroundColor: Color.fromARGB(255, 168, 170, 173), ), ]), body: _selectedIndex == 0 ? const MyApp() : _selectedIndex == 1 ? const NotificationsScreen() : _selectedIndex == 2 ? const InteractionListScreen() : const ProfileScreen(), ); } }