import 'package:agrilink_vocpro/features/dashboard/provider/dashboard_provider.dart';
import 'package:bootstrap_icons/bootstrap_icons.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

import '../../../core/constant/app_color.dart';

class DashboardScreen extends StatelessWidget {
  const DashboardScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Consumer<DashboardProvider>(builder: (context, provider, child) {
      return Scaffold(
        body: provider.screens[provider.currentIndex],
        bottomNavigationBar: BottomNavigationBar(
          iconSize: 24,
          selectedFontSize: 12,
          selectedItemColor: AppColor.secondary,
          unselectedFontSize: 12,
          backgroundColor: Colors.white,
          type: BottomNavigationBarType.fixed,
          currentIndex: provider.currentIndex,
          onTap: provider.setCurrentIndex,
          items: const [
            BottomNavigationBarItem(
              icon: Icon(BootstrapIcons.house),
              activeIcon: Icon(BootstrapIcons.house_fill),
              label: 'Home',
            ),
            BottomNavigationBarItem(
              icon: Icon(BootstrapIcons.toggle_off),
              activeIcon: Icon(BootstrapIcons.toggle_on),
              label: 'Control',
            ),
            BottomNavigationBarItem(
              icon: Icon(BootstrapIcons.flower1),
              activeIcon: Icon(BootstrapIcons.flower1),
              label: 'Plants',
            ),
            BottomNavigationBarItem(
              icon: Icon(BootstrapIcons.gear),
              activeIcon: Icon(BootstrapIcons.gear_fill),
              label: 'Setting',
            ),
          ],
        ),
      );
    });
  }
}
