mobileApplicationsKonectarApp/lib/views/home_screen.dart

95 lines
2.7 KiB
Dart
Raw Permalink Normal View History

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),
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(
icon: SizedBox(
2024-01-04 07:06:37 +00:00
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,
),
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
? const NotificationsScreen()
: _selectedIndex == 2
? const InteractionListScreen()
: const ProfileScreen(),
2024-01-04 07:06:37 +00:00
);
}
}