import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';

import 'bottom_nav_pharmacy_home_item.dart';
import 'bottom_nav_pharmacy_item.dart';

class BottomNavPharmacyBar extends StatefulWidget {
  final ValueChanged<int> changeIndex;
  final int index;
  BottomNavPharmacyBar({Key key, this.changeIndex, this.index})
      : super(key: key);

  @override
  _BottomNavPharmacyBarState createState() => _BottomNavPharmacyBarState();
}

class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {

  _changeIndex(int index) {
    widget.changeIndex(index);
  }

  @override
  Widget build(BuildContext context) {
    return BottomAppBar(
      elevation: 4,
      shape: CircularNotchedRectangle(),
      color: Colors.white,
      child: Padding(
        padding: EdgeInsets.symmetric(horizontal: 18),
        child: Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: [
            BottomNavHomeItem(
              icon: EvaIcons.image,
              activeIcon: EvaIcons.image,
              changeIndex: _changeIndex,
              index: widget.index,
              currentIndex: 0,
              title: TranslationBase.of(context).Alhabibapp,
            ),
            BottomNavPharmacyItem(
              icon: EvaIcons.list,
              activeIcon: EvaIcons.list,
              changeIndex: _changeIndex,
              index: widget.index,
              currentIndex: 1,
              title: TranslationBase.of(context).categorise,
            ),
            BottomNavPharmacyItem(
                icon: EvaIcons.home,
                activeIcon: EvaIcons.home,
                changeIndex: _changeIndex,
                index: widget.index,
                currentIndex: 0,
                isHome: true,
                title: TranslationBase.of(context).home),
            BottomNavPharmacyItem(
              icon: EvaIcons.person,
              activeIcon: EvaIcons.person,
              changeIndex: _changeIndex,
              index: widget.index,
              currentIndex: 2,
              title: TranslationBase.of(context).myAccount,
            ),
            BottomNavPharmacyItem(
                icon: EvaIcons.shoppingCartOutline,
                activeIcon: EvaIcons.shoppingCartOutline,
                changeIndex: _changeIndex,
                index: widget.index,
                currentIndex: 3,
                title: TranslationBase.of(context).cart)
          ],
        ),
      ),
    );
  }
}
