bottomNavigationBar: const SizedBox(height: 70),
body: GetX<ExploreController>(
init: ExploreController(),
builder: (controller) {
return Stack(children: [
TabBarView(children: <Widget>[
DefaultTabController(
length: 4,
child: Column(children: [
Container(
decoration: BoxDecoration(
color: AllColors.whiteColor,
boxShadow: [BoxShadow(color: AllColors.greyColor.withOpacity(0.1), blurRadius: 4, offset: const Offset(5, 10))]),
child: TabBar(
onTap: (index) {
selectIndex = index;
switch (selectIndex) {
case 1:
_exploreController.geTrendingPostList(trendingPostPage);
break;
case 2:
_exploreController.getNearByPostList(nearbyPostPage);
break;
case 3:
_exploreController.getRecentPostList(recentPostPage);
break;
}
setState(() {});
},
indicatorWeight: 2,
controller: _tabController,
padding: EdgeInsets.zero,
isScrollable: false,
indicatorPadding: const EdgeInsets.only(bottom: 2),
indicatorSize: TabBarIndicatorSize.label,
automaticIndicatorColorAdjustment: false,
indicatorColor: selectIndex == 0
? AllColors.darkYellowColor
: selectIndex == 1
? AllColors.lightRedColor
: selectIndex == 2
? AllColors.greenColor
:AllColors.purpleColor,
labelStyle: const TextStyle(fontSize: 12, fontWeight: FontWeight.w600,fontFamily: FontFamily.urbanist),
labelColor: selectIndex == 0
? AllColors.darkYellowColor
: selectIndex == 1
? AllColors.lightRedColor
: selectIndex == 2
? AllColors.greenColor
: AllColors.purpleColor,
unselectedLabelColor: AllColors.greyIconColor,
tabs: [
Tab(
text: AllStrings.featured,
icon: Image.asset(ImageAssets.featuredIcon,
scale: 2, color: selectIndex == 0 ? AllColors.darkYellowColor : null)),
Tab(
text: AllStrings.trending,
icon: Image.asset(ImageAssets.trendingIcon,
scale: 2, color: selectIndex == 1 ? AllColors.lightRedColor : null)),
Tab(
text: AllStrings.nearby,
icon: Image.asset(ImageAssets.nearbyIcon, scale: 2, color: selectIndex == 2 ? AllColors.greenColor : null)),
Tab(
text: AllStrings.recent,
icon:
Image.asset(ImageAssets.recentIcon, scale: 2, color: selectIndex == 3 ? AllColors.purpleColor : null))