import 'package:flutter/material.dart';
import 'package:netrain_flutter_app/common/AppColors.dart';
import 'package:netrain_flutter_app/common/Images.dart';
import 'package:netrain_flutter_app/laishanqi/netrain/maintab/DoctorHomePage.dart';

class doctorMainPage extends StatefulWidget {
  @override
  _doctorMainPageState createState() {
    return _doctorMainPageState();
  }
}

class _doctorMainPageState extends State<doctorMainPage> {
  var currentIndex = 0;

  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      bottomNavigationBar: Container(
        height: 50,
        child: BottomNavigationBar(
          backgroundColor: Colors.white,
          selectedItemColor: AppColors.mainColor,
          unselectedItemColor: AppColors.hintText,
          selectedFontSize: 10,
          unselectedFontSize: 10,
          currentIndex: currentIndex,
          onTap: (index) {
            setState(() {
              currentIndex = index;
            });
          },
          items: [
            BottomNavigationBarItem(
                activeIcon: Image.asset(Images.tab_home_selected,width: 20,height: 20,),
                icon: Image.asset(Images.tab_home_normal,width: 20,height: 20),
                label: "首页"),
            BottomNavigationBarItem(
                activeIcon: Image.asset(Images.tab_patient_selected,width: 20,height: 20),
                icon: Image.asset(Images.tab_patient_normal,width: 20,height: 20),
                label: "患者"),
            BottomNavigationBarItem(
                activeIcon: Image.asset(Images.tab_my_selected,width: 20,height: 20),
                icon: Image.asset(Images.tab_my_normal,width: 20,height: 20),
                label: "我的"),
          ],
        ),
      ),
      body: showBody(),
    );
  }

  Widget showBody() {
    if (currentIndex == 0) {
      return DoctorHomePage();
    } else if (currentIndex == 1) {
      return Text("222");
    } else {
      return Text("33333");
    }
  }
}
