import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class EROnlineCheckInPaymentDetails extends StatefulWidget { const EROnlineCheckInPaymentDetails(); @override State createState() => _EROnlineCheckInPaymentDetailsState(); } class _EROnlineCheckInPaymentDetailsState extends State { ProjectViewModel projectViewModel; @override void initState() { super.initState(); } @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).emergency + " ${TranslationBase.of(context).checkinOptions}", isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), body: Padding( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: double.infinity, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.1), spreadRadius: 5, blurRadius: 7, offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( TranslationBase.of(context).patientInfo, style: TextStyle( fontSize: 18, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), ), mHeight(12), Row( children: [ Text( TranslationBase.of(context).patientName + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.6, color: CustomColors.grey, ), ), mWidth(3), Text( projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.48, ), ), ], ), Row( children: [ Text( TranslationBase.of(context).mrn + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.6, color: CustomColors.grey, ), ), mWidth(3), Text( projectViewModel.user.patientID.toString(), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.48, ), ), ], ), ], ), ), ), mHeight(24), Container( width: double.infinity, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.1), spreadRadius: 5, blurRadius: 7, offset: Offset(0, 3), // changes position of shadow ), ], ), child: Padding( padding: EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "ER Visit Details", style: TextStyle( fontSize: 18, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), ), mHeight(12), Row( children: [ Text( TranslationBase.of(context).hospital + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.6, color: CustomColors.grey, ), ), mWidth(3), Text( "Olaya Hospital", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.48, ), ), ], ), Row( children: [ Text( TranslationBase.of(context).clinicName + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.6, color: CustomColors.grey, ), ), mWidth(3), Text( "ER Clinic", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.48, ), ), ], ), Row( children: [ Text( "Time Check-In" + ":", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, letterSpacing: -0.6, color: CustomColors.grey, ), ), mWidth(3), Text( DateUtil.getMonthDayYearDateFormatted(DateTime.now()), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.48, ), ), ], ), ], ), ), ) ], ), ), bottomSheet: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.5), spreadRadius: 5, blurRadius: 7, offset: Offset(0, 3), // changes position of shadow ), ], ), padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), width: double.infinity, // color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 12), Text( TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, ), ), SizedBox( width: MediaQuery.of(context).size.width * 0.75, child: getPaymentMethods(), ), _amountView(TranslationBase.of(context).patientShareTotalToDo, "51.81" + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true), SizedBox(height: 12), DefaultButton( TranslationBase.of(context).payNow.toUpperCase(), () {}, color: CustomColors.green, disabledColor: CustomColors.grey2, ), ], ), ), ); } _amountView(String title, String value, {bool isBold = false, bool isTotal = false}) { return Padding( padding: const EdgeInsets.only(top: 10, bottom: 10), child: Row(children: [ Expanded( child: _getNormalText(title), ), Expanded( child: _getNormalText(value, isBold: isBold, isTotal: isTotal), ), ]), ); } _getNormalText(text, {bool isBold = false, bool isTotal = false}) { return Text( text, style: TextStyle( fontSize: isBold ? isTotal ? 16 : 12 : 11, letterSpacing: -0.5, color: isBold ? Color(0xff2E303A) : Color(0xff575757), fontWeight: isTotal ? FontWeight.bold : FontWeight.w600, ), ); } }