@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_countdown_timer/flutter_countdown_timer.dart ' ;
import ' package:flutter_countdown_timer/flutter_countdown_timer.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:mohem_flutter_app/api/dashboard_api_client.dart ' ;
import ' package:mohem_flutter_app/app_state/app_state.dart ' ;
import ' package:mohem_flutter_app/app_state/app_state.dart ' ;
import ' package:mohem_flutter_app/classes/colors.dart ' ;
import ' package:mohem_flutter_app/classes/colors.dart ' ;
import ' package:mohem_flutter_app/classes/utils.dart ' ;
import ' package:mohem_flutter_app/classes/utils.dart ' ;
@ -12,13 +13,17 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import ' package:mohem_flutter_app/extensions/string_extensions.dart ' ;
import ' package:mohem_flutter_app/extensions/string_extensions.dart ' ;
import ' package:mohem_flutter_app/extensions/widget_extensions.dart ' ;
import ' package:mohem_flutter_app/extensions/widget_extensions.dart ' ;
import ' package:mohem_flutter_app/generated/locale_keys.g.dart ' ;
import ' package:mohem_flutter_app/generated/locale_keys.g.dart ' ;
import ' package:mohem_flutter_app/models/itg/itg_response_model.dart ' ;
import ' package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart ' ;
import ' package:mohem_flutter_app/models/offers_and_discounts/get_offers_list.dart ' ;
import ' package:mohem_flutter_app/provider/dashboard_provider_model.dart ' ;
import ' package:mohem_flutter_app/provider/dashboard_provider_model.dart ' ;
import ' package:mohem_flutter_app/ui/dialogs/success_dialog.dart ' ;
import ' package:mohem_flutter_app/ui/landing/itg/video_page.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/app_drawer.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/app_drawer.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/menus_widget.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/menus_widget.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/services_widget.dart ' ;
import ' package:mohem_flutter_app/ui/landing/widget/services_widget.dart ' ;
import ' package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart ' ;
import ' package:mohem_flutter_app/ui/marathon/widgets/marathon_banner.dart ' ;
import ' package:mohem_flutter_app/widgets/bottom_sheet.dart ' ;
import ' package:mohem_flutter_app/widgets/bottom_sheet.dart ' ;
import ' package:mohem_flutter_app/widgets/dialogs/dialogs.dart ' ;
import ' package:mohem_flutter_app/widgets/mark_attendance_widget.dart ' ;
import ' package:mohem_flutter_app/widgets/mark_attendance_widget.dart ' ;
import ' package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart ' ;
import ' package:mohem_flutter_app/widgets/shimmer/dashboard_shimmer_widget.dart ' ;
import ' package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart ' ;
import ' package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart ' ;
@ -38,8 +43,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
late DashboardProviderModel data ;
late DashboardProviderModel data ;
final GlobalKey < ScaffoldState > _scaffoldState = GlobalKey ( ) ;
final GlobalKey < ScaffoldState > _scaffoldState = GlobalKey ( ) ;
final RefreshController _refreshController =
final RefreshController _refreshController = RefreshController ( initialRefresh: false ) ;
RefreshController ( initialRefresh: false ) ;
int currentIndex = 0 ;
int currentIndex = 0 ;
@ -59,6 +63,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
void _onRefresh ( ) async {
void _onRefresh ( ) async {
data . initProvider ( ) ;
data . initProvider ( ) ;
/ / data . getITGNotification ( ) . then ( ( value ) {
/ / print ( " --------------------detail_1----------------- " ) ;
/ / print ( value ! . result ! . data ! . notificationMasterId ) ;
/ / print ( value . result ! . data ! . notificationTitle ) ;
/ / } ) ;
data . fetchListMenu ( ) ;
data . fetchListMenu ( ) ;
data . fetchAttendanceTracking ( context ) ;
data . fetchAttendanceTracking ( context ) ;
data . fetchWorkListCounter ( context ) ;
data . fetchWorkListCounter ( context ) ;
@ -73,6 +82,44 @@ class _DashboardScreenState extends State<DashboardScreen> {
Widget build ( BuildContext context ) {
Widget build ( BuildContext context ) {
return Scaffold (
return Scaffold (
key: _scaffoldState ,
key: _scaffoldState ,
/ / appBar: AppBar (
/ / actions: [
/ / IconButton (
/ / onPressed: ( ) {
/ / data . getITGNotification ( ) . then ( ( value ) {
/ / print ( " --------------------detail_1----------------- " ) ;
/ / if ( value ! . result ! . data ! = null ) {
/ / print ( value . result ! . data ! . notificationMasterId ) ;
/ / print ( value . result ! . data ! . notificationType ) ;
/ / if ( value . result ! . data ! . notificationType = = " Survey " ) {
/ / Navigator . pushNamed ( context , AppRoutes . survey , arguments: value . result ! . data ) ;
/ / } else {
/ / DashboardApiClient ( ) . getAdvertisementDetail ( value . result ! . data ! . notificationMasterId ? ? " " ) . then (
/ / ( value ) {
/ / if ( value ! . mohemmItgResponseItem ! . statusCode = = 200 ) {
/ / if ( value . mohemmItgResponseItem ! . result ! . data ! = null ) {
/ / String ? image64 = value . mohemmItgResponseItem ! . result ! . data ! . advertisement ! . viewAttachFileColl ! . first . base64String ;
/ / print ( image64 ) ;
/ / var sp = image64 ! . split ( " base64, " ) ;
/ / Navigator . push (
/ / context ,
/ / MaterialPageRoute (
/ / builder: ( context ) = > MovieTheaterBody (
/ / encodedBytes: sp [ 1 ] ,
/ / ) ,
/ / ) ,
/ / ) ;
/ / }
/ / }
/ / } ,
/ / ) ;
/ / }
/ / }
/ / } ) ;
/ / } ,
/ / icon: Icon ( Icons . add ) )
/ / ] ,
/ / ) ,
body: Column (
body: Column (
children: [
children: [
Row (
Row (
@ -85,8 +132,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Utils . dataFromBase64String (
Utils . dataFromBase64String (
AppState ( ) . memberInformationList ! . eMPLOYEEIMAGE ? ? " " ,
AppState ( ) . memberInformationList ! . eMPLOYEEIMAGE ? ? " " ,
) ,
) ,
errorBuilder: ( BuildContext context , Object error ,
errorBuilder: ( BuildContext context , Object error , StackTrace ? stackTrace ) {
StackTrace ? stackTrace ) {
return SvgPicture . asset (
return SvgPicture . asset (
" assets/images/user.svg " ,
" assets/images/user.svg " ,
height: 34 ,
height: 34 ,
@ -109,11 +155,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
_scaffoldState . currentState ! . openDrawer ( ) ;
_scaffoldState . currentState ! . openDrawer ( ) ;
} ) ;
} ) ;
} ) ,
} ) ,
Image . asset ( " assets/images/logos/main_mohemm_logo.png " ,
Image . asset ( " assets/images/logos/main_mohemm_logo.png " , width: 134 , height: 28 ) . expanded ,
width: 134 , height: 28 )
. expanded ,
SvgPicture . asset (
SvgPicture . asset (
" assets/images/announcements.svg " ,
" assets/images/announcements.svg " ,
matchTextDirection: true ,
) . onPress ( ( ) async {
) . onPress ( ( ) async {
await Navigator . pushNamed ( context , AppRoutes . announcements ) ;
await Navigator . pushNamed ( context , AppRoutes . announcements ) ;
} )
} )
@ -134,11 +179,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column (
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
children: [
LocaleKeys . goodMorning
LocaleKeys . goodMorning . tr ( ) . toText14 ( color: MyColors . grey77Color ) ,
. tr ( )
( AppState ( ) . memberInformationList ! . eMPLOYEENAME ? ? " " ) . toText24 ( isBold: true ) ,
. toText14 ( color: MyColors . grey77Color ) ,
( AppState ( ) . memberInformationList ! . eMPLOYEENAME ? ? " " )
. toText24 ( isBold: true ) ,
16. height ,
16. height ,
Row (
Row (
children: [
children: [
@ -146,223 +188,92 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: AspectRatio (
child: AspectRatio (
aspectRatio: 159 / 159 ,
aspectRatio: 159 / 159 ,
child: Consumer < DashboardProviderModel > (
child: Consumer < DashboardProviderModel > (
builder: ( BuildContext context ,
builder: ( BuildContext context , DashboardProviderModel model , Widget ? child ) {
DashboardProviderModel model ,
Widget ? child ) {
return ( model . isAttendanceTrackingLoading
return ( model . isAttendanceTrackingLoading
? GetAttendanceTrackingShimmer ( )
? GetAttendanceTrackingShimmer ( )
: Container (
: Container (
decoration: BoxDecoration (
decoration: BoxDecoration (
borderRadius:
borderRadius: BorderRadius . circular ( 15 ) ,
BorderRadius . circular ( 15 ) ,
gradient: const LinearGradient ( transform: GradientRotation ( . 46 ) , begin: Alignment . topRight , end: Alignment . bottomLeft , colors: [
gradient:
MyColors . gradiantEndColor ,
const LinearGradient (
MyColors . gradiantStartColor ,
transform:
] ) ,
GradientRotation (
. 46 ) ,
begin: Alignment
. topRight ,
end: Alignment
. bottomLeft ,
colors: [
MyColors
. gradiantEndColor ,
MyColors
. gradiantStartColor ,
] ) ,
) ,
) ,
child: Stack (
child: Stack (
alignment: Alignment . center ,
alignment: Alignment . center ,
children: [
children: [
if ( model
if ( model . isTimeRemainingInSeconds = = 0 ) SvgPicture . asset ( " assets/images/thumb.svg " ) ,
. isTimeRemainingInSeconds = =
0 )
SvgPicture . asset (
" assets/images/thumb.svg " ) ,
Column (
Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . start ,
CrossAxisAlignment
. start ,
children: [
children: [
Expanded (
Expanded (
child: Column (
child: Column (
mainAxisSize:
mainAxisSize: MainAxisSize . min ,
MainAxisSize
crossAxisAlignment: CrossAxisAlignment . start ,
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
children: [
LocaleKeys
LocaleKeys . markAttendance . tr ( ) . toText14 ( color: Colors . white , isBold: true ) ,
. markAttendance
if ( model . isTimeRemainingInSeconds = = 0 ) DateTime . now ( ) . toString ( ) . split ( " " ) [ 0 ] . toText12 ( color: Colors . white ) ,
. tr ( )
if ( model . isTimeRemainingInSeconds ! = 0 )
. toText14 (
color: Colors
. white ,
isBold:
true ) ,
if ( model
. isTimeRemainingInSeconds = =
0 )
DateTime . now ( )
. toString ( )
. split (
" " ) [ 0 ]
. toText12 (
color: Colors
. white ) ,
if ( model
. isTimeRemainingInSeconds ! =
0 )
Column (
Column (
mainAxisSize:
mainAxisSize: MainAxisSize . min ,
MainAxisSize
crossAxisAlignment: CrossAxisAlignment . start ,
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
children: [
9. height ,
9. height ,
CountdownTimer (
CountdownTimer (
endTime: model
endTime: model . endTime ,
. endTime ,
onEnd: null ,
onEnd:
endWidget: " 00:00:00 " . toText14 ( color: Colors . white , isBold: true ) ,
null ,
textStyle: const TextStyle ( color: Colors . white , fontSize: 14 , letterSpacing: - 0.48 , fontWeight: FontWeight . bold ) ,
endWidget: " 00:00:00 " . toText14 (
color: Colors
. white ,
isBold:
true ) ,
textStyle: const TextStyle (
color: Colors
. white ,
fontSize:
14 ,
letterSpacing:
- 0.48 ,
fontWeight:
FontWeight . bold ) ,
) ,
) ,
LocaleKeys
LocaleKeys . timeLeftToday . tr ( ) . toText12 ( color: Colors . white ) ,
. timeLeftToday
. tr ( )
. toText12 (
color:
Colors . white ) ,
9. height ,
9. height ,
ClipRRect (
ClipRRect (
borderRadius: const BorderRadius
borderRadius: const BorderRadius . all ( Radius . circular ( 20 ) ) ,
. all (
child: LinearProgressIndicator (
Radius . circular (
value: model . progress ,
20 ) ) ,
minHeight: 8 ,
child:
valueColor: const AlwaysStoppedAnimation < Color > ( Colors . white ) ,
LinearProgressIndicator (
backgroundColor: const Color ( 0xff196D73 ) ,
value: model
. progress ,
minHeight:
8 ,
valueColor:
const AlwaysStoppedAnimation < Color > ( Colors . white ) ,
backgroundColor:
const Color ( 0xff196D73 ) ,
) ,
) ,
) ,
) ,
] ,
] ,
) ,
) ,
] ,
] ,
) . paddingOnly (
) . paddingOnly ( top: 12 , right: 15 , left: 12 ) ,
top: 12 ,
right: 15 ,
left: 12 ) ,
) ,
) ,
Row (
Row (
children: [
children: [
Expanded (
Expanded (
child: Column (
child: Column (
mainAxisSize:
mainAxisSize: MainAxisSize . min ,
MainAxisSize
crossAxisAlignment: CrossAxisAlignment . start ,
. min ,
crossAxisAlignment:
CrossAxisAlignment
. start ,
children: [
children: [
LocaleKeys
LocaleKeys . checkIn . tr ( ) . toText12 ( color: Colors . white ) ,
. checkIn
( model . attendanceTracking ! . pSwipeIn = = null ? " --:-- " : model . attendanceTracking ! . pSwipeIn )
. tr ( )
. toText12 (
color:
Colors . white ) ,
( model . attendanceTracking ! . pSwipeIn = =
null
? " --:-- "
: model
. attendanceTracking !
. pSwipeIn )
. toString ( )
. toString ( )
. toText14 (
. toText14 ( color: Colors . white , isBold: true ) ,
color: Colors
. white ,
isBold:
true ) ,
4. height ,
4. height ,
] ,
] ,
) . paddingOnly (
) . paddingOnly ( left: 12 , right: 12 ) ,
left: 12 ,
right: 12 ) ,
) ,
) ,
Container (
Container (
margin: EdgeInsets . only (
margin: EdgeInsets . only ( top: AppState ( ) . isArabic ( context ) ? 6 : 0 ) ,
top: AppState ( )
. isArabic (
context )
? 6
: 0 ) ,
width: 45 ,
width: 45 ,
height: 45 ,
height: 45 ,
padding:
padding: const EdgeInsets . only ( left: 14 , right: 14 ) ,
const EdgeInsets
decoration: BoxDecoration (
. only (
color: Color ( 0xff259EA4 ) ,
left: 14 ,
borderRadius: BorderRadius . only (
right:
bottomRight: AppState ( ) . isArabic ( context ) ? Radius . circular ( 0 ) : Radius . circular ( 15 ) ,
14 ) ,
bottomLeft: AppState ( ) . isArabic ( context ) ? Radius . circular ( 15 ) : Radius . circular ( 0 ) ,
decoration:
BoxDecoration (
color: Color (
0xff259EA4 ) ,
borderRadius:
BorderRadius
. only (
bottomRight: AppState ( )
. isArabic (
context )
? Radius
. circular (
0 )
: Radius
. circular (
15 ) ,
bottomLeft: AppState ( )
. isArabic (
context )
? Radius
. circular (
15 )
: Radius
. circular (
0 ) ,
) ,
) ,
) ,
) ,
child: SvgPicture . asset (
child: SvgPicture . asset ( model . isTimeRemainingInSeconds = = 0 ? " assets/images/play.svg " : " assets/images/stop.svg " ) ,
model . isTimeRemainingInSeconds = =
0
? " assets/images/play.svg "
: " assets/images/stop.svg " ) ,
) . onPress ( ( ) {
) . onPress ( ( ) {
showMyBottomSheet (
showMyBottomSheet (
context ,
context ,
child:
child: MarkAttendanceWidget ( model , isFromDashboard: true ) ,
MarkAttendanceWidget (
) ;
model ) ) ;
} ) ,
} ) ,
] ,
] ,
) ,
) ,
@ -372,10 +283,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
) ,
) ,
) . onPress (
) . onPress (
( ) {
( ) {
Navigator . pushNamed (
Navigator . pushNamed ( context , AppRoutes . todayAttendance ) ;
context ,
AppRoutes
. todayAttendance ) ;
} ,
} ,
) )
) )
. animatedSwither ( ) ;
. animatedSwither ( ) ;
@ -399,11 +307,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
padding: const EdgeInsets . only ( top: 31 ) ,
padding: const EdgeInsets . only ( top: 31 ) ,
decoration: BoxDecoration (
decoration: BoxDecoration (
color: Colors . white ,
color: Colors . white ,
borderRadius: const BorderRadius . only (
borderRadius: const BorderRadius . only ( topRight: Radius . circular ( 50 ) , topLeft: Radius . circular ( 50 ) ) ,
topRight: Radius . circular ( 50 ) ,
border: Border . all ( color: MyColors . lightGreyEDColor , width: 1 ) ,
topLeft: Radius . circular ( 50 ) ) ,
border: Border . all (
color: MyColors . lightGreyEDColor , width: 1 ) ,
) ,
) ,
child: Column (
child: Column (
mainAxisSize: MainAxisSize . min ,
mainAxisSize: MainAxisSize . min ,
@ -420,32 +325,22 @@ class _DashboardScreenState extends State<DashboardScreen> {
LocaleKeys . offers . tr ( ) . toText12 ( ) ,
LocaleKeys . offers . tr ( ) . toText12 ( ) ,
Row (
Row (
children: [
children: [
LocaleKeys . discounts
LocaleKeys . discounts . tr ( ) . toText24 ( isBold: true ) ,
. tr ( )
. toText24 ( isBold: true ) ,
6. width ,
6. width ,
Container (
Container (
padding: const EdgeInsets . only (
padding: const EdgeInsets . only ( left: 8 , right: 8 ) ,
left: 8 , right: 8 ) ,
decoration: BoxDecoration (
decoration: BoxDecoration (
color: MyColors . yellowColor ,
color: MyColors . yellowColor ,
borderRadius:
borderRadius: BorderRadius . circular ( 10 ) ,
BorderRadius . circular ( 10 ) ,
) ,
) ,
child: LocaleKeys . newString
child: LocaleKeys . newString . tr ( ) . toText10 ( isBold: true ) ) ,
. tr ( )
. toText10 ( isBold: true ) ) ,
] ,
] ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
) ,
LocaleKeys . viewAllOffers
LocaleKeys . viewAllOffers . tr ( ) . toText12 ( isUnderLine: true ) . onPress ( ( ) {
. tr ( )
Navigator . pushNamed ( context , AppRoutes . offersAndDiscounts ) ;
. toText12 ( isUnderLine: true )
. onPress ( ( ) {
Navigator . pushNamed (
context , AppRoutes . offersAndDiscounts ) ;
} )
} )
] ,
] ,
) . paddingOnly ( left: 21 , right: 21 ) ,
) . paddingOnly ( left: 21 , right: 21 ) ,
@ -456,56 +351,38 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: ListView . separated (
child: ListView . separated (
shrinkWrap: true ,
shrinkWrap: true ,
physics: const BouncingScrollPhysics ( ) ,
physics: const BouncingScrollPhysics ( ) ,
padding: const EdgeInsets . only (
padding: const EdgeInsets . only ( left: 21 , right: 21 , top: 13 ) ,
left: 21 , right: 21 , top: 13 ) ,
scrollDirection: Axis . horizontal ,
scrollDirection: Axis . horizontal ,
itemBuilder: ( BuildContext cxt , int index ) {
itemBuilder: ( BuildContext cxt , int index ) {
return model . isOffersLoading
return model . isOffersLoading
? const OffersShimmerWidget ( )
? const OffersShimmerWidget ( )
: InkWell (
: InkWell (
onTap: ( ) {
onTap: ( ) {
navigateToDetails (
navigateToDetails ( data . getOffersList [ index ] ) ;
data . getOffersList [ index ] ) ;
} ,
} ,
child: SizedBox (
child: SizedBox (
width: 73 ,
width: 73 ,
child: Column (
child: Column (
crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment . center ,
CrossAxisAlignment . center ,
children: [
children: [
Container (
Container (
width: 73 ,
width: 73 ,
height: 73 ,
height: 73 ,
decoration: BoxDecoration (
decoration: BoxDecoration (
borderRadius:
borderRadius: const BorderRadius . all (
const BorderRadius
. all (
Radius . circular ( 100 ) ,
Radius . circular ( 100 ) ,
) ,
) ,
border: Border . all (
border: Border . all ( color: MyColors . lightGreyE3Color , width: 1 ) ,
color: MyColors
. lightGreyE3Color ,
width: 1 ) ,
) ,
) ,
child: ClipRRect (
child: ClipRRect (
borderRadius:
borderRadius: const BorderRadius . all (
const BorderRadius
. all (
Radius . circular ( 50 ) ,
Radius . circular ( 50 ) ,
) ,
) ,
child: Hero (
child: Hero (
tag: " ItemImage " +
tag: " ItemImage " + data . getOffersList [ index ] . rowID ! ,
data
transitionOnUserGestures: true ,
. getOffersList [
index ]
. rowID ! ,
transitionOnUserGestures:
true ,
child: Image . network (
child: Image . network (
data
data . getOffersList [ index ] . bannerImage ! ,
. getOffersList [
index ]
. bannerImage ! ,
fit: BoxFit . contain ,
fit: BoxFit . contain ,
) ,
) ,
) ,
) ,
@ -513,33 +390,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
) ,
) ,
4. height ,
4. height ,
Expanded (
Expanded (
child: AppState ( )
child: AppState ( ) . isArabic ( context )
. isArabic ( context )
? data . getOffersList [ index ] . titleAR ! . toText12 ( isCenter: true , maxLine: 1 )
? data
: data . getOffersList [ index ] . title ! . toText12 ( isCenter: true , maxLine: 1 ) ,
. getOffersList [
index ]
. titleAR !
. toText12 (
isCenter:
true ,
maxLine: 1 )
: data
. getOffersList [
index ]
. title !
. toText12 (
isCenter:
true ,
maxLine: 1 ) ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
) ,
) ;
) ;
} ,
} ,
separatorBuilder:
separatorBuilder: ( BuildContext cxt , int index ) = > 8. width ,
( BuildContext cxt , int index ) = >
8. width ,
itemCount: 6 ) ,
itemCount: 6 ) ,
) ;
) ;
} ,
} ,
@ -564,18 +424,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem (
BottomNavigationBarItem (
icon: SvgPicture . asset (
icon: SvgPicture . asset (
" assets/icons/home.svg " ,
" assets/icons/home.svg " ,
color: currentIndex = = 0
color: currentIndex = = 0 ? MyColors . grey3AColor : MyColors . grey98Color ,
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . home . tr ( ) ,
label: LocaleKeys . home . tr ( ) ,
) ,
) ,
BottomNavigationBarItem (
BottomNavigationBarItem (
icon: SvgPicture . asset (
icon: SvgPicture . asset (
" assets/icons/create_req.svg " ,
" assets/icons/create_req.svg " ,
color: currentIndex = = 1
color: currentIndex = = 1 ? MyColors . grey3AColor : MyColors . grey98Color ,
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . createRequest . tr ( ) ,
label: LocaleKeys . createRequest . tr ( ) ,
) ,
) ,
@ -585,13 +441,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: [
children: [
SvgPicture . asset (
SvgPicture . asset (
" assets/icons/work_list.svg " ,
" assets/icons/work_list.svg " ,
color: currentIndex = = 2
color: currentIndex = = 2 ? MyColors . grey3AColor : MyColors . grey98Color ,
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
) . paddingAll ( 4 ) ,
Consumer < DashboardProviderModel > (
Consumer < DashboardProviderModel > (
builder: ( BuildContext cxt , DashboardProviderModel data ,
builder: ( BuildContext cxt , DashboardProviderModel data , Widget ? child ) {
Widget ? child ) {
if ( data . workListCounter = = 0 ) {
if ( data . workListCounter = = 0 ) {
return const SizedBox ( ) ;
return const SizedBox ( ) ;
}
}
@ -601,12 +454,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: Container (
child: Container (
padding: const EdgeInsets . only ( left: 4 , right: 4 ) ,
padding: const EdgeInsets . only ( left: 4 , right: 4 ) ,
alignment: Alignment . center ,
alignment: Alignment . center ,
decoration: BoxDecoration (
decoration: BoxDecoration ( color: MyColors . redColor , borderRadius: BorderRadius . circular ( 17 ) ) ,
color: MyColors . redColor ,
child: data . workListCounter . toString ( ) . toText10 ( color: Colors . white ) ,
borderRadius: BorderRadius . circular ( 17 ) ) ,
child: data . workListCounter
. toString ( )
. toText10 ( color: Colors . white ) ,
) ,
) ,
) ;
) ;
} ,
} ,
@ -618,38 +467,26 @@ class _DashboardScreenState extends State<DashboardScreen> {
BottomNavigationBarItem (
BottomNavigationBarItem (
icon: SvgPicture . asset (
icon: SvgPicture . asset (
" assets/icons/item_for_sale.svg " ,
" assets/icons/item_for_sale.svg " ,
color: currentIndex = = 3
color: currentIndex = = 3 ? MyColors . grey3AColor : MyColors . grey98Color ,
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . itemsForSale . tr ( ) ,
label: LocaleKeys . itemsForSale . tr ( ) ,
) ,
) ,
BottomNavigationBarItem (
BottomNavigationBarItem (
icon: SvgPicture . asset (
icon: SvgPicture . asset (
" assets/icons/chat/chat.svg " ,
" assets/icons/chat/chat.svg " ,
color: currentIndex = = 4
color: currentIndex = = 4 ? MyColors . grey3AColor : MyColors . grey98Color ,
? MyColors . grey3AColor
: MyColors . grey98Color ,
) . paddingAll ( 4 ) ,
) . paddingAll ( 4 ) ,
label: LocaleKeys . chat . tr ( ) ,
label: LocaleKeys . chat . tr ( ) ,
) ,
) ,
] ,
] ,
currentIndex: currentIndex ,
currentIndex: currentIndex ,
selectedLabelStyle: const TextStyle (
selectedLabelStyle: const TextStyle ( fontSize: 10 , color: MyColors . grey3AColor , fontWeight: FontWeight . w600 ) ,
fontSize: 10 ,
unselectedLabelStyle: const TextStyle ( fontSize: 10 , color: MyColors . grey98Color , fontWeight: FontWeight . w600 ) ,
color: MyColors . grey3AColor ,
fontWeight: FontWeight . w600 ) ,
unselectedLabelStyle: const TextStyle (
fontSize: 10 ,
color: MyColors . grey98Color ,
fontWeight: FontWeight . w600 ) ,
type: BottomNavigationBarType . fixed ,
type: BottomNavigationBarType . fixed ,
selectedItemColor: MyColors . grey3AColor ,
selectedItemColor: MyColors . grey3AColor ,
backgroundColor: MyColors . backgroundColor ,
backgroundColor: MyColors . backgroundColor ,
selectedIconTheme:
selectedIconTheme: const IconThemeData ( color: MyColors . grey3AColor , size: 28 ) ,
const IconThemeData ( color: MyColors . grey3AColor , size: 28 ) ,
unselectedIconTheme: const IconThemeData ( color: MyColors . grey98Color , size: 28 ) ,
unselectedIconTheme:
const IconThemeData ( color: MyColors . grey98Color , size: 28 ) ,
onTap: ( int index ) {
onTap: ( int index ) {
if ( index = = 1 ) {
if ( index = = 1 ) {
Navigator . pushNamed ( context , AppRoutes . mowadhafhi ) ;
Navigator . pushNamed ( context , AppRoutes . mowadhafhi ) ;
@ -682,7 +519,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
}
}
} ) ;
} ) ;
Navigator . pushNamed ( context , AppRoutes . offersAndDiscountsDetails ,
Navigator . pushNamed ( context , AppRoutes . offersAndDiscountsDetails , arguments: getOffersDetailList ) ;
arguments: getOffersDetailList ) ;
}
}
}
}