import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class InsuranceApprovalsDetails extends StatefulWidget { PatiantInformtion patient; int indexInsurance; InsuranceApprovalsDetails({this.patient, this.indexInsurance}); @override _InsuranceApprovalsDetailsState createState() => _InsuranceApprovalsDetailsState( patient: patient, indexInsurance: indexInsurance); } class _InsuranceApprovalsDetailsState extends State { PatiantInformtion patient; int indexInsurance; _InsuranceApprovalsDetailsState({this.patient, this.indexInsurance}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; return BaseView( onModelReady: patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, appointmentNo: patient.appointmentNo) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( isShowAppBar: true, baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( patient, patient.patientType.toString(), patient.arrivedOn), body: SingleChildScrollView( child: Container( child: Column( children: [ Padding( padding: const EdgeInsets.all(8.0), child: Column( children: [ Row( children: [ AppText( 'Insurance', fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', ), ], ), Row( children: [ AppText( 'Approvals', fontSize: 30.0, fontWeight: FontWeight.w700, ), ], ), ], ), ), Container( margin: EdgeInsets.all(10), decoration: BoxDecoration( border: Border.all( width: 0.5, color: Colors.white, ), borderRadius: BorderRadius.all( Radius.circular(15.0), ), color: Colors.white), child: Padding( padding: const EdgeInsets.all(8.0), child: Column( children: [ Row( children: [ Texts( model.insuranceApproval[indexInsurance] .approvalDetails.status, color: model.insuranceApproval[indexInsurance] .approvalDetails.status == "Approved" ? Color(0xff359846) : Color(0xffD02127), ), ], ), Row( children: [ Texts( model.insuranceApproval[indexInsurance] .doctorName .toUpperCase(), color: Colors.black, fontSize: 18, fontWeight: FontWeight.bold, ) ], ), Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: Row( children: [ Column( children: [ Container( height: 85.0, width: 85.0, child: CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, // radius: (52) child: ClipRRect( borderRadius: BorderRadius.circular(50), child: Image.network( model .insuranceApproval[ indexInsurance] .doctorImage, fit: BoxFit.fill, width: 700, ), ), backgroundColor: Colors.transparent, ), ), ], ), Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( height: 25.0, ), Row( children: [ Texts( 'Clinic: ', color: Colors.grey[500], ), Texts( model .insuranceApproval[ indexInsurance] .clinicName, ) ], ), Row( children: [ Texts( 'Approval No: ', color: Colors.grey[500], ), Texts( model .insuranceApproval[ indexInsurance] .approvalNo .toString(), ) ], ), Row( children: [ Texts( 'Unused Count:', color: Colors.grey[500], ), Texts(model .insuranceApproval[ indexInsurance] .unUsedCount .toString()) ], ), Row( children: [ Texts( 'Company Name :', color: Colors.grey[500], ), Texts('Sample') ], ), SizedBox( height: 25.0, ), Row( children: [ Texts( 'Receipt on: ', color: Colors.grey[500], ), Texts( '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].rceiptOn), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, ), ], ), Row( children: [ Texts( 'Exp on: ', color: Colors.grey[500], ), Texts( '${DateUtils.getDayMonthYearDateFormatted(DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[indexInsurance].expiryDate), isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, ), ], ), ], ), ), ], ), ), SizedBox( height: 20.0, ), Container( child: Column( children: [ Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Container( width: MediaQuery.of(context) .size .width * 0.33, child: Texts( 'Procedure', fontWeight: FontWeight.w700, ), ), Container( width: MediaQuery.of(context) .size .width * 0.33, child: Texts( 'Status', fontWeight: FontWeight.w700, ), ), Container( width: MediaQuery.of(context) .size .width * 0.21, child: Texts( 'Usage Status', fontWeight: FontWeight.w700, ), ) ], ), ), Divider( color: Colors.black, ), Padding( padding: const EdgeInsets.symmetric( horizontal: 8.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( height: MediaQuery.of(context) .size .height * 0.15, //130.0, width: MediaQuery.of(context) .size .width * 0.33, child: Texts(model .insuranceApproval[ indexInsurance] .approvalDetails .procedureName), ), Container( height: MediaQuery.of(context) .size .height * 0.15, width: MediaQuery.of(context) .size .width * 0.33, child: Texts(model .insuranceApproval[ indexInsurance] .approvalDetails .status), ), Container( height: MediaQuery.of(context) .size .height * 0.15, width: MediaQuery.of(context) .size .width * 0.21, child: Texts(model .insuranceApproval[ indexInsurance] .approvalDetails .isInvoicedDesc), ), ], ), ), Divider( color: Colors.black45, ), ], ), ), ], ), ), ), ], ), ), )), ); } }