This commit is contained in:
Mohammed Al-Samarraie
2025-12-13 17:39:24 +03:00
parent 5cdfa102f3
commit 489a99a0a3
7 changed files with 289 additions and 268 deletions

View File

@@ -15,38 +15,36 @@ class MainPage extends StatefulWidget {
class _MainPageState extends State<MainPage> {
int _currentIndex = 0;
Widget _buildScreen() {
switch (_currentIndex) {
case 0:
return const AttendanceScreen();
case 1:
return const FinanceScreen(); // no need for scroll callback anymore
case 2:
return const HolidayScreen(); // SettingsBar is inside the screen now
default:
return const AttendanceScreen();
}
}
@override
Widget build(BuildContext context) {
final screenHeight = MediaQuery.sizeOf(context).height;
return Scaffold(
body: Stack(
children: [
/// BACKGROUND
const AppBackground(child: SizedBox()),
/// ACTIVE SCREEN (fills everything except navbar area)
/// ACTIVE SCREEN (fills entire screen - content will extend behind navbar)
///
Positioned.fill(
bottom: 100, // space for floating navbar
child: _buildScreen(),
child: IndexedStack(
index: _currentIndex,
children: [
const AttendanceScreen(),
const FinanceScreen(),
const HolidayScreen(),
],
),
),
/// FLOATING NAVBAR
/// FLOATING NAVBAR (positioned above content)
Positioned(
left: 0,
right: 0,
bottom: 20,
bottom: 0,
child: Floatingnavbar(
items: [
NavBarItem(