@ -38,7 +38,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data ;
final GlobalKey < ScaffoldState > _scaffoldState = GlobalKey ( ) ;
final RefreshController _refreshController = RefreshController ( initialRefresh: false ) ;
final RefreshController _refreshController =
RefreshController ( initialRefresh: false ) ;
int currentIndex = 0 ;
@ -106,7 +107,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState . currentState ! . openDrawer ( ) ;
} ) ;
} ) ,
Image . asset ( " assets/images/logos/main_mohemm_logo.png " , width: 134 , height: 28 ) . expanded ,
Image . asset ( " assets/images/logos/main_mohemm_logo.png " ,
width: 134 , height: 28 )
. expanded ,
SizedBox (
width: 36 ,
height: 36 ,
@ -119,7 +122,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
top: 0 ,
child: Container (
padding: const EdgeInsets . only ( left: 5 , right: 5 ) ,
decoration: BoxDecoration ( color: MyColors . redColor , borderRadius: BorderRadius . circular ( 17 ) ) ,
decoration: BoxDecoration (
color: MyColors . redColor ,
borderRadius: BorderRadius . circular ( 17 ) ) ,
child: " 3 " . toText12 ( color: Colors . white ) ,
) ,
)
@ -134,7 +139,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: SmartRefresher (
enablePullDown: true ,
enablePullUp: false ,
header: const MaterialClassicHeader ( color: MyColors . gradiantEndColor , ) ,
header: const MaterialClassicHeader (
color: MyColors . gradiantEndColor ,
) ,
controller: _refreshController ,
onRefresh: _onRefresh ,
child: SingleChildScrollView (
@ -143,8 +150,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
LocaleKeys . goodMorning . tr ( ) . toText14 ( color: MyColors . grey77Color ) ,
( AppState ( ) . memberInformationList ! . eMPLOYEENAME ? ? " " ) . toText24 ( isBold: true ) ,
LocaleKeys . goodMorning
. tr ( )
. toText14 ( color: MyColors . grey77Color ) ,
( AppState ( ) . memberInformationList ! . eMPLOYEENAME ? ? " " )
. toText24 ( isBold: true ) ,
16. height ,
Row (
children: [
@ -154,99 +164,210 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Consumer < DashboardProviderModel > (
builder: ( context , model , child ) {
return ( model . isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer ( )
: Container (
decoration: BoxDecoration (
borderRadius: BorderRadius . circular ( 15 ) ,
gradient: const LinearGradient ( transform: GradientRotation ( . 46 ) , begin: Alignment . topRight , end: Alignment . bottomLeft , colors: [
MyColors . gradiantEndColor ,
MyColors . gradiantStartColor ,
] ) ,
) ,
child: Stack (
alignment: Alignment . center ,
children: [
if ( model . isTimeRemainingInSeconds = = 0 ) SvgPicture . asset ( " assets/images/thumb.svg " ) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Expanded (
child: Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
? GetAttendanceTrackingShimmer ( )
: Container (
decoration: BoxDecoration (
borderRadius:
BorderRadius . circular ( 15 ) ,
gradient:
const LinearGradient (
transform:
GradientRotation (
. 46 ) ,
begin: Alignment
. topRight ,
end: Alignment
. bottomLeft ,
colors: [
MyColors
. gradiantEndColor ,
MyColors
. gradiantStartColor ,
] ) ,
) ,
child: Stack (
alignment: Alignment . center ,
children: [
LocaleKeys . markAttendance . tr ( ) . toText14 ( color: Colors . white , isBold: true ) ,
if ( model . isTimeRemainingInSeconds = = 0 ) " 01-02-2022 " . toText12 ( color: Colors . white ) ,
if ( model . isTimeRemainingInSeconds ! = 0 )
Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
9. height ,
CountdownTimer (
endTime: model . endTime ,
onEnd: null ,
endWidget: " 00:00:00 " . toText14 ( color: Colors . white , isBold: true ) ,
textStyle: TextStyle ( color: Colors . white , fontSize: 14 , letterSpacing: - 0.48 , fontWeight: FontWeight . bold ) ,
) ,
LocaleKeys . timeLeftToday . tr ( ) . toText12 ( color: Colors . white ) ,
9. height ,
ClipRRect (
borderRadius: BorderRadius . all (
Radius . circular ( 20 ) ,
) ,
child: LinearProgressIndicator (
value: model . progress ,
minHeight: 8 ,
valueColor: const AlwaysStoppedAnimation < Color > ( Colors . white ) ,
backgroundColor: const Color ( 0xff196D73 ) ,
) ,
) ,
] ,
) ,
] ,
) . paddingOnly ( top: 12 , right: 15 , left: 12 ) ,
) ,
Row (
children: [
Expanded (
child: Column (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
if ( model
. isTimeRemainingInSeconds = =
0 )
SvgPicture . asset (
" assets/images/thumb.svg " ) ,
Column (
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
LocaleKeys . checkIn . tr ( ) . toText12 ( color: Colors . white ) ,
( model . attendanceTracking ! . pSwipeIn = = null ? " --:-- " : model . attendanceTracking ! . pSwipeIn )
. toString ( )
. toText14 ( color: Colors . white , isBold: true ) ,
4. height ,
Expanded (
child: Column (
mainAxisSize:
MainAxisSize
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
LocaleKeys
. markAttendance
. tr ( )
. toText14 (
color: Colors
. white ,
isBold:
true ) ,
if ( model
. isTimeRemainingInSeconds = =
0 )
" 01-02-2022 " . toText12 (
color: Colors
. white ) ,
if ( model
. isTimeRemainingInSeconds ! =
0 )
Column (
mainAxisSize:
MainAxisSize
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
9. height ,
CountdownTimer (
endTime: model
. endTime ,
onEnd:
null ,
endWidget: " 00:00:00 " . toText14 (
color: Colors
. white ,
isBold:
true ) ,
textStyle: TextStyle (
color: Colors
. white ,
fontSize:
14 ,
letterSpacing:
- 0.48 ,
fontWeight:
FontWeight . bold ) ,
) ,
LocaleKeys
. timeLeftToday
. tr ( )
. toText12 (
color:
Colors . white ) ,
9. height ,
ClipRRect (
borderRadius:
BorderRadius
. all (
Radius . circular (
20 ) ,
) ,
child:
LinearProgressIndicator (
value: model
. progress ,
minHeight:
8 ,
valueColor:
const AlwaysStoppedAnimation < Color > ( Colors . white ) ,
backgroundColor:
const Color ( 0xff196D73 ) ,
) ,
) ,
] ,
) ,
] ,
) . paddingOnly (
top: 12 ,
right: 15 ,
left: 12 ) ,
) ,
Row (
children: [
Expanded (
child: Column (
mainAxisSize:
MainAxisSize
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
LocaleKeys
. checkIn
. tr ( )
. toText12 (
color:
Colors . white ) ,
( model . attendanceTracking ! . pSwipeIn = =
null
? " --:-- "
: model
. attendanceTracking !
. pSwipeIn )
. toString ( )
. toText14 (
color: Colors
. white ,
isBold:
true ) ,
4. height ,
] ,
) . paddingOnly (
left: 12 ) ,
) ,
Container (
width: 45 ,
height: 45 ,
padding:
const EdgeInsets
. only (
left: 14 ,
right:
14 ) ,
decoration:
const BoxDecoration (
color: Color (
0xff259EA4 ) ,
borderRadius:
BorderRadius
. only (
bottomRight: Radius
. circular (
15 ) ,
) ,
) ,
child: SvgPicture . asset (
model . isTimeRemainingInSeconds = =
0
? " assets/images/play.svg "
: " assets/images/stop.svg " ) ,
) . onPress ( ( ) {
showMyBottomSheet (
context ,
child:
MarkAttendanceWidget (
model ) ) ;
} ) ,
] ,
) ,
] ,
) . paddingOnly ( left: 12 ) ,
) ,
Container (
width: 45 ,
height: 45 ,
padding: const EdgeInsets . only ( left: 14 , right: 14 ) ,
decoration: const BoxDecoration (
color: Color ( 0xff259EA4 ) ,
borderRadius: BorderRadius . only (
bottomRight: Radius . circular ( 15 ) ,
) ,
) ,
child: SvgPicture . asset ( model . isTimeRemainingInSeconds = = 0 ? " assets/images/play.svg " : " assets/images/stop.svg " ) ,
) . onPress ( ( ) {
showMyBottomSheet ( context , child: MarkAttendanceWidget ( model ) ) ;
} ) ,
] ,
) ,
] ,
) ,
] ,
) ,
) . onPress (
( ) {
Navigator . pushNamed ( context , AppRoutes . todayAttendance ) ;
} ,
) )
] ,
) ,
) . onPress (
( ) {
Navigator . pushNamed (
context ,
AppRoutes
. todayAttendance ) ;
} ,
) )
. animatedSwither ( ) ;
} ,
) ,
@ -267,8 +388,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets . only ( top: 31 ) ,
decoration: BoxDecoration (
color: Colors . white ,
borderRadius: const BorderRadius . only ( topRight: Radius . circular ( 50 ) , topLeft: Radius . circular ( 50 ) ) ,
border: Border . all ( color: MyColors . lightGreyEDColor , width: 1 ) ,
borderRadius: const BorderRadius . only (
topRight: Radius . circular ( 50 ) ,
topLeft: Radius . circular ( 50 ) ) ,
border: Border . all (
color: MyColors . lightGreyEDColor , width: 1 ) ,
) ,
child: Column (
mainAxisSize: MainAxisSize . min ,
@ -284,22 +408,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
LocaleKeys . offers . tr ( ) . toText12 ( ) ,
Row (
children: [
LocaleKeys . discounts . tr ( ) . toText24 ( isBold: true ) ,
LocaleKeys . discounts
. tr ( )
. toText24 ( isBold: true ) ,
6. width ,
Container (
padding: const EdgeInsets . only ( left: 8 , right: 8 ) ,
padding: const EdgeInsets . only (
left: 8 , right: 8 ) ,
decoration: BoxDecoration (
color: MyColors . yellowColor ,
borderRadius: BorderRadius . circular ( 10 ) ,
borderRadius:
BorderRadius . circular ( 10 ) ,
) ,
child: LocaleKeys . newString . tr ( ) . toText10 ( isBold: true ) ) ,
child: LocaleKeys . newString
. tr ( )
. toText10 ( isBold: true ) ) ,
] ,
) ,
] ,
) ,
) ,
LocaleKeys . viewAllOffers . tr ( ) . toText12 ( isUnderLine: true ) . onPress ( ( ) {
Navigator . pushNamed ( context , AppRoutes . offersAndDiscounts ) ;
LocaleKeys . viewAllOffers
. tr ( )
. toText12 ( isUnderLine: true )
. onPress ( ( ) {
Navigator . pushNamed (
context , AppRoutes . offersAndDiscounts ) ;
} )
] ,
) . paddingOnly ( left: 21 , right: 21 ) ,
@ -310,53 +444,86 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView . separated (
shrinkWrap: true ,
physics: const BouncingScrollPhysics ( ) ,
padding: const EdgeInsets . only ( left: 21 , right: 21 , top: 13 ) ,
padding: const EdgeInsets . only (
left: 21 , right: 21 , top: 13 ) ,
scrollDirection: Axis . horizontal ,
itemBuilder: ( cxt , index ) {
return model . isOffersLoading
? const OffersShimmerWidget ( )
: InkWell (
onTap: ( ) {
navigateToDetails ( data . getOffersList [ index ] ) ;
} ,
child: SizedBox (
width: 73 ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . center ,
children: [
Container (
onTap: ( ) {
navigateToDetails (
data . getOffersList [ index ] ) ;
} ,
child: SizedBox (
width: 73 ,
height: 73 ,
decoration: BoxDecoration (
borderRadius: const BorderRadius . all (
Radius . circular ( 100 ) ,
) ,
border: Border . all ( color: MyColors . lightGreyE3Color , width: 1 ) ,
) ,
child: ClipRRect (
borderRadius: const BorderRadius . all (
Radius . circular ( 50 ) ,
) ,
child: Hero (
tag: " ItemImage " + data . getOffersList [ index ] . rowID ! ,
transitionOnUserGestures: true ,
child: Image . network (
data . getOffersList [ index ] . bannerImage ! ,
fit: BoxFit . contain ,
child: Column (
crossAxisAlignment:
CrossAxisAlignment . center ,
children: [
Container (
width: 73 ,
height: 73 ,
decoration: BoxDecoration (
borderRadius:
const BorderRadius
. all (
Radius . circular ( 100 ) ,
) ,
border: Border . all (
color: MyColors
. lightGreyE3Color ,
width: 1 ) ,
) ,
child: ClipRRect (
borderRadius:
const BorderRadius
. all (
Radius . circular ( 50 ) ,
) ,
child: Hero (
tag: " ItemImage " +
data
. getOffersList [
index ]
. rowID ! ,
transitionOnUserGestures:
true ,
child: Image . network (
data
. getOffersList [
index ]
. bannerImage ! ,
fit: BoxFit . contain ,
) ,
) ,
) ,
) ,
) ,
4. height ,
Expanded (
child: AppState ( )
. isArabic ( context )
? data
. getOffersList [
index ]
. titleAR !
. toText12 (
isCenter:
true ,
maxLine: 1 )
: data
. getOffersList [
index ]
. title !
. toText12 (
isCenter:
true ,
maxLine: 1 ) ,
) ,
] ,
) ,
) ,
4. height ,
Expanded (
child: AppState ( ) . isArabic ( context )
? data . getOffersList [ index ] . titleAR ! . toText12 ( isCenter: true , maxLine: 1 )
: data . getOffersList [ index ] . title ! . toText12 ( isCenter: true , maxLine: 1 ) ,
) ,
] ,
) ,
) ,
) ;
) ;
} ,
separatorBuilder: ( cxt , index ) = > 8. width ,
itemCount: 6 ) ,
@ -383,14 +550,18 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem (
icon: SvgPicture . asset (
" assets/icons/home.svg " ,
color: currentIndex = = 0 ? MyColors . grey3AColor : MyColors . grey98Color ,
color: currentIndex = = 0
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . home . tr ( ) ,
) ,
BottomNavigationBarItem (
icon: SvgPicture . asset (
" assets/icons/create_req.svg " ,
color: currentIndex = = 1 ? MyColors . grey3AColor : MyColors . grey98Color ,
color: currentIndex = = 1
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . createRequest . tr ( ) ,
) ,
@ -400,7 +571,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: [
SvgPicture . asset (
" assets/icons/work_list.svg " ,
color: currentIndex = = 2 ? MyColors . grey3AColor : MyColors . grey98Color ,
color: currentIndex = = 2
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
Consumer < DashboardProviderModel > (
builder: ( cxt , data , child ) {
@ -413,8 +586,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Container (
padding: const EdgeInsets . only ( left: 4 , right: 4 ) ,
alignment: Alignment . center ,
decoration: BoxDecoration ( color: MyColors . redColor , borderRadius: BorderRadius . circular ( 17 ) ) ,
child: data . workListCounter . toString ( ) . toText10 ( color: Colors . white ) ,
decoration: BoxDecoration (
color: MyColors . redColor ,
borderRadius: BorderRadius . circular ( 17 ) ) ,
child: data . workListCounter
. toString ( )
. toText10 ( color: Colors . white ) ,
) ,
) ;
} ,
@ -426,19 +603,29 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem (
icon: SvgPicture . asset (
" assets/icons/item_for_sale.svg " ,
color: currentIndex = = 3 ? MyColors . grey3AColor : MyColors . grey98Color ,
color: currentIndex = = 3
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . itemsForSale . tr ( ) ,
) ,
] ,
currentIndex: currentIndex ,
selectedLabelStyle: const TextStyle ( fontSize: 10 , color: MyColors . grey3AColor , fontWeight: FontWeight . w600 ) ,
unselectedLabelStyle: const TextStyle ( fontSize: 10 , color: MyColors . grey98Color , fontWeight: FontWeight . w600 ) ,
selectedLabelStyle: const TextStyle (
fontSize: 10 ,
color: MyColors . grey3AColor ,
fontWeight: FontWeight . w600 ) ,
unselectedLabelStyle: const TextStyle (
fontSize: 10 ,
color: MyColors . grey98Color ,
fontWeight: FontWeight . w600 ) ,
type: BottomNavigationBarType . fixed ,
selectedItemColor: MyColors . grey3AColor ,
backgroundColor: MyColors . backgroundColor ,
selectedIconTheme: const IconThemeData ( color: MyColors . grey3AColor , size: 28 ) ,
unselectedIconTheme: const IconThemeData ( color: MyColors . grey98Color , size: 28 ) ,
selectedIconTheme:
const IconThemeData ( color: MyColors . grey3AColor , size: 28 ) ,
unselectedIconTheme:
const IconThemeData ( color: MyColors . grey98Color , size: 28 ) ,
onTap: ( int index ) {
if ( index = = 1 ) {
Navigator . pushNamed ( context , AppRoutes . mowadhafhi ) ;
@ -469,6 +656,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
} ) ;
Navigator . pushNamed ( context , AppRoutes . offersAndDiscountsDetails , arguments: getOffersDetailList ) ;
Navigator . pushNamed ( context , AppRoutes . offersAndDiscountsDetails ,
arguments: getOffersDetailList ) ;
}
}