part of '../pages.dart';

class IconTabPage extends StatefulWidget {
  const IconTabPage({ Key? key }) : super(key: key);
  static const routeName = '/tabs_page/icontab_page';

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

class _IconTabPageState extends State<IconTabPage> with SingleTickerProviderStateMixin  {
  late TabController tabController;

  @override
  void initState() {
    super.initState();
    tabController = TabController(length: 4, vsync: this);
  }

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: LLSColors.PRIMARY,
        leading: InkWell(
          onTap: () {
            Navigator.of(context).pop();
          },
          child: Container(
            child: Icon(
              CupertinoIcons.back,
              color: LLSColors.WHITE,
            ),
          ),
        ),
        title: const Text(
          'Icon Tab',
          style: TextStyle(fontSize: 17),
        ),
        centerTitle: true,
      ),
      body: ListView(
        children: <Widget>[
          LLSTabBar(
            length: 4,
            controller: tabController,
            tabs: [
              Icon(
                Icons.home,
              ),
              Icon(
                Icons.music_note,
              ),
              Icon(
                Icons.games,
              ),
              Icon(
                Icons.notifications,
              ),
            ],
            indicatorColor: Colors.teal,
            labelColor: LLSColors.SUCCESS,
            labelPadding: const EdgeInsets.all(8),
            tabBarColor: LLSColors.WHITE,
            unselectedLabelColor: LLSColors.LIGHT
          ),
          Container(
            height: MediaQuery.of(context).size.height - 159,
            child: LLSTabBarView(
              controller: tabController,
              children: <Widget>[
                Center(
                  child: Icon(
                    Icons.home,
                    size: 150,
                    color: Colors.grey.withOpacity(0.44),
                  ),
                ),
                Center(
                  child: Icon(
                    Icons.music_note,
                    size: 150,
                    color: Colors.grey.withOpacity(0.44),
                  ),
                ),
                Center(
                  child: Icon(
                    Icons.games,
                    size: 150,
                    color: Colors.grey.withOpacity(0.44),
                  ),
                ),
                Center(
                  child: Icon(
                    Icons.notifications,
                    size: 150,
                    color: Colors.grey.withOpacity(0.44),
                  ),
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}