|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
import 'package:badges/badges.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
@ -16,16 +18,14 @@ class BottomNavigationItem extends StatelessWidget {
|
|
|
|
|
final String name;
|
|
|
|
|
final DashboardViewModel dashboardViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BottomNavigationItem(
|
|
|
|
|
{this.icon,
|
|
|
|
|
this.activeIcon,
|
|
|
|
|
this.changeIndex,
|
|
|
|
|
this.index,
|
|
|
|
|
this.currentIndex,
|
|
|
|
|
this.name, this.dashboardViewModel});
|
|
|
|
|
|
|
|
|
|
this.name,
|
|
|
|
|
this.dashboardViewModel});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@ -41,51 +41,62 @@ class BottomNavigationItem extends StatelessWidget {
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: AlignmentDirectional.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (currentIndex == index)
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
color: AppGlobal.appRedColor,
|
|
|
|
|
width: 100,
|
|
|
|
|
height: 3,
|
|
|
|
|
)),
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(height: 15,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child: Icon(currentIndex == index ? activeIcon : icon,
|
|
|
|
|
color: currentIndex == index
|
|
|
|
|
? Color(0xFF333C45)
|
|
|
|
|
: Theme.of(context).dividerColor,
|
|
|
|
|
size: 22.0),
|
|
|
|
|
color: AppGlobal.appTextColor, size: 22.0),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 5,),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Text(
|
|
|
|
|
name,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: currentIndex == index
|
|
|
|
|
? Theme.of(context).primaryColor
|
|
|
|
|
: Theme.of(context).dividerColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Text(name ?? "",
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
2,
|
|
|
|
|
color: AppGlobal.appTextColor,
|
|
|
|
|
fontWeight: FontWeight.w600) //#989898,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if(currentIndex == 3 && dashboardViewModel.notRepliedCount != 0)
|
|
|
|
|
Positioned(
|
|
|
|
|
right: 18.0,
|
|
|
|
|
bottom: 40.0,
|
|
|
|
|
child: Badge(
|
|
|
|
|
toAnimate: false,
|
|
|
|
|
position: BadgePosition.topEnd(),
|
|
|
|
|
shape: BadgeShape.circle,
|
|
|
|
|
badgeColor: Colors.red[800],
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
badgeContent: Container(
|
|
|
|
|
// padding: EdgeInsets.all(2.0),
|
|
|
|
|
child: Text(dashboardViewModel.notRepliedCount.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white, fontSize: 12.0)),
|
|
|
|
|
if (currentIndex == 3 &&
|
|
|
|
|
dashboardViewModel.notRepliedCount != 0)
|
|
|
|
|
Positioned(
|
|
|
|
|
right: 18.0,
|
|
|
|
|
bottom: 40.0,
|
|
|
|
|
child: Badge(
|
|
|
|
|
toAnimate: false,
|
|
|
|
|
position: BadgePosition.topEnd(),
|
|
|
|
|
shape: BadgeShape.circle,
|
|
|
|
|
badgeColor: Colors.red[800],
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
badgeContent: Container(
|
|
|
|
|
// padding: EdgeInsets.all(2.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
dashboardViewModel.notRepliedCount.toString(),
|
|
|
|
|
style:
|
|
|
|
|
TextStyle(color: Colors.white, fontSize: 12.0)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|