2024-01-04 07:06:37 +00:00
|
|
|
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<HomeScreen> createState() => _HomeScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
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),
|
2024-04-08 12:00:54 +00:00
|
|
|
selectedItemColor: const Color.fromARGB(255, 35, 79, 150),
|
|
|
|
unselectedItemColor: const Color.fromARGB(255, 153, 153, 163),
|
2024-01-04 07:06:37 +00:00
|
|
|
iconSize: 40,
|
|
|
|
onTap: _onItemTapped,
|
|
|
|
elevation: 1,
|
|
|
|
items: <BottomNavigationBarItem>[
|
|
|
|
BottomNavigationBarItem(
|
2024-04-08 12:00:54 +00:00
|
|
|
icon: SizedBox(
|
2024-01-04 07:06:37 +00:00
|
|
|
width: 30,
|
|
|
|
height: 30,
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/images/konectar.png",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
label: 'Konectar',
|
2024-04-08 12:00:54 +00:00
|
|
|
backgroundColor: const Color.fromARGB(255, 168, 170, 173)),
|
|
|
|
const BottomNavigationBarItem(
|
|
|
|
icon: Icon(
|
|
|
|
Icons.notifications,
|
|
|
|
size: 30,
|
|
|
|
),
|
|
|
|
label: 'frappe',
|
|
|
|
backgroundColor: Colors.blue,
|
|
|
|
),
|
2024-01-04 07:06:37 +00:00
|
|
|
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
|
2024-04-08 12:00:54 +00:00
|
|
|
? const NotificationsScreen()
|
|
|
|
: _selectedIndex == 2
|
|
|
|
? const InteractionListScreen()
|
|
|
|
: const ProfileScreen(),
|
2024-01-04 07:06:37 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|