import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'Text.dart'; class DoctorCardInsurance extends StatelessWidget { final String doctorName; final String branch; final DateTime appointmentDate; final String profileUrl; final String invoiceNO; final String orderNo; final Function onTap; final bool isPrescriptions; final String clinic; final String approvalStatus; final String patientOut; DoctorCardInsurance( {this.doctorName, this.branch, this.profileUrl, this.invoiceNO, this.onTap, this.appointmentDate, this.orderNo, this.isPrescriptions = false, this.clinic, this.approvalStatus, this.patientOut}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( width: double.maxFinite, height: 160, margin: EdgeInsets.all(10), padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.white, ), child: Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Container( height: 160, width: 5, decoration: BoxDecoration( borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10), ), color: approvalStatus == "Approved" ? Color(0xff359846) : Color(0xffD02127), ), ), Expanded( child: Container( padding: EdgeInsets.only( left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0), child: InkWell( onTap: onTap, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Texts( "$approvalStatus", color: approvalStatus == "Approved" ? Color(0xff359846) : Color(0xffD02127), ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( Radius.circular(25.0), ), color: Color(0xff2E303A)), child: Padding( padding: const EdgeInsets.all(5.0), child: Texts( '$patientOut', color: Colors.white, fontSize: 13.0, ), ), ) ], ), Row( children: [ Expanded( child: Texts( doctorName, bold: true, )), ], ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( child: LargeAvatar( name: doctorName, url: profileUrl, ), width: 55, height: 55, ), Expanded( flex: 4, child: Container( margin: EdgeInsets.all(10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (orderNo != null && !isPrescriptions) Row( children: [ Texts( 'order No:', color: Colors.grey[500], ), Texts( orderNo ?? '', ) ], ), if (invoiceNO != null && !isPrescriptions) Row( children: [ Texts( 'Invoice:', color: Colors.grey[500], ), Texts( invoiceNO, ) ], ), if (isPrescriptions) Row( children: [ Texts( 'Clinic: ', color: Colors.grey[500], ), Expanded( child: Texts( clinic, ), ) ], ), if (branch != null) Row( children: [ Texts( 'Approval No: ', color: Colors.grey[500], ), Texts( branch, ) ], ) ]), ), ), Icon( EvaIcons.eye, size: 38.0, ) ], ), ], ), ), ), ), ], ), ), ); } }