@ -1,24 +1,29 @@
import ' package:auto_size_text/auto_size_text.dart ' ;
import ' package:diplomaticquarterapp/config/shared_pref_kay.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/project_view_model.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.dart ' ;
import ' package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryResponse.dart ' ;
import ' package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart ' ;
import ' package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_shared_preferences.dart ' ;
import ' package:diplomaticquarterapp/uitl/app_toast.dart ' ;
import ' package:diplomaticquarterapp/uitl/date_uitl.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_svg/flutter_svg.dart ' ;
import ' package:provider/provider.dart ' ;
class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList ;
int isFirstOrLast ;
LiveCareHistoryCard ( { this . erRequestHistoryList }) ;
LiveCareHistoryCard ( { this . erRequestHistoryList , this . isFirstOrLast }) ;
@ override
_LiveCareHistoryCardState createState ( ) = > _LiveCareHistoryCardState ( ) ;
@ -40,122 +45,178 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
Widget build ( BuildContext context ) {
projectViewModel = Provider . of ( context ) ;
return Container (
margin: EdgeInsets . all ( 10.0 ) ,
child: Card (
margin: EdgeInsets . fromLTRB ( 8.0 , 0.0 , 8.0 , 8.0 ) ,
color: Colors . white ,
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 10 ) ,
margin: EdgeInsets . only ( left: 12 , right: 12 , top: widget . isFirstOrLast = = 0 ? 12 : 6 , bottom: widget . isFirstOrLast = = 1 ? 12 : 6 ) ,
decoration: BoxDecoration (
color: CustomColors . accentColor ,
borderRadius: BorderRadius . all (
Radius . circular ( 10.0 ) ,
) ,
child: Container (
width: MediaQuery . of ( context ) . size . width ,
/ / height: MediaQuery . of ( context ) . size . height * 0.22 ,
padding: EdgeInsets . all ( 10.0 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
Text ( TranslationBase . of ( context ) . requestedDate , style: TextStyle ( fontSize: 16.0 , fontWeight: FontWeight . bold ) ) ,
Container (
margin: EdgeInsets . only ( top: 0.0 ) ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceBetween ,
children: < Widget > [
Text ( DateUtil . getDayMonthYearHourMinuteDateFormatted ( DateUtil . convertStringToDate ( widget . erRequestHistoryList . arrivalTime ) ) , style: TextStyle ( fontSize: 14.0 ) ) ,
Text ( TranslationBase . of ( context ) . callDuration + " \n " + getCallTime ( widget . erRequestHistoryList . callDuration ) , textAlign: TextAlign . center , style: TextStyle ( fontSize: 14.0 , color: Colors . grey [ 600 ] ) ) ,
] ,
) ,
) ,
Container (
padding: EdgeInsets . all ( 7.0 ) ,
decoration: BoxDecoration (
shape: BoxShape . rectangle ,
borderRadius: BorderRadius . all ( Radius . circular ( 5 ) ) ,
color: Colors . green ,
) ,
margin: EdgeInsets . only ( top: 5.0 , bottom: 5.0 ) ,
child: Text ( widget . erRequestHistoryList . stringCallStatus , style: TextStyle ( fontSize: 14.0 , color: Colors . white ) ) ,
boxShadow: [
BoxShadow (
color: Color ( 0xff000000 ) . withOpacity ( . 05 ) ,
blurRadius: 27 ,
offset: Offset ( 0 , - 3 ) ,
) ,
] ,
) ,
child: Container (
margin: EdgeInsets . only ( left: projectViewModel . isArabic ? 0 : 6 , right: projectViewModel . isArabic ? 6 : 0 ) ,
padding: EdgeInsets . symmetric ( vertical: 10 , horizontal: 12 ) ,
decoration: BoxDecoration (
color: Colors . white ,
border: Border . all ( color: Colors . white , width: 1 ) ,
borderRadius: BorderRadius . only (
bottomRight: projectViewModel . isArabic ? Radius . circular ( 0 ) : Radius . circular ( 10.0 ) ,
topRight: projectViewModel . isArabic ? Radius . circular ( 0 ) : Radius . circular ( 10.0 ) ,
bottomLeft: projectViewModel . isArabic ? Radius . circular ( 10.0 ) : Radius . circular ( 0 ) ,
topLeft: projectViewModel . isArabic ? Radius . circular ( 10.0 ) : Radius . circular ( 0 ) ,
) ,
) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisSize: MainAxisSize . min ,
children: < Widget > [
Text (
widget . erRequestHistoryList . stringCallStatus = = " Completed " ? widget . erRequestHistoryList . stringCallStatus : " Pending " ,
style: TextStyle (
fontSize: 10.0 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.4 ,
color: widget . erRequestHistoryList . stringCallStatus = = " Completed " ? CustomColors . green : CustomColors . orange ,
) ,
Divider (
color: Colors . grey [ 500 ] ,
) ,
mHeight ( 12 ) ,
Text (
TranslationBase . of ( context ) . requestedDate + " : " + DateUtil . getDayMonthYearHourMinuteDateFormatted ( DateUtil . convertStringToDate ( widget . erRequestHistoryList . arrivalTime ) ) ,
style: TextStyle (
fontSize: 16.0 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.64 ,
) ,
Container (
margin: EdgeInsets . all ( 5.0 ) ,
child: Flex (
direction: Axis . horizontal ,
children: < Widget > [
Expanded (
child: InkWell (
onTap: ( ) {
openInvoice ( ) ;
} ,
child: Container (
child: Row (
children: < Widget > [
Icon ( Icons . content_paste , color: Colors . red ) ,
Container (
margin: EdgeInsets . only ( left: 10.0 ) ,
child: Text ( TranslationBase . of ( context ) . invoice , textAlign: TextAlign . center , style: TextStyle ( fontSize: 12.0 ) ) ,
) ,
mHeight ( 4 ) ,
Row (
children: < Widget > [
Text (
TranslationBase . of ( context ) . callDuration + " : " ,
style: TextStyle ( fontSize: 10.0 , fontWeight: FontWeight . w600 , letterSpacing: - 0.4 , color: CustomColors . textColor ) ,
) ,
Text (
getCallTime ( widget . erRequestHistoryList . callDuration ) ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 12.0 ,
letterSpacing: - 0.4 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
] ,
) , mHeight ( 12 ) ,
Container (
width: double . infinity ,
child: Row (
mainAxisAlignment: MainAxisAlignment . spaceEvenly ,
children: < Widget > [
Expanded (
flex: 1 ,
child: InkWell (
onTap: ( ) {
openInvoice ( ) ;
} ,
child: Container (
padding: EdgeInsets . only ( left: 12 , right: 12 , top: 6 , bottom: 6 ) ,
decoration: containerRadius ( CustomColors . devider , 100 ) ,
child: Row (
children: < Widget > [
SvgPicture . asset ( " assets/images/new/services/invoice_list.svg " , width: 18 , height: 18 , ) ,
mWidth ( 10 ) ,
Text (
TranslationBase . of ( context ) . invoice ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 11.0 ,
letterSpacing: - 0.46 ,
fontWeight: FontWeight . w600 ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ,
Expanded (
child: InkWell (
onTap: ( ) {
openComplaint ( ) ;
} ,
child: Container (
child: Row (
children: < Widget > [
Icon ( Icons . add , size: 24.0 , color: Colors . red ) ,
Container (
margin: EdgeInsets . only ( left: 10.0 ) ,
child: Text ( TranslationBase . of ( context ) . complaint , textAlign: TextAlign . center , style: TextStyle ( fontSize: 12.0 ) ) ,
) ,
mWidth ( 12 ) ,
Expanded (
flex: 1 ,
child: InkWell (
onTap: ( ) {
openComplaint ( ) ;
} ,
child: Container (
padding: EdgeInsets . only ( left: 12 , right: 12 , top: 7 , bottom: 7 ) ,
decoration: containerRadius ( CustomColors . devider , 100 ) ,
child: Row (
children: < Widget > [
SvgPicture . asset ( " assets/images/new/services/raise_comp.svg " , width: 16 , height: 16 , ) ,
mWidth ( 10 ) ,
Expanded (
child: AutoSizeText (
TranslationBase . of ( context ) . complaint ,
textAlign: TextAlign . center ,
maxLines: 1 , minFontSize: 8 ,
style: TextStyle (
fontSize: 11.0 ,
letterSpacing: - 0.46 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ,
Expanded (
child: InkWell (
onTap: ( ) {
rateLiveCareAppo ( ) ;
} ,
child: Container (
child: Row (
children: < Widget > [
Icon ( Icons . star , size: 24.0 , color: Colors . yellow [ 700 ] ) ,
Container (
width: MediaQuery . of ( context ) . size . width * 0.2 ,
margin: EdgeInsets . only ( left: 9.0 ) ,
child: Text ( TranslationBase . of ( context ) . rateDoctorAppo , overflow: TextOverflow . clip , textAlign: TextAlign . center , style: TextStyle ( fontSize: 11.0 ) ) ,
) ,
mWidth ( 12 ) ,
Expanded (
flex: 1 ,
child: InkWell (
onTap: ( ) {
rateLiveCareAppo ( ) ;
} ,
child: Container (
padding: EdgeInsets . only ( left: 12 , right: 12 , top: 6 , bottom: 6 ) ,
decoration: containerRadius ( CustomColors . devider , 100 ) ,
child: Row (
children: < Widget > [
Icon ( Icons . star , size: 18 , ) ,
mWidth ( 10 ) ,
Text (
TranslationBase . of ( context ) . rate ,
overflow: TextOverflow . clip ,
textAlign: TextAlign . center ,
style: TextStyle (
fontSize: 11.0 ,
letterSpacing: - 0.46 ,
fontWeight: FontWeight . w600 ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ,
] ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ;
}
rateLiveCareAppo ( ) {
if ( widget . erRequestHistoryList . isAppointmentHaveRating ) {
if ( widget . erRequestHistoryList . isAppointmentHaveRating ) {
AppToast . showErrorToast ( message: TranslationBase . of ( context ) . alreadyRated ) ;
} else {
}
} else { }
}
openInvoice ( ) {