fix shaerd

dev_v2.8_reverting
Elham Rababh 4 years ago
parent ed4f949053
commit 9292b38d5a

@ -10,12 +10,11 @@ import 'package:url_launcher/url_launcher.dart';
import 'widgets/shared/buttons/secondary_button.dart'; import 'widgets/shared/buttons/secondary_button.dart';
class UpdatePage extends StatelessWidget { class UpdatePage extends StatelessWidget {
final String message; final String? message;
final String androidLink; final String? androidLink;
final String iosLink; final String? iosLink;
const UpdatePage({Key ? key, this.message, this.androidLink, this.iosLink}) const UpdatePage({Key? key, this.message, this.androidLink, this.iosLink}) : super(key: key);
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,7 +34,7 @@ class UpdatePage extends StatelessWidget {
Image.asset('assets/images/HMG_logo.png'), Image.asset('assets/images/HMG_logo.png'),
SizedBox(height: 8,), SizedBox(height: 8,),
AppText( AppText(
TranslationBase.of(context).updateTheApp.toUpperCase(),fontSize: 17, TranslationBase.of(context).updateTheApp!.toUpperCase(),fontSize: 17,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
SizedBox(height: 12,), SizedBox(height: 12,),
@ -55,11 +54,11 @@ class UpdatePage extends StatelessWidget {
color: Colors.red[800], color: Colors.red[800],
onTap: () { onTap: () {
if (Platform.isIOS) if (Platform.isIOS)
launch(iosLink); launch(iosLink!);
else else
launch(androidLink); launch(androidLink!);
}, },
label: TranslationBase.of(context).updateNow.toUpperCase(), label: TranslationBase.of(context).updateNow!.toUpperCase(),
), ),
), ),
), ),

@ -293,15 +293,15 @@ class PatientReferralViewModel extends BaseViewModel {
String getReferralStatusNameByCode(int statusCode, BuildContext context) { String getReferralStatusNameByCode(int statusCode, BuildContext context) {
switch (statusCode) { switch (statusCode) {
case 1: case 1:
return TranslationBase.of(context).referralStatusHold /*pending*/; return TranslationBase.of(context).referralStatusHold! /*pending*/;
case 2: case 2:
return TranslationBase.of(context).referralStatusActive /* accepted*/; return TranslationBase.of(context).referralStatusActive! /* accepted*/;
case 4: case 4:
return TranslationBase.of(context).referralStatusCancelled /*rejected*/; return TranslationBase.of(context).referralStatusCancelled! /*rejected*/;
case 46: case 46:
return TranslationBase.of(context).referralStatusCompleted /*accepted*/; return TranslationBase.of(context).referralStatusCompleted! /*accepted*/;
case 63: case 63:
return TranslationBase.of(context).rejected /*referralStatusNotSeen*/; return TranslationBase.of(context).rejected! /*referralStatusNotSeen*/;
default: default:
return "-"; return "-";
} }

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -21,7 +20,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> { class _LandingPageState extends State<LandingPage> {
int currentTab = 0; int currentTab = 0;
PageController pageController; late PageController pageController;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {

@ -0,0 +1,91 @@
import '../patiant_info_model.dart';
class PatientProfileAppBarModel {
double? height;
bool? isInpatient;
bool? isDischargedPatient;
bool? isFromLiveCare;
PatiantInformtion? patient;
String? doctorName;
String? branch;
DateTime? appointmentDate;
String? profileUrl;
String? invoiceNO;
String? orderNo;
bool? isPrescriptions;
bool? isMedicalFile;
String? episode;
String? visitDate;
String? clinic;
bool? isAppointmentHeader;
bool? isFromLabResult;
Stream <String> ?videoCallDurationStream;
PatientProfileAppBarModel(
{this.height = 0.0,
this.isInpatient= false,
this.isDischargedPatient= false,
this.isFromLiveCare= false,
this.patient,
this.doctorName,
this.branch,
this.appointmentDate,
this.profileUrl,
this.invoiceNO,
this.orderNo,
this.isPrescriptions= false,
this.isMedicalFile= false,
this.episode,
this.visitDate,
this.clinic,
this.isAppointmentHeader = false,
this.isFromLabResult =false, this.videoCallDurationStream});
PatientProfileAppBarModel.fromJson(Map<String, dynamic> json) {
height = json['height'];
isInpatient = json['isInpatient'];
isDischargedPatient = json['isDischargedPatient'];
isFromLiveCare = json['isFromLiveCare'];
patient = json['patient'];
doctorName = json['doctorName'];
branch = json['branch'];
appointmentDate = json['appointmentDate'];
profileUrl = json['profileUrl'];
invoiceNO = json['invoiceNO'];
orderNo = json['orderNo'];
isPrescriptions = json['isPrescriptions'];
isMedicalFile = json['isMedicalFile'];
episode = json['episode'];
visitDate = json['visitDate'];
clinic = json['clinic'];
isAppointmentHeader = json['isAppointmentHeader'];
isFromLabResult = json['isFromLabResult'];
videoCallDurationStream = json['videoCallDurationStream'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['height'] = this.height;
data['isInpatient'] = this.isInpatient;
data['isDischargedPatient'] = this.isDischargedPatient;
data['isFromLiveCare'] = this.isFromLiveCare;
data['patient'] = this.patient;
data['doctorName'] = this.doctorName;
data['branch'] = this.branch;
data['appointmentDate'] = this.appointmentDate;
data['profileUrl'] = this.profileUrl;
data['invoiceNO'] = this.invoiceNO;
data['orderNo'] = this.orderNo;
data['isPrescriptions'] = this.isPrescriptions;
data['isMedicalFile'] = this.isMedicalFile;
data['episode'] = this.episode;
data['visitDate'] = this.visitDate;
data['clinic'] = this.clinic;
data['isAppointmentHeader'] = this.isAppointmentHeader;
data['isFromLabResult'] = this.isFromLabResult;
data['videoCallDurationStream'] = this.videoCallDurationStream;
return data;
}
}

@ -4,6 +4,7 @@ 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/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approvals_details.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
@ -18,9 +19,9 @@ import 'package:provider/provider.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class InsuranceApprovalScreenNew extends StatefulWidget { class InsuranceApprovalScreenNew extends StatefulWidget {
final int appointmentNo; final int? appointmentNo;
InsuranceApprovalScreenNew({required this.appointmentNo}); InsuranceApprovalScreenNew({this.appointmentNo});
@override @override
_InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState createState() =>
@ -32,7 +33,7 @@ class _InsuranceApprovalScreenNewState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient']; patient = routeArgs['patient'];
String patientType = routeArgs['patientType']; String patientType = routeArgs['patientType'];
@ -42,18 +43,16 @@ class _InsuranceApprovalScreenNewState
? (model) => model.getInsuranceInPatient(mrn: patient.patientId) ? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null : patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient, ? (model) => model.getInsuranceApproval(patient,
appointmentNo: int.parse(patient?.appointmentNo.toString()), appointmentNo: int.parse(patient.appointmentNo.toString()), projectId: patient.projectId)
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient), : (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold(
AppScaffold( patientProfileAppBarModel: PatientProfileAppBarModel(
appBar: PatientProfileAppBar( patient: patient,
patient,
isInpatient: isInpatient, isInpatient: isInpatient,
), ),
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).approvals ?? "",
body: patient.admissionNo != null body: patient.admissionNo != null
? SingleChildScrollView( ? SingleChildScrollView(
child: Container( child: Container(
@ -67,8 +66,8 @@ class _InsuranceApprovalScreenNewState
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).insurance22, title: TranslationBase.of(context).insurance22!,
subTitle: TranslationBase.of(context).approvals22, subTitle: TranslationBase.of(context).approvals22!,
), ),
...List.generate( ...List.generate(
model.insuranceApprovalInPatient.length, model.insuranceApprovalInPatient.length,
@ -150,9 +149,9 @@ class _InsuranceApprovalScreenNewState
? Column( ? Column(
children: <Widget>[ children: <Widget>[
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).insurance22, title: TranslationBase.of(context).insurance22!,
subTitle: subTitle:
TranslationBase.of(context).approvals22, TranslationBase.of(context).approvals22!,
), ),
...List.generate( ...List.generate(
model.insuranceApproval.length, model.insuranceApproval.length,

@ -89,7 +89,7 @@ class GetOutPatientStack extends StatelessWidget {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds. end: Alignment(0.0, 1.0), // 10% of the width, so there are ten blinds.
colors: <Color>[Color(0x8FF5F6FA), Colors.red[100]], // red to yellow colors: <Color>[Color(0x8FF5F6FA), Colors.red[50]!], // red to yellow
tileMode: TileMode.mirror, // repeats the gradient over the canvas tileMode: TileMode.mirror, // repeats the gradient over the canvas
), ),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),

@ -31,7 +31,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).generalResult, TranslationBase.of(context).generalResult!,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -102,7 +102,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context).fileNo!,
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -170,7 +170,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).referralDoctor, TranslationBase.of(context).referralDoctor!,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -213,7 +213,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).referringClinic, TranslationBase.of(context).referringClinic!,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -268,7 +268,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).frequency, TranslationBase.of(context).frequency!,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -311,7 +311,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context).maxResponseTime, TranslationBase.of(context).maxResponseTime!,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -365,8 +365,8 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
), ),
SizedBox( SizedBox(
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context)!
.clinicDetailsandRemarks, .clinicDetailsandRemarks!,
fontSize: 1.9 * SizeConfig.textMultiplier, fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -414,7 +414,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
controller: answerController, controller: answerController,
maxLines: 3, maxLines: 3,
minLines: 2, minLines: 2,
hintText: TranslationBase.of(context).answerThePatient, hintText: TranslationBase.of(context).answerThePatient!,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
readOnly: _isLoading, readOnly: _isLoading,
validator: (value) { validator: (value) {
@ -431,7 +431,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
child: AppButton( child: AppButton(
title : TranslationBase.of(context).replay, title : TranslationBase.of(context).replay!,
onPressed: () async { onPressed: () async {
final form = _formKey.currentState; final form = _formKey.currentState;
if (form!.validate()) { if (form!.validate()) {

@ -11,24 +11,24 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget { class PatientReferralItemWidget extends StatelessWidget {
final String referralStatus; final String? referralStatus;
final int referralStatusCode; final int? referralStatusCode;
final String patientName; final String? patientName;
final int patientGender; final int? patientGender;
final String referredDate; final String? referredDate;
final String referredTime; final String? referredTime;
final String patientID; final String? patientID;
final isSameBranch; final isSameBranch;
final bool isReferral; final bool? isReferral;
final bool isReferralClinic; final bool? isReferralClinic;
final String referralClinic; final String? referralClinic;
final String remark; final String? remark;
final String nationality; final String? nationality;
final String nationalityFlag; final String? nationalityFlag;
final String doctorAvatar; final String? doctorAvatar;
final String referralDoctorName; final String? referralDoctorName;
final String clinicDescription; final String? clinicDescription;
final Widget infoIcon; final Widget? infoIcon;
PatientReferralItemWidget( PatientReferralItemWidget(
{this.referralStatus, {this.referralStatus,
@ -67,8 +67,8 @@ class PatientReferralItemWidget extends StatelessWidget {
: referralStatusCode == 46 : referralStatusCode == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: referralStatusCode == 4 : referralStatusCode == 4
? Colors.red[700] ? Colors.red[700]!
: Colors.red[900], : Colors.red[900]!,
hasBorder: false, hasBorder: false,
widget: Container( widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
@ -80,7 +80,7 @@ class PatientReferralItemWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText( AppText(
referralStatus != null ? referralStatus : "", referralStatus != null ? referralStatus! : "",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 10.0, fontSize: 10.0,
letterSpacing: -0.4, letterSpacing: -0.4,
@ -92,11 +92,11 @@ class PatientReferralItemWidget extends StatelessWidget {
: referralStatusCode == 46 : referralStatusCode == 46
? AppGlobal.appGreenColor ? AppGlobal.appGreenColor
: referralStatusCode == 4 : referralStatusCode == 4
? Colors.red[700] ? Colors.red[700]!
: Colors.red[900], : Colors.red[900]!,
), ),
AppText( AppText(
referredDate, referredDate!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -110,7 +110,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientName, patientName!,
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2E303A), color: Color(0xff2E303A),
@ -132,7 +132,7 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 4, width: 4,
), ),
AppText( AppText(
referredTime, referredTime!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12.0, fontSize: 12.0,
@ -153,8 +153,8 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber!,
value: patientID, value: patientID!,
), ),
], ],
), ),
@ -165,15 +165,15 @@ class PatientReferralItemWidget extends StatelessWidget {
CustomRow( CustomRow(
label: isSameBranch label: isSameBranch
? TranslationBase.of(context) ? TranslationBase.of(context)
.referredFrom .referredFrom!
: TranslationBase.of(context).refClinic, : TranslationBase.of(context).refClinic!,
value: !isReferralClinic value: !isReferralClinic!
? isSameBranch ? isSameBranch
? TranslationBase.of(context) ? TranslationBase.of(context)
.sameBranch .sameBranch!
: TranslationBase.of(context) : TranslationBase.of(context)
.otherBranch .otherBranch!
: " " + referralClinic, : " " + referralClinic!,
), ),
], ],
), ),
@ -183,7 +183,7 @@ class PatientReferralItemWidget extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
nationality != null ? nationality : "", nationality != null ? nationality! : "",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 10.0, fontSize: 10.0,
@ -193,12 +193,10 @@ class PatientReferralItemWidget extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
nationalityFlag, nationalityFlag!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text(''); return Text('');
}, },
)) ))
@ -212,7 +210,7 @@ class PatientReferralItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context).remarks + " : ", label: TranslationBase.of(context).remarks! + " : ",
value: remark ?? "", value: remark ?? "",
), ),
], ],
@ -223,7 +221,7 @@ class PatientReferralItemWidget extends StatelessWidget {
Container( Container(
margin: EdgeInsets.only(left: 10, right: 0), margin: EdgeInsets.only(left: 10, right: 0),
child: Image.asset( child: Image.asset(
isReferral isReferral!
? 'assets/images/patient/ic_ref_arrow_up.png' ? 'assets/images/patient/ic_ref_arrow_up.png'
: 'assets/images/patient/ic_ref_arrow_left.png', : 'assets/images/patient/ic_ref_arrow_left.png',
height: 50, height: 50,
@ -241,12 +239,10 @@ class PatientReferralItemWidget extends StatelessWidget {
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
doctorAvatar, doctorAvatar!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
)) ))
@ -278,7 +274,7 @@ class PatientReferralItemWidget extends StatelessWidget {
), ),
if (clinicDescription != null) if (clinicDescription != null)
AppText( AppText(
clinicDescription, clinicDescription??"",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 10.0, fontSize: 10.0,

@ -76,7 +76,7 @@ class PatientCard extends StatelessWidget {
: isInpatient : isInpatient
? Colors.white ? Colors.white
: !isFromSearch : !isFromSearch
? Colors.red[800] ? Colors.red[800]!
: Colors.white, : Colors.white,
widget: Container( widget: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -134,8 +134,8 @@ class PatientCard extends StatelessWidget {
PatientStatus( PatientStatus(
label: label:
TranslationBase.of(context) TranslationBase.of(context)
.notArrived, .notArrived!,
color: Colors.red[800], color: Colors.red[800]!,
), ),
SizedBox( SizedBox(
width: 8, width: 8,
@ -169,8 +169,8 @@ class PatientCard extends StatelessWidget {
PatientStatus( PatientStatus(
label: TranslationBase.of( label: TranslationBase.of(
context) context)
.notArrived, .notArrived!,
color: Colors.red[800], color: Colors.red[800]!,
), ),
SizedBox( SizedBox(
width: 8, width: 8,
@ -202,8 +202,8 @@ class PatientCard extends StatelessWidget {
this.arrivalType == '1' this.arrivalType == '1'
? AppText( ? AppText(
patientInfo.startTime != null patientInfo.startTime != null
? patientInfo.startTime ? patientInfo.startTime!
: patientInfo.startTimes, : patientInfo.startTimes!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
) )
@ -212,7 +212,7 @@ class PatientCard extends StatelessWidget {
padding: EdgeInsets.only(right: 9), padding: EdgeInsets.only(right: 9),
child: AppText( child: AppText(
"${AppDateUtils.getStartTime(patientInfo.startTime)}", "${AppDateUtils.getStartTime(patientInfo.startTime!)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, fontSize: 11,
@ -222,11 +222,11 @@ class PatientCard extends StatelessWidget {
: (patientInfo.appointmentDate != : (patientInfo.appointmentDate !=
null && null &&
patientInfo patientInfo
.appointmentDate.isNotEmpty) .appointmentDate!.isNotEmpty!)
? Container( ? Container(
padding: EdgeInsets.only(right: 9), padding: EdgeInsets.only(right: 9),
child: AppText( child: AppText(
" ${AppDateUtils.getStartTime(patientInfo.startTime)}", " ${AppDateUtils.getStartTime(patientInfo!.startTime!)}",
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 11, fontSize: 11,
@ -296,7 +296,7 @@ class PatientCard extends StatelessWidget {
), ),
]), ]),
), ),
if (nationalityName.isNotEmpty) if (nationalityName!.isNotEmpty)
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -381,14 +381,14 @@ class PatientCard extends StatelessWidget {
// SizedBox(height: 10,), // SizedBox(height: 10,),
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.fileNumber, .fileNumber!,
value: patientInfo.patientId.toString(), value: patientInfo.patientId.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).age + label: TranslationBase.of(context).age! +
" : ", " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patientInfo!.dateofBirth!, context, isServerFormat: !isFromLiveCare)}",
), ),
patientInfo.arrivedOn != null patientInfo.arrivedOn != null
@ -416,13 +416,13 @@ class PatientCard extends StatelessWidget {
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(
context) context)
.arrivedP + .arrivedP! +
" : ", " : ",
value: AppDateUtils value: AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
AppDateUtils AppDateUtils
.convertStringToDate( .convertStringToDate(
patientInfo.arrivedOn, patientInfo!.arrivedOn!,
), ),
isMonthShort: true, isMonthShort: true,
), ),
@ -431,7 +431,7 @@ class PatientCard extends StatelessWidget {
) )
: (patientInfo.appointmentDate != : (patientInfo.appointmentDate !=
null && null &&
patientInfo.appointmentDate patientInfo!.appointmentDate!
.isNotEmpty) .isNotEmpty)
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
@ -442,11 +442,11 @@ class PatientCard extends StatelessWidget {
CustomRow( CustomRow(
label: TranslationBase.of( label: TranslationBase.of(
context) context)
.appointmentDate + .appointmentDate! +
" : ", " : ",
value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate( value: "${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(
patientInfo patientInfo!
.appointmentDate, .appointmentDate!,
), isMonthShort: true)}", ), isMonthShort: true)}",
), ),
], ],
@ -459,7 +459,7 @@ class PatientCard extends StatelessWidget {
patientInfo.admissionDate == null patientInfo.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : TranslationBase.of(context)
.admissionDate + .admissionDate! +
" : ", " : ",
value: patientInfo.admissionDate == value: patientInfo.admissionDate ==
null null
@ -469,15 +469,15 @@ class PatientCard extends StatelessWidget {
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.numOfDays + .numOfDays!+
" : ", " : ",
value: value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo!.admissionDate!)).inDays + 1}",
), ),
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.clinicName + .clinicName! +
" : ", " : ",
value: value:
"${patientInfo.clinicDescription}", "${patientInfo.clinicDescription}",
@ -485,7 +485,7 @@ class PatientCard extends StatelessWidget {
if (patientInfo.admissionDate != null) if (patientInfo.admissionDate != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.roomNo + .roomNo! +
" : ", " : ",
value: "${patientInfo.roomId}", value: "${patientInfo.roomId}",
), ),
@ -494,9 +494,9 @@ class PatientCard extends StatelessWidget {
children: [ children: [
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.clinic + .clinic! +
" : ", " : ",
value: patientInfo.clinicName, value: patientInfo!.clinicName!,
), ),
], ],
), ),
@ -580,13 +580,13 @@ class PatientStatus extends StatelessWidget {
this.label, this.label,
this.color, this.color,
}) : super(key: key); }) : super(key: key);
final String label; final String? label;
final Color color; final Color? color;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppText( return AppText(
label, label??"",
color: color ?? AppGlobal.appGreenColor, color: color ?? AppGlobal.appGreenColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',

@ -9,7 +9,7 @@ class ShowTimer extends StatefulWidget {
const ShowTimer({ const ShowTimer({
Key ? key, this.patientInfo, Key? key, required this.patientInfo,
}) : super(key: key); }) : super(key: key);
@override @override
@ -50,7 +50,7 @@ class _ShowTimerState extends State<ShowTimer> {
generateShowTimerString() { generateShowTimerString() {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime); DateTime liveCareDate = DateTime.parse(widget.patientInfo!.arrivalTime!);
String timer = AppDateUtils.differenceBetweenDateAndCurrent( String timer = AppDateUtils.differenceBetweenDateAndCurrent(
liveCareDate, context, isShowSecond: true, isShowDays: false); liveCareDate, context, isShowSecond: true, isShowDays: false);

@ -11,35 +11,35 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class PatientProfileButton extends StatelessWidget { class PatientProfileButton extends StatelessWidget {
final String nameLine1; final String? nameLine1;
final String nameLine2; final String? nameLine2;
final String icon; final String icon;
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
String arrivalType; String arrivalType;
final bool isInPatient; final bool isInPatient;
String from; String? from;
String to; String? to;
final String url = "assets/images/"; final String url = "assets/images/";
final bool isDisable; final bool isDisable;
final bool isLoading; final bool isLoading;
final Function onTap; final GestureTapCallback? onTap;
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isSelectInpatient; final bool isSelectInpatient;
final bool isDartIcon; final bool isDartIcon;
final IconData dartIcon; final IconData? dartIcon;
final bool isFromLiveCare; final bool? isFromLiveCare;
final Color color; final Color? color;
PatientProfileButton({ PatientProfileButton({
Key ? key, Key? key,
this.patient, required this.patient,
this.patientType, required this.patientType,
this.arrivalType, required this.arrivalType,
this.nameLine1, this.nameLine1,
this.nameLine2, this.nameLine2,
this.icon, required this.icon,
this.route, this.route,
this.isDisable = false, this.isDisable = false,
this.onTap, this.onTap,
@ -100,7 +100,7 @@ class PatientProfileButton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
!projectsProvider.isArabic ? this.nameLine1 : nameLine2, !projectsProvider.isArabic ? this.nameLine1! : nameLine2!??'',
color: color ?? AppGlobal.appTextColor, color: color ?? AppGlobal.appTextColor,
letterSpacing: -0.33, letterSpacing: -0.33,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -108,7 +108,7 @@ class PatientProfileButton extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 1.30, fontSize: SizeConfig.textMultiplier * 1.30,
), ),
AppText( AppText(
!projectsProvider.isArabic ? this.nameLine2 : nameLine1, !projectsProvider.isArabic ? this.nameLine2! : nameLine1!??'',
color: color ?? Color(0xFF2B353E), color: color ?? Color(0xFF2B353E),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
textAlign: TextAlign.left, textAlign: TextAlign.left,

@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
class AddNewOrder extends StatelessWidget { class AddNewOrder extends StatelessWidget {
const AddNewOrder({ const AddNewOrder({
Key ? key, Key? key,
this.onTap, required this.onTap,
this.label, required this.label,
}) : super(key: key); }) : super(key: key);
final Function onTap; final GestureTapCallback onTap;
final String label; final String label;
@override @override

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
class LargeAvatar extends StatelessWidget { class LargeAvatar extends StatelessWidget {
LargeAvatar( LargeAvatar(
{Key ? key, {Key? key,
this.name, required this.name,
this.url, this.url,
this.disableProfileView: false, this.disableProfileView: false,
this.radius = 60.0, this.radius = 60.0,
@ -15,14 +15,14 @@ class LargeAvatar extends StatelessWidget {
: super(key: key); : super(key: key);
final String name; final String name;
final String url; final String? url;
final bool disableProfileView; final bool disableProfileView;
final double radius; final double radius;
final double width; final double width;
final double height; final double height;
Widget _getAvatar() { Widget _getAvatar() {
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { if (url != null && url!.isNotEmpty && Uri.parse(url!).isAbsolute) {
return CircleAvatar( return CircleAvatar(
radius: radius:
SizeConfig.imageSizeMultiplier * 12, SizeConfig.imageSizeMultiplier * 12,
@ -71,8 +71,8 @@ class LargeAvatar extends StatelessWidget {
begin: Alignment(-1, -1), begin: Alignment(-1, -1),
end: Alignment(1, 1), end: Alignment(1, 1),
colors: [ colors: [
Colors.grey[100], Colors.grey[100]!,
Colors.grey[800], Colors.grey[800]!,
]), ]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(

@ -24,7 +24,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
final bool isDischargedPatient; final bool isDischargedPatient;
final bool isFromLiveCare; final bool isFromLiveCare;
final Stream<String> videoCallDurationStream; final Stream<String>? videoCallDurationStream;
PatientProfileHeaderNewDesignAppBar( PatientProfileHeaderNewDesignAppBar(
this.patient, this.patientType, this.arrivalType, this.patient, this.patientType, this.arrivalType,
@ -38,9 +38,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
Widget build(BuildContext context) { Widget build(BuildContext context) {
int gender = 1; int gender = 1;
if (patient.patientDetails != null) { if (patient.patientDetails != null) {
gender = patient.patientDetails.gender; gender = patient.patientDetails!.gender!;
} else { } else {
gender = patient.gender; gender = patient!.gender!;
} }
return Container( return Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -76,7 +76,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
" " + " " +
Helpers.capitalize(patient.lastName)) Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName ?? : Helpers.capitalize(patient.fullName ??
patient.patientDetails.fullName), patient.patientDetails!.fullName!),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -99,7 +99,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
eventCategory: "Patient Profile Header", eventCategory: "Patient Profile Header",
eventAction: "Call Patient", eventAction: "Call Patient",
); );
launch("tel://" + patient.mobileNumber); launch("tel://" + patient!.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,
@ -121,7 +121,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
padding: padding:
EdgeInsets.symmetric(vertical: 2, horizontal: 10), EdgeInsets.symmetric(vertical: 2, horizontal: 10),
child: Text( child: Text(
snapshot.data, snapshot!.data!,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
@ -161,15 +161,15 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
children: [ children: [
patient.patientStatusType == 43 patient.patientStatusType == 43
? AppText( ? AppText(
TranslationBase.of(context).arrivedP, TranslationBase.of(context).arrivedP!,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
) )
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived!,
color: Colors.red[800], color: Colors.red[800]!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 12, fontSize: 12,
@ -177,7 +177,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
arrivalType == '1' || patient.arrivedOn == null arrivalType == '1' || patient.arrivedOn == null
? AppText( ? AppText(
patient.startTime != null patient.startTime != null
? patient.startTime ? patient.startTime!
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -186,7 +186,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
patient.arrivedOn != null patient.arrivedOn != null
? AppDateUtils ? AppDateUtils
.convertStringToDateFormat( .convertStringToDateFormat(
patient.arrivedOn, patient!.arrivedOn!,
'MM-dd-yyyy HH:mm') 'MM-dd-yyyy HH:mm')
: '', : '',
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -203,7 +203,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).appointmentDate + TranslationBase.of(context).appointmentDate!+
" : ", " : ",
fontSize: 14, fontSize: 14,
), ),
@ -273,12 +273,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient!.nationalityFlagURL!,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext? context,
Object exception, Object? exception,
StackTrace stackTrace) { StackTrace? stackTrace) {
return Text(''); return Text('');
}, },
)) ))
@ -289,9 +289,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
], ],
), ),
HeaderRow( HeaderRow(
label: TranslationBase.of(context).age + " : ", label: TranslationBase.of(context).age! + " : ",
value: value:
"${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
), ),
if (isInpatient) if (isInpatient)
Column( Column(
@ -300,7 +300,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
HeaderRow( HeaderRow(
label: patient.admissionDate == null label: patient.admissionDate == null
? "" ? ""
: TranslationBase.of(context).admissionDate + : TranslationBase.of(context).admissionDate! +
" : ", " : ",
value: patient.admissionDate == null value: patient.admissionDate == null
? "" ? ""
@ -310,8 +310,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
label: "${TranslationBase.of(context).numOfDays}: ", label: "${TranslationBase.of(context).numOfDays}: ",
value: isDischargedPatient && value: isDischargedPatient &&
patient.dischargeDate != null patient.dischargeDate != null
? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" ? "${AppDateUtils.getDateTimeFromServerFormat(patient!.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}"
: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient!.admissionDate!)).inDays + 1}",
) )
], ],
) )
@ -343,7 +343,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget
date.day.toString().padLeft(2, '0'); date.day.toString().padLeft(2, '0');
} }
return newDate ?? ''; return newDate??'';
} }
isToday(date) { isToday(date) {

@ -14,8 +14,7 @@ import 'large_avatar.dart';
class PrescriptionInPatientWidget extends StatelessWidget { class PrescriptionInPatientWidget extends StatelessWidget {
final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList; final List<PrescriptionReportForInPatient> prescriptionReportForInPatientList;
PrescriptionInPatientWidget( PrescriptionInPatientWidget({Key? key, required this.prescriptionReportForInPatientList});
{Key ? key, this.prescriptionReportForInPatientList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -43,13 +42,13 @@ class PrescriptionInPatientWidget extends StatelessWidget {
), ),
Padding( Padding(
child: AppText( child: AppText(
TranslationBase.of(context).noPrescription, TranslationBase.of(context).noPrescription!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
AppText( AppText(
TranslationBase.of(context).applyNow, TranslationBase.of(context).applyNow!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
) )
@ -78,9 +77,7 @@ class PrescriptionInPatientWidget extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: name: prescriptionReportForInPatientList[index].createdByName ?? "",
prescriptionReportForInPatientList[index]
.createdByName,
radius: 10, radius: 10,
width: 70, width: 70,
), ),

@ -14,7 +14,7 @@ import 'large_avatar.dart';
class PrescriptionOutPatientWidget extends StatelessWidget { class PrescriptionOutPatientWidget extends StatelessWidget {
final List<PrescriptionResModel> patientPrescriptionsList; final List<PrescriptionResModel> patientPrescriptionsList;
PrescriptionOutPatientWidget({Key ? key, this.patientPrescriptionsList}); PrescriptionOutPatientWidget({Key? key, required this.patientPrescriptionsList});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,13 +42,13 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
), ),
Padding( Padding(
child: AppText( child: AppText(
TranslationBase.of(context).noPrescription, TranslationBase.of(context).noPrescription!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
), ),
AppText( AppText(
TranslationBase.of(context).applyNow, TranslationBase.of(context).applyNow!,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
) )
@ -82,10 +82,8 @@ class PrescriptionOutPatientWidget extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
url: patientPrescriptionsList[index] url: patientPrescriptionsList[index].doctorImageURL,
.doctorImageURL, name: patientPrescriptionsList[index].doctorName ?? "",
name: patientPrescriptionsList[index]
.doctorName,
radius: 10, radius: 10,
width: 70, width: 70,
), ),

@ -34,7 +34,7 @@ class ProfileWelcomeWidget extends StatelessWidget {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: CachedNetworkImage( child: CachedNetworkImage(
imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL, imageUrl: authenticationViewModel.doctorProfile!.doctorImageURL ?? "",
fit: BoxFit.fill, fit: BoxFit.fill,
width: 75, width: 75,
height: 75, height: 75,

@ -16,7 +16,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
ProfileMedicalInfoWidget( ProfileMedicalInfoWidget(
{Key ? key, this.patient, this.patientType, this.arrivalType, this.from, this.to, this.isInpatient}); {Key? key, required this.patient, required this.patientType, required this.arrivalType, required this.from, required this.to, this.isInpatient = false});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -8,27 +8,35 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProfileMedicalInfoWidgetSearch extends StatelessWidget { class ProfileMedicalInfoWidgetSearch extends StatefulWidget {
final String? from; final String? from;
final String? to; final String? to;
final PatiantInformtion patient; final PatiantInformtion patient;
final String patientType; final String patientType;
final String arrivalType; final String? arrivalType;
final bool isInpatient; final bool isInpatient;
final bool isDischargedPatient; final bool? isDischargedPatient;
ProfileMedicalInfoWidgetSearch( ProfileMedicalInfoWidgetSearch(
{Key ? key, {Key? key,
this.patient, required this.patient,
this.patientType, required this.patientType,
this.arrivalType, this.arrivalType,
this.from, this.from,
this.to, this.to,
this.isInpatient , this.isInpatient = false,
this.isDischargedPatient}); this.isDischargedPatient});
TabController _tabController;
@override
_ProfileMedicalInfoWidgetSearchState createState() => _ProfileMedicalInfoWidgetSearchState();
}
class _ProfileMedicalInfoWidgetSearchState extends State<ProfileMedicalInfoWidgetSearch>
with SingleTickerProviderStateMixin {
late TabController _tabController;
void initState() { void initState() {
_tabController = TabController(length: 2); _tabController = TabController(length: 2, vsync: this);
} }
void dispose() { void dispose() {
@ -41,7 +49,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
onModelReady: (model) async {}, onModelReady: (model) async {},
builder: (_, model, w) => DefaultTabController( builder: (_, model, w) => DefaultTabController(
length: 2, length: 2,
initialIndex: isInpatient ? 0 : 1, initialIndex: widget.isInpatient! ? 0 : 1,
child: SizedBox( child: SizedBox(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * 1.0,
width: double.infinity, width: double.infinity,
@ -55,22 +63,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
PatientProfileButton( PatientProfileButton(
key: key, patient: widget.patient,
patient: patient, patientType: widget.patientType,
patientType: patientType, arrivalType: widget.arrivalType??"",
arrivalType: arrivalType, from: widget.from,
from: from, to: widget.to,
to: to, nameLine1: TranslationBase.of(context).vital??'',
nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs??'',
nameLine2: TranslationBase.of(context).signs,
route: VITAL_SIGN_DETAILS, route: VITAL_SIGN_DETAILS,
icon: 'assets/images/svgs/profile_screen/vital signs.svg'), icon: 'assets/images/svgs/profile_screen/vital signs.svg'),
// if (selectedPatientType != 7) // if (selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: HEALTH_SUMMARY, route: HEALTH_SUMMARY,
nameLine1: nameLine1:
"Health", //TranslationBase.of(context).medicalReport, "Health", //TranslationBase.of(context).medicalReport,
@ -78,128 +85,128 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget {
"Summary", //TranslationBase.of(context).summaryReport, "Summary", //TranslationBase.of(context).summaryReport,
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg'),
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: LAB_RESULT, route: LAB_RESULT,
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab??'',
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result??"",
icon: 'assets/images/svgs/profile_screen/lab results.svg'), icon: 'assets/images/svgs/profile_screen/lab results.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
isInPatient: isInpatient, isInPatient: widget.isInpatient,
route: RADIOLOGY_PATIENT, route: RADIOLOGY_PATIENT,
nameLine1: TranslationBase.of(context).radiology, nameLine1: TranslationBase.of(context).radiology??"",
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service??"",
icon: 'assets/images/svgs/profile_screen/health summary.svg'), icon: 'assets/images/svgs/profile_screen/health summary.svg'),
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: PATIENT_ECG, route: PATIENT_ECG,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: "ECG", nameLine2: "ECG",
icon: 'assets/images/svgs/profile_screen/ECG.svg'), icon: 'assets/images/svgs/profile_screen/ECG.svg'),
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: ORDER_PRESCRIPTION_NEW, route: ORDER_PRESCRIPTION_NEW,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders??"",
nameLine2: TranslationBase.of(context).prescription, nameLine2: TranslationBase.of(context).prescription??'',
icon: 'assets/images/svgs/profile_screen/order prescription.svg'), icon: 'assets/images/svgs/profile_screen/order prescription.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: ORDER_PROCEDURE, route: ORDER_PROCEDURE,
nameLine1: TranslationBase.of(context).orders, nameLine1: TranslationBase.of(context).orders,
nameLine2: TranslationBase.of(context).procedures, nameLine2: TranslationBase.of(context).procedures,
icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'), icon: 'assets/images/svgs/profile_screen/Order Procedures.svg'),
//if (int.parse(patientType) == 7 || int.parse(patientType) == 6) //if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: PATIENT_INSURANCE_APPROVALS_NEW, route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance, nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).service, nameLine2: TranslationBase.of(context).service,
icon: 'assets/images/svgs/profile_screen/insurance approval.svg'), icon: 'assets/images/svgs/profile_screen/insurance approval.svg'),
// if (int.parse(patientType) == 7 || int.parse(patientType) == 6) // if (int.parse(patientType) == 7 || int.parse(patientType) == 6)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: ADD_SICKLEAVE, route: ADD_SICKLEAVE,
nameLine1: TranslationBase.of(context).patientSick, nameLine1: TranslationBase.of(context).patientSick,
nameLine2: TranslationBase.of(context).leave, nameLine2: TranslationBase.of(context).leave,
icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'), icon: 'assets/images/svgs/profile_screen/patient sick leave.svg'),
if (patient.appointmentNo != null && if (widget.patient.appointmentNo != null &&
patient.appointmentNo != 0) widget.patient.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: PATIENT_UCAF_REQUEST, route: PATIENT_UCAF_REQUEST,
isDisable: isDisable:
patient.patientStatusType != 43 ? true : false, widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).patient, nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).ucaf, nameLine2: TranslationBase.of(context).ucaf,
icon: 'assets/images/svgs/profile_screen/UCAF.svg'), icon: 'assets/images/svgs/profile_screen/UCAF.svg'),
if (patient.appointmentNo != null && if (widget.patient.appointmentNo != null &&
patient.appointmentNo != 0) widget.patient.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: REFER_PATIENT_TO_DOCTOR, route: REFER_PATIENT_TO_DOCTOR,
isDisable: isDisable:
patient.patientStatusType != 43 ? true : false, widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).referral, nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).patient,
icon: 'assets/images/svgs/profile_screen/refer patient.svg'), icon: 'assets/images/svgs/profile_screen/refer patient.svg'),
if (patient.appointmentNo != null && if (widget.patient.appointmentNo != null &&
patient.appointmentNo != 0) widget.patient.appointmentNo != 0)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: PATIENT_ADMISSION_REQUEST, route: PATIENT_ADMISSION_REQUEST,
isDisable: isDisable:
patient.patientStatusType != 43 ? true : false, widget.patient.patientStatusType != 43 ? true : false,
nameLine1: TranslationBase.of(context).admission, nameLine1: TranslationBase.of(context).admission,
nameLine2: TranslationBase.of(context).request, nameLine2: TranslationBase.of(context).request,
icon: 'assets/images/svgs/profile_screen/admission req.svg'), icon: 'assets/images/svgs/profile_screen/admission req.svg'),
if (isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: PROGRESS_NOTE, route: PROGRESS_NOTE,
nameLine1: TranslationBase.of(context).progress, nameLine1: TranslationBase.of(context).progress,
nameLine2: TranslationBase.of(context).note, nameLine2: TranslationBase.of(context).note,
icon: 'assets/images/svgs/profile_screen/Progress notes.svg'), icon: 'assets/images/svgs/profile_screen/Progress notes.svg'),
if (isInpatient) if (widget.isInpatient)
PatientProfileButton( PatientProfileButton(
key: key,
patient: patient, patient: widget.patient,
patientType: patientType, patientType: widget.patientType,
arrivalType: arrivalType, arrivalType: widget.arrivalType??"",
route: ORDER_NOTE, route: ORDER_NOTE,
nameLine1: "Order", //"Text", nameLine1: "Order", //"Text",
nameLine2: "Sheet", nameLine2: "Sheet",

@ -12,7 +12,7 @@ class VitalSignDetailsWidget extends StatefulWidget {
final String viewKey; final String viewKey;
VitalSignDetailsWidget( VitalSignDetailsWidget(
{Key ? key, this.vitalList, this.title1, this.title2, this.viewKey}); {Key? key, required this.vitalList, required this.title1, required this.title2, required this.viewKey});
@override @override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
@ -38,7 +38,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
children: <Widget>[ children: <Widget>[
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0,color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]!),
), ),
children: fullData(), children: fullData(),
), ),
@ -90,7 +90,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
'${AppDateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${AppDateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', '${AppDateUtils.getWeekDay(vital.vitalSignDate!.weekday!)}, ${vital.vitalSignDate!.day} ${AppDateUtils.getMonth(vital.vitalSignDate!.month)}, ${vital.vitalSignDate!.year} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -8,30 +8,21 @@ class StarRating extends StatelessWidget {
final int totalCount; final int totalCount;
final bool forceStars; final bool forceStars;
StarRating( StarRating({Key? key, this.totalAverage: 0.0, this.size: 16.0, this.totalCount = 5, this.forceStars = false})
{Key ? key,
this.totalAverage: 0.0,
this.size: 16.0,
this.totalCount = 5,
this.forceStars = false})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ return Row(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
if (!forceStars && (totalAverage == null || totalAverage == 0)) if (!forceStars && (totalAverage == null || totalAverage == 0)) AppText("New", style: "caption"),
AppText("New", style: "caption"),
if (forceStars || (totalAverage != null && totalAverage > 0)) if (forceStars || (totalAverage != null && totalAverage > 0))
...List.generate( ...List.generate(
5, 5,
(index) => Padding( (index) => Padding(
padding: EdgeInsets.only(right: 1.0), padding: EdgeInsets.only(right: 1.0),
child: Icon( child: Icon((index + 1) <= (totalAverage) ? EvaIcons.star : EvaIcons.starOutline,
(index + 1) <= (totalAverage ?? 0)
? EvaIcons.star
: EvaIcons.starOutline,
size: size, size: size,
color: (index + 1) <= (totalAverage ?? 0) color: (index + 1) <= (totalAverage)
? Color.fromRGBO(255, 186, 0, 1.0) ? Color.fromRGBO(255, 186, 0, 1.0)
: Theme.of(context).hintColor), : Theme.of(context).hintColor),
)), )),

@ -4,8 +4,7 @@ import 'package:flutter/services.dart';
class NumberTextInputFormatter extends TextInputFormatter { class NumberTextInputFormatter extends TextInputFormatter {
@override @override
TextEditingValue formatEditUpdate( TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue oldValue, TextEditingValue newValue) {
final int newTextLength = newValue.text.length; final int newTextLength = newValue.text.length;
int selectionIndex = newValue.selection.end; int selectionIndex = newValue.selection.end;
int usedSubstringIndex = 0; int usedSubstringIndex = 0;
@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter {
if (newValue.selection.end >= 10) selectionIndex++; if (newValue.selection.end >= 10) selectionIndex++;
} }
// Dump the rest. // Dump the rest.
if (newTextLength >= usedSubstringIndex) if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex));
newText.write(newValue.text.substring(usedSubstringIndex));
return TextEditingValue( return TextEditingValue(
text: newText.toString(), text: newText.toString(),
selection: TextSelection.collapsed(offset: selectionIndex), selection: TextSelection.collapsed(offset: selectionIndex),
@ -39,87 +37,90 @@ class NumberTextInputFormatter extends TextInputFormatter {
final _mobileFormatter = NumberTextInputFormatter(); final _mobileFormatter = NumberTextInputFormatter();
class TextFields extends StatefulWidget { class TextFields extends StatefulWidget {
TextFields( TextFields({
{Key ? key, Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
this.maxLines, this.maxLines,
this.inputFormatters, this.inputFormatters,
this.padding, this.padding,
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction = TextInputAction.done, this.inputAction = TextInputAction.done,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,
this.controller, this.controller,
this.keyboardType, this.keyboardType,
this.validator, this.validator,
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly: false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.autoValidate = false, this.autoValidate = false,
this.fillColor, this.fillColor,
this.hintColor, this.hintColor,
this.hasBorder = true, this.hasBorder = true,
this.onTapTextFields, this.onTapTextFields,
this.hasLabelText = false, this.hasLabelText = false,
this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) this.showLabelText = false,
: super(key: key); this.borderRadius = 8.0,
this.borderColor,
this.borderWidth = 1,
}) : super(key: key);
final String hintText; final String? hintText;
final String initialValue; final String? initialValue;
final String type; final String? type;
final bool autoFocus; final bool? autoFocus;
final IconData suffixIcon; final IconData? suffixIcon;
final Color suffixIconColor; final Color? suffixIconColor;
final Icon prefixIcon; final Icon? prefixIcon;
final VoidCallback onTap; final VoidCallback? onTap;
final Function onTapTextFields; final GestureTapCallback? onTapTextFields;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final FormFieldSetter<String>? onSaved;
final Function onSuffixTap; final GestureTapCallback? onSuffixTap;
final Function onChanged; final Function? onChanged;
final Function onSubmit; final ValueChanged<String>? onSubmit;
final bool readOnly; final bool? readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool? maxLengthEnforced;
final bool bare; final bool? bare;
final TextInputAction inputAction; final TextInputAction? inputAction;
final double fontSize; final double? fontSize;
final FontWeight fontWeight; final FontWeight? fontWeight;
final bool keepPadding; final bool? keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization? textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final bool autoValidate; final bool? autoValidate;
final EdgeInsets padding; final EdgeInsets? padding;
final bool focus; final bool? focus;
final bool borderOnlyError; final bool? borderOnlyError;
final Color hintColor; final Color? hintColor;
final Color fillColor; final Color? fillColor;
final bool hasBorder; final bool? hasBorder;
final bool showLabelText; final bool? showLabelText;
Color borderColor; Color? borderColor;
final double borderRadius; final double? borderRadius;
final double borderWidth; final double? borderWidth;
bool hasLabelText; bool? hasLabelText;
@override @override
_TextFieldsState createState() => _TextFieldsState(); _TextFieldsState createState() => _TextFieldsState();
@ -142,7 +143,7 @@ class _TextFieldsState extends State<TextFields> {
@override @override
void didUpdateWidget(TextFields oldWidget) { void didUpdateWidget(TextFields oldWidget) {
if (widget.focus) _focusNode.requestFocus(); if (widget.focus!) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
} }
@ -152,7 +153,7 @@ class _TextFieldsState extends State<TextFields> {
super.dispose(); super.dispose();
} }
Widget _buildSuffixIcon() { Widget? _buildSuffixIcon() {
switch (widget.type) { switch (widget.type) {
case "password": case "password":
{ {
@ -160,40 +161,35 @@ class _TextFieldsState extends State<TextFields> {
padding: const EdgeInsets.only(right: 8.0), padding: const EdgeInsets.only(right: 8.0),
child: view child: view
? InkWell( ? InkWell(
onTap: () { onTap: () {
this.setState(() { this.setState(() {
view = false; view = false;
}); });
}, },
child: Icon(EvaIcons.eye, child: Icon(EvaIcons.eye, size: 24.0, color: Color?.fromRGBO(78, 62, 253, 1.0)))
size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0)))
: InkWell( : InkWell(
onTap: () { onTap: () {
this.setState(() { this.setState(() {
view = true; view = true;
}); });
}, },
child: Icon(EvaIcons.eyeOff, child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500])));
size: 24.0, color: Colors.grey[500])));
} }
break; break;
default: default:
if (widget.suffixIcon != null) if (widget.suffixIcon != null)
return InkWell( return InkWell(
onTap: widget.onSuffixTap, onTap: widget.onSuffixTap??null,
child: Icon(widget.suffixIcon, child: Icon(widget.suffixIcon,
size: 22.0, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500]));
color: widget.suffixIconColor != null
? widget.suffixIconColor
: Colors.grey[500]));
else else
return null; return null;
} }
} }
bool _determineReadOnly() { bool? _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { if (widget.readOnly != null && widget.readOnly!) {
_focusNode.unfocus(); _focusNode.unfocus();
return true; return true;
} else { } else {
@ -203,44 +199,43 @@ class _TextFieldsState extends State<TextFields> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.borderColor = widget.borderColor ?? Colors.grey;
widget.borderColor = widget.borderColor?? Colors.grey;
return (AnimatedContainer( return (AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration: widget.bare decoration: widget.bare!
? null ? null
: BoxDecoration(boxShadow: [ : BoxDecoration(boxShadow: [
// BoxShadow( // BoxShadow(
// color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // color: Color?.fromRGBO(70, 68, 167, focus ? 0.20 : 0),
// offset: Offset(0.0, 13.0), // offset: Offset(0.0, 13.0),
// blurRadius: focus ? 34.0 : 12.0) // blurRadius: focus ? 34.0 : 12.0)
BoxShadow( BoxShadow(
color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), color: Color?.fromRGBO(110, 68, 80, focus ? 0.20 : 0),
offset: Offset(0.0, 13.0), offset: Offset(0.0, 13.0),
blurRadius: focus ? 34.0 : 12.0) blurRadius: focus ? 34.0 : 12.0)
]), ]),
child: Column( child: Column(
children: [ children: [
TextFormField( TextFormField(
onTap: widget.onTapTextFields, onTap: widget.onTapTextFields,
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
// autovalidate: widget.autoValidate, // autovalidate: widget.autoValidate!,
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization!,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction! == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit! != null
? widget.onSubmit ? widget.onSubmit
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
: widget.onSubmit, : widget.onSubmit,
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, maxLengthEnforced: widget.maxLengthEnforced!,
initialValue: widget.initialValue, initialValue: widget.initialValue,
onChanged: (value) { onChanged: (value) {
if (widget.showLabelText) { if (widget.showLabelText!) {
if ((value == null || value == '')) { if ((value == null || value == '')) {
setState(() { setState(() {
widget.hasLabelText = false; widget.hasLabelText = false;
@ -251,27 +246,29 @@ class _TextFieldsState extends State<TextFields> {
}); });
} }
} }
if (widget.onChanged != null) widget.onChanged(value); if (widget.onChanged != null) widget.onChanged!(value);
}, },
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
controller: widget.controller, controller: widget.controller,
keyboardType: widget.keyboardType, keyboardType: widget.keyboardType,
readOnly: _determineReadOnly(), readOnly: _determineReadOnly()!,
obscureText: widget.type == "password" && !view ? true : false, obscureText: widget.type == "password" && !view ? true : false,
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.bodyText1.copyWith( style: Theme.of(context)
fontSize: widget.fontSize, fontWeight: widget.fontWeight), .textTheme
.bodyText1!
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
// WhitelistingTextInputFormatter.digitsOnly, // WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter, _mobileFormatter,
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hasLabelText ? widget.hintText : null, labelText: widget.hasLabelText! ? widget.hintText : null,
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
@ -281,68 +278,54 @@ class _TextFieldsState extends State<TextFields> {
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme.of(context).hintColor, color: widget.hintColor ?? Theme.of(context).hintColor,
), ),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding
: EdgeInsets.symmetric( : EdgeInsets.symmetric(
vertical: vertical: (widget.bare! && !widget.keepPadding!) ? 0.0 : 10.0, horizontal: 16.0),
(widget.bare && !widget.keepPadding) ? 0.0 : 10.0,
horizontal: 16.0),
filled: true, filled: true,
fillColor: widget.bare fillColor: widget.bare! ? Colors.transparent : Theme.of(context).backgroundColor,
? Colors.transparent
: Theme.of(context).backgroundColor,
suffixIcon: _buildSuffixIcon(), suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.prefixIcon, prefixIcon: widget.prefixIcon,
errorStyle: TextStyle( errorStyle: TextStyle(
fontSize: 12.0, fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError! ? 0.0 : null),
fontWeight: widget.fontWeight,
height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder!
? BorderSide( ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0)
color: Theme.of(context)
.errorColor
.withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder!
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
focusedErrorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder!
? BorderSide( ? BorderSide(
color: Theme.of(context) color: Theme.of(context).errorColor.withOpacity(widget.bare! ? 0.0 : 0.5), width: 1.0)
.errorColor
.withOpacity(widget.bare ? 0.0 : 0.5),
width: 1.0)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), borderRadius: BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder!
? BorderSide(color: widget.borderColor,width: widget.borderWidth) ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder!
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder!
? BorderSide(color: widget.borderColor,width: widget.borderWidth) ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder!
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)
: BorderRadius.circular(0.0)), : BorderRadius.circular(0.0)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: widget.hasBorder borderSide: widget.hasBorder!
? BorderSide(color: widget.borderColor,width: widget.borderWidth) ? BorderSide(color: widget.borderColor!, width: widget.borderWidth!)
: BorderSide(color: Colors.transparent, width: 0), : BorderSide(color: Colors.transparent, width: 0),
borderRadius: widget.hasBorder borderRadius: widget.hasBorder!
? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) ? BorderRadius.circular(widget.bare! ? 0.0 : widget.borderRadius!)
: BorderRadius.circular(0.0), : BorderRadius.circular(0.0),
), ),
), ),

@ -24,7 +24,7 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> { class _AppDrawerState extends State<AppDrawer> {
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; late ProjectViewModel projectsProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -87,11 +87,11 @@ class _AppDrawerState extends State<AppDrawer> {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: AppText( child: AppText(
TranslationBase.of(context).dr + TranslationBase.of(context).dr!+
capitalizeOnlyFirstLater( capitalizeOnlyFirstLater(
authenticationViewModel authenticationViewModel
.doctorProfile!.doctorName .doctorProfile!.doctorName!
.replaceAll("DR.", "") .replaceAll!("DR.", "")
.toLowerCase()), .toLowerCase()),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
@ -103,8 +103,8 @@ class _AppDrawerState extends State<AppDrawer> {
Padding( Padding(
padding: EdgeInsets.only(top: 0), padding: EdgeInsets.only(top: 0),
child: AppText( child: AppText(
authenticationViewModel authenticationViewModel!
.doctorProfile?.clinicDescription, .doctorProfile?.clinicDescription!!,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 16, fontSize: 16,
@ -118,7 +118,7 @@ class _AppDrawerState extends State<AppDrawer> {
SizedBox(height: 40), SizedBox(height: 40),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).applyOrRescheduleLeave, TranslationBase.of(context).applyOrRescheduleLeave!,
icon: DoctorApp.reschedule__1, icon: DoctorApp.reschedule__1,
// subTitle: , // subTitle: ,
@ -138,7 +138,9 @@ class _AppDrawerState extends State<AppDrawer> {
SizedBox(height: 15), SizedBox(height: 15),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).myQRCode, TranslationBase
.of(context)
.myQRCode!,
icon: DoctorApp.qr_code_3, icon: DoctorApp.qr_code_3,
// subTitle: , // subTitle: ,
), ),
@ -165,8 +167,12 @@ class _AppDrawerState extends State<AppDrawer> {
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
projectsProvider.isArabic projectsProvider.isArabic
? TranslationBase.of(context).lanEnglish ? TranslationBase
: TranslationBase.of(context).lanArabic, .of(context)
.lanEnglish ?? ""
: TranslationBase
.of(context)
.lanArabic ?? "",
// icon: DoctorApp.qr_code, // icon: DoctorApp.qr_code,
assetLink: projectsProvider.isArabic assetLink: projectsProvider.isArabic
? 'assets/images/usa-flag.png' ? 'assets/images/usa-flag.png'
@ -182,7 +188,9 @@ class _AppDrawerState extends State<AppDrawer> {
SizedBox(height: 10), SizedBox(height: 10),
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).logout, TranslationBase
.of(context)
.logout!,
icon: DoctorApp.logout_1, icon: DoctorApp.logout_1,
), ),
onTap: () async { onTap: () async {

@ -1,58 +0,0 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class AppExpandableNotifier extends StatelessWidget {
final Widget headerWid;
final Widget bodyWid;
AppExpandableNotifier({this.headerWid, this.bodyWid});
@override
Widget build(BuildContext context) {
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.all(10),
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: <Widget>[
SizedBox(
child: headerWid,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
header: Padding(
padding: EdgeInsets.all(10),
child: Text(
"${TranslationBase.of(context).graphDetails}",
style: TextStyle(fontWeight: FontWeight.bold),
)),
collapsed: Text(''),
expanded: bodyWid,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
child: Expandable(
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
),
initialExpanded: true,
);
}
}

@ -1,127 +0,0 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
/// App Expandable Notifier with animation
/// [headerWidget] widget want to show in the header
/// [bodyWidget] widget want to show in the body
/// [title] the widget title
/// [collapsed] The widget shown in the collapsed state
class AppExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final String title;
final Widget collapsed;
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
AppExpandableNotifier(
{this.headerWidget,
this.bodyWidget,
this.title,
this.collapsed,
this.isExpand = false});
_AppExpandableNotifier createState() => _AppExpandableNotifier();
}
class _AppExpandableNotifier extends State<AppExpandableNotifier> {
@override
void initState() {
setState(() {
if (widget.isExpand) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
}
});
super.initState();
}
@override
Widget build(BuildContext context) {
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 4),
child: Card(
color: Colors.grey[200],
clipBehavior: Clip.antiAlias,
child: Column(
children: <Widget>[
SizedBox(
child: widget.headerWidget,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
hasIcon: false,
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
header: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(10),
child: Text(
widget.title ?? TranslationBase.of(context).details,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2,
),
),
),
),
IconButton(
icon: new Container(
height: 28.0,
width: 30.0,
decoration: new BoxDecoration(
color: Theme.of(context).primaryColor,
shape: BoxShape.circle,
),
child: new Center(
child: new Icon(
widget.expandFlag
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.white,
size: 30.0,
),
),
),
onPressed: () {
setState(() {
widget.expandFlag = !widget.expandFlag;
widget.controller.expanded = widget.expandFlag;
});
}),
]),
collapsed: widget.collapsed ?? Container(),
expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 5, right: 5, bottom: 5),
child: Expandable(
controller: widget.controller,
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
),
);
}
}

@ -1,13 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:progress_hud_v2/progress_hud.dart';
import 'loader/gif_loader_container.dart'; import 'loader/gif_loader_container.dart';
class AppLoaderWidget extends StatefulWidget { class AppLoaderWidget extends StatefulWidget {
AppLoaderWidget({Key ? key, this.title, this.containerColor}) : super(key: key); AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key);
final String title; final String? title;
final Color containerColor; final Color? containerColor;
@override @override
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); _AppLoaderWidgetState createState() => new _AppLoaderWidgetState();

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/profile/patient_profile_app_bar_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -12,18 +13,20 @@ import 'network_base_view.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget? body;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final Widget bottomSheet; final Widget? bottomSheet;
final Color backgroundColor; final Color? backgroundColor;
final Widget appBar; final PreferredSizeWidget? appBar;
final Widget drawer; final Widget? drawer;
final Widget bottomNavigationBar; final Widget? bottomNavigationBar;
final String subtitle; final String? subtitle;
final bool isHomeIcon; final bool isHomeIcon;
final bool extendBody; final bool extendBody;
final PatientProfileAppBarModel? patientProfileAppBarModel;
AppScaffold( AppScaffold(
{this.appBarTitle = '', {this.appBarTitle = '',
this.body, this.body,
@ -33,7 +36,10 @@ class AppScaffold extends StatelessWidget {
this.bottomSheet, this.bottomSheet,
this.backgroundColor, this.backgroundColor,
this.isHomeIcon = true, this.isHomeIcon = true,
this.appBar, this.subtitle, this.drawer, this.extendBody = false, this.bottomNavigationBar});
this.subtitle,
this.patientProfileAppBarModel,
this.drawer, this.extendBody = false, this.bottomNavigationBar, this.appBar});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,8 +68,11 @@ class AppScaffold extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(appBarTitle.toUpperCase()), Text(appBarTitle.toUpperCase()),
if(subtitle!=null) if (subtitle != null)
Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), Text(
subtitle!,
style: TextStyle(fontSize: 12, color: Colors.red),
),
], ],
), ),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {
@ -93,8 +102,7 @@ class AppScaffold extends StatelessWidget {
baseViewModel: baseViewModel, baseViewModel: baseViewModel,
child: body, child: body,
) )
: Stack( : Stack(children: <Widget>[body!, buildAppLoaderWidget(isLoading)])
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -7,33 +7,33 @@ import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class AppText extends StatefulWidget { class AppText extends StatefulWidget {
final String text; final String? text;
final String variant; final String? variant;
final Color color; final Color? color;
final FontWeight fontWeight; final FontWeight? fontWeight;
final double fontSize; final double? fontSize;
final double fontHeight; final double? fontHeight;
final String fontFamily; final String? fontFamily;
final int maxLength; final int? maxLength;
final bool italic; final bool? italic;
final double margin; final double? margin;
final double marginTop; final double? marginTop;
final double marginRight; final double? marginRight;
final double marginBottom; final double? marginBottom;
final double marginLeft; final double? marginLeft;
final double letterSpacing; final double? letterSpacing;
final TextAlign textAlign; final TextAlign? textAlign;
final bool bold; final bool? bold;
final bool regular; final bool? regular;
final bool medium; final bool? medium;
final int maxLines; final int? maxLines;
final bool readMore; final bool? readMore;
final String style; final String? style;
final bool allowExpand; final bool? allowExpand;
final bool visibility; final bool? visibility;
final TextOverflow textOverflow; final TextOverflow? textOverflow;
final TextDecoration textDecoration; final TextDecoration? textDecoration;
final bool isCopyable; final bool? isCopyable;
AppText( AppText(
this.text, { this.text, {
@ -77,9 +77,9 @@ class _AppTextState extends State<AppText> {
void didUpdateWidget(covariant AppText oldWidget) { void didUpdateWidget(covariant AppText oldWidget) {
setState(() { setState(() {
if (widget.style == "overline") if (widget.style == "overline")
text = widget.text.toUpperCase(); text = widget.text!.toUpperCase();
else { else {
text = widget.text; text = widget.text!;
} }
}); });
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
@ -87,11 +87,11 @@ class _AppTextState extends State<AppText> {
@override @override
void initState() { void initState() {
hidden = widget.readMore; hidden = widget.readMore!;
if (widget.style == "overline") if (widget.style == "overline")
text = widget.text.toUpperCase(); text = widget.text!.toUpperCase();
else { else {
text = widget.text; text = widget.text!;
} }
super.initState(); super.initState();
} }
@ -101,12 +101,9 @@ class _AppTextState extends State<AppText> {
return GestureDetector( return GestureDetector(
child: Container( child: Container(
margin: widget.margin != null margin: widget.margin != null
? EdgeInsets.all(widget.margin) ? EdgeInsets.all(widget.margin!)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.marginTop, top: widget.marginTop!, right: widget.marginRight!, bottom: widget.marginBottom!, left: widget.marginLeft!),
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -114,7 +111,7 @@ class _AppTextState extends State<AppText> {
Stack( Stack(
children: [ children: [
_textWidget(), _textWidget(),
if (widget.readMore && text.length > widget.maxLength && hidden) if (widget.readMore! && text.length > widget.maxLength! && hidden)
Positioned( Positioned(
bottom: 0, bottom: 0,
left: 0, left: 0,
@ -133,9 +130,7 @@ class _AppTextState extends State<AppText> {
) )
], ],
), ),
if (widget.allowExpand && if (widget.allowExpand! && widget.readMore! && text.length > widget.maxLength!)
widget.readMore &&
text.length > widget.maxLength)
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell( child: InkWell(
@ -165,20 +160,14 @@ class _AppTextState extends State<AppText> {
} }
Widget _textWidget() { Widget _textWidget() {
if (widget.isCopyable) { if (widget.isCopyable!) {
return Theme( return Theme(
data: ThemeData( data: ThemeData(
textSelectionColor: Colors.lightBlueAccent, textSelectionColor: Colors.lightBlueAccent,
), ),
child: Container( child: Container(
child: SelectableText( child: SelectableText(
!hidden !hidden ? text : (text.substring(0, text.length > widget.maxLength! ? widget.maxLength : text.length)),
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
// overflow: widget.maxLines != null // overflow: widget.maxLines != null
// ? ((widget.maxLines > 1) // ? ((widget.maxLines > 1)
@ -188,12 +177,12 @@ class _AppTextState extends State<AppText> {
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight) height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: color:
widget.color != null ? widget.color : Color(0xff2E303A), widget.color != null ? widget.color : Color(0xff2E303A),
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
@ -212,24 +201,24 @@ class _AppTextState extends State<AppText> {
? text ? text
: (text.substring( : (text.substring(
0, 0,
text.length > widget.maxLength text.length > widget.maxLength!
? widget.maxLength ? widget.maxLength
: text.length)), : text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null overflow: widget.maxLines != null
? ((widget.maxLines > 1) ? ((widget.maxLines! > 1)
? TextOverflow.fade ? TextOverflow.fade
: TextOverflow.ellipsis) : TextOverflow.ellipsis)
: null, : null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color, color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight) height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic! ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? letterSpacing: widget.letterSpacing ??
@ -245,27 +234,27 @@ class _AppTextState extends State<AppText> {
TextStyle _getFontStyle() { TextStyle _getFontStyle() {
switch (widget.style) { switch (widget.style) {
case "headline2": case "headline2":
return Theme.of(context).textTheme.headline2; return Theme.of(context).textTheme.headline2!;
case "headline3": case "headline3":
return Theme.of(context).textTheme.headline3; return Theme.of(context).textTheme.headline3!;
case "headline4": case "headline4":
return Theme.of(context).textTheme.headline4; return Theme.of(context).textTheme.headline4!;
case "headline5": case "headline5":
return Theme.of(context).textTheme.headline5; return Theme.of(context).textTheme.headline5!;
case "headline6": case "headline6":
return Theme.of(context).textTheme.headline6; return Theme.of(context).textTheme.headline6!;
case "bodyText2": case "bodyText2":
return Theme.of(context).textTheme.bodyText2; return Theme.of(context).textTheme.bodyText2!;
case "bodyText_15": case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); return Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: 15.0);
case "bodyText1": case "bodyText1":
return Theme.of(context).textTheme.bodyText1; return Theme.of(context).textTheme.bodyText1!;
case "caption": case "caption":
return Theme.of(context).textTheme.caption; return Theme.of(context).textTheme.caption!;
case "overline": case "overline":
return Theme.of(context).textTheme.overline; return Theme.of(context).textTheme.overline!;
case "button": case "button":
return Theme.of(context).textTheme.button; return Theme.of(context).textTheme.button!;
default: default:
return TextStyle(); return TextStyle();
} }
@ -350,7 +339,7 @@ class _AppTextState extends State<AppText> {
return FontWeight.w500; return FontWeight.w500;
} }
} else { } else {
return null; return FontWeight.normal;
} }
} }
} }

@ -13,7 +13,7 @@ class BottomNavBar extends StatefulWidget {
DashboardViewModel dashboardViewModel = DashboardViewModel(); DashboardViewModel dashboardViewModel = DashboardViewModel();
BottomNavBar({Key ? key, this.changeIndex, this.index}) : super(key: key); BottomNavBar({Key? key, required this.changeIndex, required this.index}) : super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();

@ -20,16 +20,18 @@ class BottomNavigationItem extends StatelessWidget {
final String? name; final String? name;
final DashboardViewModel? dashboardViewModel; final DashboardViewModel? dashboardViewModel;
String svgPath;
BottomNavigationItem( BottomNavigationItem(
{this.icon, {this.icon,
this.activeIcon, this.activeIcon,
this.changeIndex, required this.changeIndex,
this.index, this.index,
this.currentIndex, required this.currentIndex,
this.name, this.name,
this.dashboardViewModel, this.dashboardViewModel,
this.svgPath}); required this.svgPath});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -89,7 +91,7 @@ class BottomNavigationItem extends StatelessWidget {
], ],
), ),
if (currentIndex == 3 && if (currentIndex == 3 &&
dashboardViewModel.notRepliedCount != 0) dashboardViewModel?.notRepliedCount != 0)
Positioned( Positioned(
right: 18.0, right: 18.0,
bottom: 40.0, bottom: 40.0,
@ -102,7 +104,7 @@ class BottomNavigationItem extends StatelessWidget {
badgeContent: Container( badgeContent: Container(
// padding: EdgeInsets.all(2.0), // padding: EdgeInsets.all(2.0),
child: AppText( child: AppText(
dashboardViewModel.notRepliedCount.toString(), dashboardViewModel?.notRepliedCount.toString(),
color: Colors.white, color: Colors.white,
fontSize: 12.0), fontSize: 12.0),
), ),

@ -8,23 +8,23 @@ import 'package:hexcolor/hexcolor.dart';
import '../app_texts_widget.dart'; import '../app_texts_widget.dart';
class AppButton extends StatefulWidget { class AppButton extends StatefulWidget {
final GestureTapCallback onPressed; final GestureTapCallback? onPressed;
final String title; final String? title;
final IconData iconData; final IconData? iconData;
final Widget icon; final Widget? icon;
final Color color; final Color? color;
final double fontSize; final double? fontSize;
final double padding; final double? padding;
final Color fontColor; final Color? fontColor;
final bool loading; final bool? loading;
final bool disabled; final bool? disabled;
final FontWeight fontWeight; final FontWeight? fontWeight;
final bool hasBorder; final bool? hasBorder;
final Color borderColor; final Color? borderColor;
final double radius; final double? radius;
final double vPadding; final double? vPadding;
final double hPadding; final double? hPadding;
final double height; final double? height;
AppButton({ AppButton({
@required this.onPressed, @required this.onPressed,
@ -56,21 +56,20 @@ class _AppButtonState extends State<AppButton> {
// height: MediaQuery.of(context).size.height * 0.075, // height: MediaQuery.of(context).size.height * 0.075,
height: widget.height, height: widget.height,
child: IgnorePointer( child: IgnorePointer(
ignoring: widget.loading || widget.disabled, ignoring: widget.loading! || widget.disabled!,
child: RawMaterialButton( child: RawMaterialButton(
fillColor: widget.disabled fillColor: widget.disabled!
? Colors.grey ? Colors.grey
: widget.color != null : widget.color != null
? widget.color ? widget.color
: HexColor("#D02127"), : HexColor("#D02127"),
splashColor: widget.color, splashColor: widget.color,
child: Padding( child: Padding(
padding: (widget.hPadding > 0 || widget.vPadding > 0) padding: (widget.hPadding! > 0 || widget.vPadding! > 0)
? EdgeInsets.symmetric( ? EdgeInsets.symmetric(vertical: widget.vPadding!, horizontal: widget.hPadding!)
vertical: widget.vPadding, horizontal: widget.hPadding)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.padding, top: widget.padding!,
bottom: widget.padding, bottom: widget.padding!,
//right: SizeConfig.widthMultiplier * widget.padding, //right: SizeConfig.widthMultiplier * widget.padding,
//left: SizeConfig.widthMultiplier * widget.padding //left: SizeConfig.widthMultiplier * widget.padding
), ),
@ -89,7 +88,7 @@ class _AppButtonState extends State<AppButton> {
SizedBox( SizedBox(
width: 5.0, width: 5.0,
), ),
widget.loading widget.loading!
? Padding( ? Padding(
padding: EdgeInsets.all(2.6), padding: EdgeInsets.all(2.6),
child: SizedBox( child: SizedBox(
@ -98,7 +97,7 @@ class _AppButtonState extends State<AppButton> {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[300], Colors.grey[300]!,
), ),
), ),
), ),
@ -115,17 +114,17 @@ class _AppButtonState extends State<AppButton> {
], ],
), ),
), ),
onPressed: widget.disabled ? () {} : widget.onPressed, onPressed: widget.disabled! ? () {} : widget.onPressed,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: widget.hasBorder color: (widget.hasBorder!
? widget.borderColor ? widget.borderColor
: widget.disabled : widget.disabled!
? Colors.grey ? Colors.grey!
: widget.color ?? Color(0xFFB8382C), : widget.color) ?? Color(0xFFB8382C),
width: 0.8, width: 0.8,
), ),
borderRadius: BorderRadius.all(Radius.circular(widget.radius))), borderRadius: BorderRadius.all(Radius.circular(widget.radius!))),
), ),
), ),
); );

@ -3,25 +3,25 @@ import 'package:flutter/material.dart';
import 'app_buttons_widget.dart'; import 'app_buttons_widget.dart';
class ButtonBottomSheet extends StatelessWidget { class ButtonBottomSheet extends StatelessWidget {
final GestureTapCallback? onPressed;
final String? title;
final IconData? iconData;
final Widget? icon;
final Color? color;
final double? fontSize;
final double? padding;
final Color? fontColor;
final bool? loading;
final bool? disabled;
final FontWeight? fontWeight;
final bool? hasBorder;
final Color? borderColor;
final double? radius;
final double? vPadding;
final double? hPadding;
final GestureTapCallback onPressed; ButtonBottomSheet({
final String title; @required this.onPressed,
final IconData iconData;
final Widget icon;
final Color color;
final double fontSize;
final double padding;
final Color fontColor;
final bool loading;
final bool disabled;
final FontWeight fontWeight;
final bool hasBorder;
final Color borderColor;
final double radius;
final double vPadding;
final double hPadding;
ButtonBottomSheet({@required this.onPressed,
this.title, this.title,
this.iconData, this.iconData,
this.icon, this.icon,

@ -15,7 +15,7 @@ import 'package:provider/provider.dart';
/// [noBorderRadius] remove border radius /// [noBorderRadius] remove border radius
class SecondaryButton extends StatefulWidget { class SecondaryButton extends StatefulWidget {
SecondaryButton( SecondaryButton(
{Key ? key, {Key? key,
this.label = "", this.label = "",
this.icon, this.icon,
this.iconOnly = false, this.iconOnly = false,
@ -30,12 +30,12 @@ class SecondaryButton extends StatefulWidget {
: super(key: key); : super(key: key);
final String label; final String label;
final Widget icon; final Widget? icon;
final VoidCallback onTap; final VoidCallback? onTap;
final bool loading; final bool loading;
final Color color; final Color? color;
final Color textColor; final Color textColor;
final Color borderColor; final Color? borderColor;
final bool small; final bool small;
final bool iconOnly; final bool iconOnly;
final bool disabled; final bool disabled;
@ -45,15 +45,14 @@ class SecondaryButton extends StatefulWidget {
_SecondaryButtonState createState() => _SecondaryButtonState(); _SecondaryButtonState createState() => _SecondaryButtonState();
} }
class _SecondaryButtonState extends State<SecondaryButton> class _SecondaryButtonState extends State<SecondaryButton> with TickerProviderStateMixin {
with TickerProviderStateMixin {
double _buttonSize = 1.0; double _buttonSize = 1.0;
AnimationController _animationController; late AnimationController _animationController;
Animation _animation; late Animation _animation;
double _rippleSize = 0.0; double _rippleSize = 0.0;
AnimationController _rippleController; late AnimationController _rippleController;
Animation _rippleAnimation; late Animation _rippleAnimation;
@override @override
void initState() { void initState() {
@ -142,7 +141,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
_animationController.forward(); _animationController.forward();
}, },
onTap: () => { onTap: () => {
widget.disabled ? null : widget.onTap(), widget.disabled ? null : widget.onTap!(),
}, },
// onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
@ -151,8 +150,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: widget.borderColor != null border: widget.borderColor != null
? Border.all( ? Border.all(color: widget.borderColor!.withOpacity(0.1), width: 2.0)
color: widget.borderColor.withOpacity(0.1), width: 2.0)
: null, : null,
borderRadius: BorderRadius.all(Radius.circular(100.0)), borderRadius: BorderRadius.all(Radius.circular(100.0)),
boxShadow: [ boxShadow: [
@ -224,9 +222,8 @@ class _SecondaryButtonState extends State<SecondaryButton>
width: 19.0, width: 19.0,
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: valueColor: AlwaysStoppedAnimation<Color>(
AlwaysStoppedAnimation<Color>( Colors.grey[300]!,
Colors.grey[300],
), ),
), ),
), ),

@ -12,7 +12,7 @@ import 'package:hexcolor/hexcolor.dart';
class CardWithBgWidgetNew extends StatelessWidget { class CardWithBgWidgetNew extends StatelessWidget {
final Widget widget; final Widget widget;
CardWithBgWidgetNew({@required this.widget}); CardWithBgWidgetNew({required this.widget});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -11,8 +11,8 @@ class CardWithBgWidget extends StatelessWidget {
final double marginSymmetric; final double marginSymmetric;
CardWithBgWidget( CardWithBgWidget(
{@required this.widget, { required this.widget,
this.bgColor, required this.bgColor,
this.hasBorder = true, this.hasBorder = true,
this.padding = 15.0, this.padding = 15.0,
this.marginLeft = 10.0, this.marginLeft = 10.0,

@ -1,41 +0,0 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
/*
*@author: Elham Rababah
*@Date:03/6/2020
*@param:
*@return:
*@desc: AppLineChart
*/
class AppLineChart extends StatelessWidget {
const AppLineChart({
Key ? key,
@required this.seriesList,
this.chartTitle,
}) : super(key: key);
final List<charts.Series> seriesList;
final String chartTitle;
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: <Widget>[
Text(
'Body Mass Index',
style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold),
),
Expanded(
child: charts.LineChart(seriesList,
defaultRenderer: new charts.LineRendererConfig(
includeArea: false, stacked: true),
animate: true),
),
],
),
);
}
}

@ -1,121 +0,0 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:flutter/material.dart';
import '../../../config/size_config.dart';
import '../../../models/patient/vital_sign/vital_sign_res_model.dart';
import '../../../widgets/shared/rounded_container_widget.dart';
/*
*@author: Elham Rababah
*@Date:03/6/2020
*@param:
*@return:
*@desc: AppTimeSeriesChart
*/
class AppTimeSeriesChart extends StatelessWidget {
AppTimeSeriesChart(
{Key ? key,
@required this.vitalList,
@required this.viewKey,
this.chartName = ''});
final List<VitalSignResModel> vitalList;
final String chartName;
final String viewKey;
List<charts.Series> seriesList;
@override
Widget build(BuildContext context) {
seriesList = generateData();
return RoundedContainer(
height: SizeConfig.realScreenHeight * 0.47,
child: Column(
children: <Widget>[
Text(
chartName,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 3),
),
Container(
height: SizeConfig.realScreenHeight * 0.37,
child: Center(
child: Container(
child: charts.TimeSeriesChart(
seriesList,
animate: true,
behaviors: [
new charts.RangeAnnotation(
[
new charts.RangeAnnotationSegment(
DateTime(
vitalList[vitalList.length - 1]
.vitalSignDate
.year,
vitalList[vitalList.length - 1]
.vitalSignDate
.month +
3,
vitalList[vitalList.length - 1]
.vitalSignDate
.day),
vitalList[0].vitalSignDate,
charts.RangeAnnotationAxisType.domain),
],
),
],
),
),
),
),
],
),
);
}
/*
*@author: Elham Rababah
*@Date:03/6/2020
*@param:
*@return:
*@desc: generateData
*/
generateData() {
final List<TimeSeriesSales> data = [];
if (vitalList.length > 0) {
vitalList.forEach(
(element) {
data.add(
TimeSeriesSales(
new DateTime(element.vitalSignDate.year,
element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey].toInt(),
),
);
},
);
}
return [
new charts.Series<TimeSeriesSales, DateTime>(
id: 'Sales',
domainFn: (TimeSeriesSales sales, _) => sales.time,
measureFn: (TimeSeriesSales sales, _) => sales.sales,
data: data,
)
];
}
}
/*
*@author: Elham Rababah
*@Date:03/6/2020
*@param:
*@return:
*@desc: TimeSeriesSales
*/
class TimeSeriesSales {
final DateTime time;
final int sales;
TimeSeriesSales(this.time, this.sales);
}

@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class ShowImageDialog extends StatelessWidget { class ShowImageDialog extends StatelessWidget {
final String imageUrl; final String imageUrl;
const ShowImageDialog({Key ? key, this.imageUrl}) : super(key: key); const ShowImageDialog({Key? key, required this.imageUrl}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SimpleDialog( return SimpleDialog(

@ -9,16 +9,16 @@ class ListSelectDialog extends StatefulWidget {
final okText; final okText;
final Function(dynamic) okFunction; final Function(dynamic) okFunction;
dynamic selectedValue; dynamic selectedValue;
final Widget searchWidget; final Widget? searchWidget;
final bool usingSearch; final bool usingSearch;
final String hintSearchText; final String? hintSearchText;
ListSelectDialog({ ListSelectDialog({
@required this.list, required this.list,
@required this.attributeName, required this.attributeName,
@required this.attributeValueId, required this.attributeValueId,
@required this.okText, @required this.okText,
@required this.okFunction, required this.okFunction,
this.searchWidget, this.searchWidget,
this.usingSearch = false, this.usingSearch = false,
this.hintSearchText, this.hintSearchText,
@ -46,7 +46,7 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = FlatButton(
child: Text(TranslationBase.of(context).cancel), child: Text(TranslationBase.of(context).cancel ?? ""),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
@ -73,13 +73,13 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.5,
child: Column( child: Column(
children: [ children: [
if (widget.searchWidget != null) widget.searchWidget, if (widget.searchWidget != null) widget.searchWidget!,
if (widget.usingSearch) if (widget.usingSearch)
Container( Container(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
child: TextField( child: TextField(
decoration: Helpers.textFieldSelectorDecoration( decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase.of(context).search, null, false, widget.hintSearchText ?? TranslationBase.of(context).search??"", "", false,
suffixIcon: Icon( suffixIcon: Icon(
Icons.search, Icons.search,
)), )),

@ -12,15 +12,11 @@ class MasterKeyDailog extends StatefulWidget {
final List<MasterKeyModel> list; final List<MasterKeyModel> list;
final okText; final okText;
final Function(MasterKeyModel) okFunction; final Function(MasterKeyModel) okFunction;
MasterKeyModel selectedValue; MasterKeyModel? selectedValue;
final bool isICD; final bool isICD;
MasterKeyDailog( MasterKeyDailog(
{@required this.list, {required this.list, required this.okText, required this.okFunction, this.selectedValue, this.isICD = false});
@required this.okText,
@required this.okFunction,
this.selectedValue,
this.isICD = false});
@override @override
_MasterKeyDailogState createState() => _MasterKeyDailogState(); _MasterKeyDailogState createState() => _MasterKeyDailogState();
@ -42,14 +38,14 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) {
// set up the buttons // set up the buttons
Widget cancelButton = FlatButton( Widget cancelButton = FlatButton(
child: AppText(TranslationBase.of(context).cancel, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), child: AppText(TranslationBase.of(context)!.cancel!, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
Widget continueButton = FlatButton( Widget continueButton = FlatButton(
child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),), child: AppText(this.widget.okText, color: Colors.grey,fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge?3.5:5),),
onPressed: () { onPressed: () {
this.widget.okFunction(widget.selectedValue); this.widget.okFunction(widget.selectedValue!);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
// set up the AlertDialog // set up the AlertDialog
@ -72,23 +68,15 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
children: [ children: [
...widget.list ...widget.list
.map((item) => RadioListTile( .map((item) => RadioListTile(
title: AppText( title: AppText('${projectViewModel.isArabic ? item.nameAr : item.nameEn}' +
'${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''),),
(widget.isICD ? '/${item.code}' : ''), groupValue:
widget.isICD ? widget.selectedValue!.code.toString() : widget.selectedValue!.id.toString(),
), value: widget.isICD ? widget.selectedValue!.code.toString() : item.id.toString(),
groupValue: widget.isICD
? widget.selectedValue.code.toString()
: widget.selectedValue.id.toString(),
value: widget.isICD
? widget.selectedValue.code.toString()
: item.id.toString(),
activeColor: Colors.blue.shade700, activeColor: Colors.blue.shade700,
selected: widget.isICD selected: widget.isICD
? item.code.toString() == ? item.code.toString() == widget.selectedValue!.code.toString()
widget.selectedValue.code.toString() : item.id.toString() == widget.selectedValue!.id.toString(),
: item.id.toString() ==
widget.selectedValue.id.toString(),
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
widget.selectedValue = item; widget.selectedValue = item;

@ -1,92 +0,0 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
class ListSelectDialog extends StatefulWidget {
final List<dynamic> list;
final String attributeName;
final String attributeValueId;
final okText;
final Function(dynamic) okFunction;
dynamic selectedValue;
ListSelectDialog(
{@required this.list,
@required this.attributeName,
@required this.attributeValueId,
@required this.okText,
@required this.okFunction});
@override
_ListSelectDialogState createState() => _ListSelectDialogState();
}
class _ListSelectDialogState extends State<ListSelectDialog> {
@override
void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.list[0];
}
@override
Widget build(BuildContext context) {
return showAlertDialog(context);
}
showAlertDialog(BuildContext context) {
// set up the buttons
Widget cancelButton = FlatButton(
child: Text(TranslationBase.of(context).cancel),
onPressed: () {
Navigator.of(context).pop();
});
Widget continueButton = FlatButton(
child: Text(this.widget.okText),
onPressed: () {
this.widget.okFunction(widget.selectedValue);
Navigator.of(context).pop();
});
// set up the AlertDialog
AlertDialog alert = AlertDialog(
// title: Text(widget.title),
content: createDialogList(),
actions: [
cancelButton,
continueButton,
],
);
return alert;
}
Widget createDialogList() {
return Container(
height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView(
child: Column(
children: [
...widget.list
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId]
.toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId]
.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
),
);
}
static closeAlertDialog(BuildContext context) {
Navigator.of(context).pop();
}
}

@ -13,9 +13,9 @@ class DoctorCard extends StatelessWidget {
final String branch; final String branch;
final DateTime appointmentDate; final DateTime appointmentDate;
final String profileUrl; final String profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final Function onTap; final GestureTapCallback? onTap;
final bool isPrescriptions; final bool isPrescriptions;
final String clinic; final String clinic;
final bool isShowEye; final bool isShowEye;
@ -23,15 +23,15 @@ class DoctorCard extends StatelessWidget {
final bool isNoMargin; final bool isNoMargin;
DoctorCard( DoctorCard(
{this.doctorName, {required this.doctorName,
this.branch, required this.branch,
this.profileUrl, required this.profileUrl,
this.invoiceNO, this.invoiceNO,
this.onTap, this.onTap,
this.appointmentDate, required this.appointmentDate,
this.orderNo, this.orderNo,
this.isPrescriptions = false, this.isPrescriptions = false,
this.clinic, required this.clinic,
this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false});
@override @override
@ -59,7 +59,7 @@ class DoctorCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
doctorName ?? "", doctorName,
fontSize: 15, fontSize: 15,
bold: true, bold: true,
)), )),
@ -73,7 +73,7 @@ class DoctorCard extends StatelessWidget {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
if (!isPrescriptions&& isShowTime) if (!isPrescriptions && isShowTime)
AppText( AppText(
'${AppDateUtils.getHour(appointmentDate)}', '${AppDateUtils.getHour(appointmentDate)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -110,7 +110,7 @@ class DoctorCard extends StatelessWidget {
Row( Row(
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).orderNo + TranslationBase.of(context).orderNo??"" +
" ", " ",
color: Colors.grey[500], color: Colors.grey[500],
fontSize: 14, fontSize: 14,
@ -126,7 +126,7 @@ class DoctorCard extends StatelessWidget {
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context) TranslationBase.of(context)
.invoiceNo + .invoiceNo! +
" ", " ",
fontSize: 14, fontSize: 14,
color: Colors.grey[500], color: Colors.grey[500],
@ -142,7 +142,7 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).clinic + TranslationBase.of(context).clinic! +
": ", ": ",
color: Colors.grey[500], color: Colors.grey[500],
fontSize: 14, fontSize: 14,
@ -160,7 +160,7 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).branch + TranslationBase.of(context).branch!+
": ", ": ",
fontSize: 14, fontSize: 14,
color: Colors.grey[500], color: Colors.grey[500],

@ -10,22 +10,25 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class DoctorCardInsurance extends StatelessWidget { class DoctorCardInsurance extends StatelessWidget {
final String doctorName; final String? doctorName;
final String approvalNo; final String? branch;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String? profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final Function onTap; final GestureTapCallback? onTap;
final bool isInsurance; final bool? isPrescriptions;
final String clinic; final String? clinic;
final String approvalStatus; final String? approvalStatus;
final String patientOut; final String? patientOut;
final String branch2; final String? branch2;
final bool? isInsurance;
final String? approvalNo;
DoctorCardInsurance( DoctorCardInsurance(
{this.doctorName, {this.doctorName,
this.approvalNo, this.branch,
this.profileUrl, this.profileUrl,
this.invoiceNO, this.invoiceNO,
this.onTap, this.onTap,
@ -35,7 +38,7 @@ class DoctorCardInsurance extends StatelessWidget {
this.clinic, this.clinic,
this.approvalStatus, this.approvalStatus,
this.patientOut, this.patientOut,
this.branch2}); this.branch2, this.isPrescriptions, this.approvalNo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -129,7 +132,7 @@ class DoctorCardInsurance extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
child: LargeAvatar( child: LargeAvatar(
name: doctorName, name: doctorName??"",
url: profileUrl, url: profileUrl,
), ),
width: 55, width: 55,
@ -142,36 +145,36 @@ class DoctorCardInsurance extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if (orderNo != null && !isInsurance) if (orderNo != null && !isInsurance!)
CustomRow( CustomRow(
label: 'Invoice:', label: 'Invoice:',
value: invoiceNO, value: invoiceNO??"",
), ),
if (invoiceNO != null && !isInsurance) if (invoiceNO != null && !isInsurance!)
CustomRow( CustomRow(
label: 'Invoice:', label: 'Invoice:',
value: invoiceNO, value: invoiceNO??'',
), ),
if (isInsurance) if (isInsurance!)
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).clinic + TranslationBase.of(context).clinic! +
": ", ": ",
value: clinic, value: clinic??'',
), ),
if (branch2 != null) if (branch2 != null)
CustomRow( CustomRow(
label: label:
TranslationBase.of(context).branch + TranslationBase.of(context).branch! +
": ", ": ",
value: branch2, value: branch2??'',
), ),
if (approvalNo != null) if (approvalNo != null)
CustomRow( CustomRow(
label: TranslationBase.of(context) label: TranslationBase.of(context)
.approvalNo + .approvalNo! +
": ", ": ",
value: approvalNo, value: approvalNo!,
), ),
]), ]),
), ),

@ -8,12 +8,12 @@ import '../shared/app_texts_widget.dart';
class DrawerItem extends StatefulWidget { class DrawerItem extends StatefulWidget {
final String title; final String title;
final String subTitle; final String subTitle;
final IconData icon; final IconData? icon;
final Color color; final Color? color;
final String assetLink; final String? assetLink;
final double? drawerWidth;
DrawerItem(this.title, DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink, this.drawerWidth});
{this.icon, this.color, this.subTitle = '', this.assetLink});
@override @override
_DrawerItemState createState() => _DrawerItemState(); _DrawerItemState createState() => _DrawerItemState();
@ -31,7 +31,7 @@ class _DrawerItemState extends State<DrawerItem> {
Container( Container(
height: 20, height: 20,
width: 20, width: 20,
child: Image.asset(widget.assetLink), child: Image.asset(widget.assetLink!),
), ),
if (widget.assetLink == null) if (widget.assetLink == null)
Icon( Icon(

@ -11,8 +11,8 @@ import '../app_texts_widget.dart';
*/ */
class DrAppEmbeddedError extends StatelessWidget { class DrAppEmbeddedError extends StatelessWidget {
const DrAppEmbeddedError({ const DrAppEmbeddedError({
Key ? key, Key? key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;

@ -5,8 +5,8 @@ import '../app_texts_widget.dart';
class ErrorMessage extends StatelessWidget { class ErrorMessage extends StatelessWidget {
const ErrorMessage({ const ErrorMessage({
Key ? key, Key? key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;

@ -2,10 +2,10 @@ import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HeaderBodyExpandableNotifier extends StatefulWidget { class HeaderBodyExpandableNotifier extends StatefulWidget {
final Widget headerWidget; final Widget? headerWidget;
final Widget bodyWidget; final Widget? bodyWidget;
final Widget collapsed; final Widget? collapsed;
final bool isExpand; final bool? isExpand;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = new ExpandableController();
@ -28,7 +28,7 @@ class _HeaderBodyExpandableNotifierState
Widget build(BuildContext context) { Widget build(BuildContext context) {
setState(() { setState(() {
if (widget.isExpand == true) { if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand; widget.expandFlag = widget.isExpand!;
widget.controller.expanded = true; widget.controller.expanded = true;
} }
}); });
@ -50,7 +50,7 @@ class _HeaderBodyExpandableNotifierState
), ),
// header: widget.headerWidget, // header: widget.headerWidget,
collapsed: Container(), collapsed: Container(),
expanded: widget.bodyWidget, expanded: widget.bodyWidget!,
builder: (_, collapsed, expanded) { builder: (_, collapsed, expanded) {
return Padding( return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),

@ -6,17 +6,15 @@ class GifLoaderContainer extends StatefulWidget {
_GifLoaderContainerState createState() => _GifLoaderContainerState(); _GifLoaderContainerState createState() => _GifLoaderContainerState();
} }
class _GifLoaderContainerState extends State<GifLoaderContainer> class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProviderStateMixin {
with TickerProviderStateMixin { late GifController controller1;
GifController controller1;
@override @override
void initState() { void initState() {
controller1 = GifController(vsync: this); controller1 = GifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance!.addPostFrameCallback((_) {
controller1.repeat( controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
}); });
super.initState(); super.initState();
} }

@ -19,17 +19,17 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) addHistory; final Function(MasterKeyModel) addHistory;
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList; final List<MasterKeyModel> masterList;
final String buttonName; final String? buttonName;
final String hintSearchText; final String? hintSearchText;
MasterKeyCheckboxSearchWidget( MasterKeyCheckboxSearchWidget(
{Key ? key, {Key? key,
this.model, required this.model,
this.addSelectedHistories, required this.addSelectedHistories,
this.removeHistory, required this.removeHistory,
this.masterList, required this.masterList,
this.addHistory, required this.addHistory,
this.isServiceSelected, required this.isServiceSelected,
this.buttonName, this.buttonName,
this.hintSearchText}) this.hintSearchText})
: super(key: key); : super(key: key);
@ -86,10 +86,11 @@ class _MasterKeyCheckboxSearchWidgetState
filterSearchResults(value); filterSearchResults(value);
}, },
suffixIcon: IconButton( suffixIcon: IconButton(
onPressed: () {},
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
)), )),
), ),
// SizedBox(height: 15,), // SizedBox(height: 15,),
@ -113,13 +114,11 @@ class _MasterKeyCheckboxSearchWidgetState
child: Row( child: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget value: widget.isServiceSelected(historyInfo),
.isServiceSelected(historyInfo),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.isServiceSelected( if (widget.isServiceSelected(historyInfo)) {
historyInfo)) {
widget.removeHistory(historyInfo); widget.removeHistory(historyInfo);
} else { } else {
widget.addHistory(historyInfo); widget.addHistory(historyInfo);
@ -167,8 +166,8 @@ class _MasterKeyCheckboxSearchWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || if (item.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
item.nameEn.toLowerCase().contains(query.toLowerCase())) { item.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });

@ -7,10 +7,10 @@ import 'app_loader_widget.dart';
import 'errors/error_message.dart'; import 'errors/error_message.dart';
class NetworkBaseView extends StatelessWidget { class NetworkBaseView extends StatelessWidget {
final BaseViewModel baseViewModel; final BaseViewModel? baseViewModel;
final Widget child; final Widget? child;
NetworkBaseView({Key ? key, this.baseViewModel, this.child}); NetworkBaseView({Key? key, this.baseViewModel, this.child});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -21,7 +21,7 @@ class NetworkBaseView extends StatelessWidget {
} }
buildBaseViewWidget() { buildBaseViewWidget() {
switch (baseViewModel.state) { switch (baseViewModel!.state) {
case ViewState.ErrorLocal: case ViewState.ErrorLocal:
case ViewState.Idle: case ViewState.Idle:
case ViewState.BusyLocal: case ViewState.BusyLocal:
@ -31,7 +31,9 @@ class NetworkBaseView extends StatelessWidget {
return AppLoaderWidget(); return AppLoaderWidget();
break; break;
case ViewState.Error: case ViewState.Error:
return ErrorMessage(error: baseViewModel.error ,); return ErrorMessage(
error: baseViewModel!.error,
);
break; break;
} }
} }

@ -10,21 +10,15 @@ import 'package:flutter/material.dart';
*@desc: Profile Image Widget class *@desc: Profile Image Widget class
*/ */
class ProfileImageWidget extends StatelessWidget { class ProfileImageWidget extends StatelessWidget {
String url; String? url;
String name; String? name;
String des; String? des;
double height; double? height;
double width; double? width;
Color color; Color? color;
double fontsize; double? fontsize;
ProfileImageWidget( ProfileImageWidget(
{this.url, {this.url, this.name, this.des, this.height, this.width, this.fontsize, this.color = Colors.black});
this.name,
this.des,
this.height,
this.width,
this.fontsize,
this.color = Colors.black});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -42,7 +36,7 @@ class ProfileImageWidget extends StatelessWidget {
borderRadius:BorderRadius.circular(50), borderRadius:BorderRadius.circular(50),
child: Image.network( child: Image.network(
url, url!,
fit: BoxFit.fill, fit: BoxFit.fill,
width: 700, width: 700,
), ),

@ -1,24 +1,24 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RoundedContainer extends StatefulWidget { class RoundedContainer extends StatefulWidget {
final double width; final double? width;
final double height; final double? height;
final double raduis; final double? raduis;
final Color backgroundColor; final Color? backgroundColor;
final EdgeInsets margin; final EdgeInsets? margin;
final double elevation; final double? elevation;
final bool showBorder; final bool? showBorder;
final Color borderColor; final Color? borderColor;
final double shadowWidth; final double? shadowWidth;
final double shadowSpreadRadius; final double? shadowSpreadRadius;
final double shadowDy; final double? shadowDy;
final bool customCornerRaduis; final bool? customCornerRaduis;
final double topLeft; final double? topLeft;
final double bottomRight; final double? bottomRight;
final double topRight; final double? topRight;
final double bottomLeft; final double? bottomLeft;
final Widget child; final Widget? child;
final double borderWidth; final double? borderWidth;
RoundedContainer( RoundedContainer(
{@required this.child, {@required this.child,
@ -54,22 +54,21 @@ class _RoundedContainerState extends State<RoundedContainer> {
decoration: widget.showBorder == true decoration: widget.showBorder == true
? BoxDecoration( ? BoxDecoration(
color: Colors.white/*Theme.of(context).primaryColor*/, color: Colors.white/*Theme.of(context).primaryColor*/,
border: Border.all( border: Border.all(color: widget.borderColor!, width: widget.borderWidth!),
color: widget.borderColor, width: widget.borderWidth), borderRadius: widget.customCornerRaduis!
borderRadius: widget.customCornerRaduis
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft!),
topRight: Radius.circular(widget.topRight), topRight: Radius.circular(widget.topRight!),
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight!),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft!))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis!),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(widget.shadowWidth), color: Colors.grey.withOpacity(widget.shadowWidth!),
spreadRadius: widget.shadowSpreadRadius, spreadRadius: widget.shadowSpreadRadius!,
blurRadius: 5, blurRadius: 5,
offset: Offset( offset: Offset(
0, widget.shadowDy), // changes position of shadow 0, widget.shadowDy!), // changes position of shadow
), ),
], ],
) )
@ -77,13 +76,13 @@ class _RoundedContainerState extends State<RoundedContainer> {
child: Card( child: Card(
margin: EdgeInsets.all(0), margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: widget.customCornerRaduis borderRadius: widget.customCornerRaduis!
? BorderRadius.only( ? BorderRadius.only(
topLeft: Radius.circular(widget.topLeft), topLeft: Radius.circular(widget.topLeft!),
topRight: Radius.circular(widget.topRight), topRight: Radius.circular(widget.topRight!),
bottomRight: Radius.circular(widget.bottomRight), bottomRight: Radius.circular(widget.bottomRight!),
bottomLeft: Radius.circular(widget.bottomLeft)) bottomLeft: Radius.circular(widget.bottomLeft!))
: BorderRadius.circular(widget.raduis), : BorderRadius.circular(widget.raduis!),
), ),
color: widget.backgroundColor, color: widget.backgroundColor,
child: widget.child, child: widget.child,

@ -15,7 +15,7 @@ class SpeechToText {
static var dialog; static var dialog;
static stt.SpeechToText speech = stt.SpeechToText(); static stt.SpeechToText speech = stt.SpeechToText();
SpeechToText({ SpeechToText({
@required this.context, required this.context,
}); });
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
@ -44,7 +44,7 @@ typedef Disposer = void Function();
class MyStatefulBuilder extends StatefulWidget { class MyStatefulBuilder extends StatefulWidget {
const MyStatefulBuilder({ const MyStatefulBuilder({
// @required this.builder, // @required this.builder,
@required this.dispose, required this.dispose,
}); });
//final StatefulWidgetBuilder builder; //final StatefulWidgetBuilder builder;
@ -57,7 +57,7 @@ class MyStatefulBuilder extends StatefulWidget {
class _MyStatefulBuilderState extends State<MyStatefulBuilder> { class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
var event = RobotProvider(); var event = RobotProvider();
var searchText; var searchText;
static StreamSubscription<dynamic> streamSubscription; static StreamSubscription<dynamic>? streamSubscription;
static var isClosed = false; static var isClosed = false;
@override @override
void initState() { void initState() {
@ -135,7 +135,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
child: InkWell( child: InkWell(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300])), border: Border.all(color: Colors.grey[300]!)),
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
'Try Again', 'Try Again',

@ -26,9 +26,9 @@ class AppTextFieldCustom extends StatefulWidget {
final Function(String)? onChanged; final Function(String)? onChanged;
final VoidCallback? onFieldSubmitted; final VoidCallback? onFieldSubmitted;
final String validationError; final String? validationError;
final bool isPrscription; final bool? isPrscription;
final bool isSecure; final bool? isSecure;
final bool focus; final bool focus;
final bool isSearchTextField; final bool isSearchTextField;
@ -94,10 +94,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
return Column( return Column(
children: [ children: [
Container( Container(
height: widget.height != 0 && widget.maxLines == 1 height: widget.height != 0 && widget.maxLines == 1 ? widget.height! + 8 : null,
? widget.height + 8 decoration: widget.hasBorder!
: MediaQuery.of(context).size.height * 0.098,
decoration: widget.hasBorder
? TextFieldsUtils.containerBorderDecoration( ? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0Xffffffff),
widget.validationError == null widget.validationError == null
@ -127,7 +125,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
// widget.controller.text != "") || // widget.controller.text != "") ||
// widget.dropDownText != null) // widget.dropDownText != null)
AppText( AppText(
widget.hintText, widget.hintText!,
// marginTop: widget.hasHintmargin ? 0 : 30, // marginTop: widget.hasHintmargin ? 0 : 30,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false
@ -143,7 +141,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
? Container( ? Container(
height: height:
widget.height != 0 && widget.maxLines == 1 widget.height != 0 && widget.maxLines == 1
? widget.height - 22 ? widget.height!- 22
: MediaQuery.of(context).size.height * : MediaQuery.of(context).size.height *
0.045, 0.045,
child: TextFormField( child: TextFormField(
@ -154,7 +152,8 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
textAlignVertical: TextAlignVertical.top, textAlignVertical: TextAlignVertical.top,
decoration: TextFieldsUtils decoration: TextFieldsUtils
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText!,
"", true),
style: TextStyle( style: TextStyle(
fontSize: fontSize:
14.0, //SizeConfig.textMultiplier * 1.7, 14.0, //SizeConfig.textMultiplier * 1.7,
@ -178,14 +177,14 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
onChanged: (value) { onChanged: (value) {
setState(() {}); setState(() {});
if (widget.onChanged != null) { if (widget.onChanged != null) {
widget.onChanged(value); widget.onChanged!(value);
} }
}, },
onFieldSubmitted: (_)=>widget.onFieldSubmitted, onFieldSubmitted: (_)=>widget.onFieldSubmitted,
obscureText: widget.isSecure), obscureText: widget.isSecure!),
) )
: AppText( : AppText(
widget.dropDownText, widget!.dropDownText!,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF575757), color: Color(0xFF575757),
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.7,
@ -194,12 +193,12 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
widget.isTextFieldHasSuffix widget.isTextFieldHasSuffix!
? widget.suffixIcon != null ? widget.suffixIcon != null
? Container( ? Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: widget.isSearchTextField bottom: widget.isSearchTextField
? (widget.controller.text.isEmpty || ? (widget.controller!.text.isEmpty ||
widget.controller == null) widget.controller == null)
? 10 ? 10
: 25 : 25
@ -219,8 +218,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
if (widget.validationError != null && widget.validationError.isNotEmpty) if (widget.validationError != null && widget.validationError!.isNotEmpty) TextFieldsError(error: widget!.validationError!),
TextFieldsError(error: widget.validationError),
], ],
); );
} }

@ -9,7 +9,7 @@ import 'app-textfield-custom.dart';
class AppTextFieldCustomSearch extends StatelessWidget { class AppTextFieldCustomSearch extends StatelessWidget {
const AppTextFieldCustomSearch({ const AppTextFieldCustomSearch({
Key ? key, Key? key,
this.onChangeFun, this.onChangeFun,
this.positionedChild, this.positionedChild,
this.marginTop, this.marginTop,
@ -26,19 +26,18 @@ class AppTextFieldCustomSearch extends StatelessWidget {
final Function(String)? onChangeFun; final Function(String)? onChangeFun;
final Function(String)? onFieldSubmitted; final Function(String)? onFieldSubmitted;
final Widget positionedChild; final Widget ?positionedChild;
final IconButton suffixIcon; final IconButton? suffixIcon;
final double marginTop; final double? marginTop;
final String validationError; final String? validationError;
final String hintText; final String? hintText;
final TextInputType inputType; final TextInputType? inputType;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop), margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: marginTop!),
child: Stack( child: Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
@ -60,7 +59,7 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onFieldSubmitted: ()=>onFieldSubmitted, onFieldSubmitted: ()=>onFieldSubmitted,
validationError: validationError), validationError: validationError),
if (positionedChild != null) if (positionedChild != null)
projectViewModel.isArabic?Positioned(left: 35, top: 5, child: positionedChild):Positioned(right: 35, top: 5, child: positionedChild) Positioned(right: 35, top: 5, child: positionedChild!)
], ],
), ),
); );

@ -6,22 +6,22 @@ import 'package:hexcolor/hexcolor.dart';
class AppTextFormField extends FormField<String> { class AppTextFormField extends FormField<String> {
AppTextFormField( AppTextFormField(
{FormFieldSetter<String> onSaved, {FormFieldSetter<String>? onSaved,
String inputFormatter, String? inputFormatter,
FormFieldValidator<String> validator, FormFieldValidator<String>? validator,
ValueChanged<String> onChanged, ValueChanged<String>? onChanged,
GestureTapCallback onTap, GestureTapCallback? onTap,
bool obscureText = false, bool obscureText = false,
TextEditingController controller, TextEditingController? controller,
bool autovalidate = true, bool autovalidate = true,
TextInputType textInputType, TextInputType? textInputType,
String hintText, String? hintText,
FocusNode focusNode, FocusNode? focusNode,
TextInputAction textInputAction=TextInputAction.done, TextInputAction textInputAction = TextInputAction.done,
ValueChanged<String> onFieldSubmitted, ValueChanged<String>? onFieldSubmitted,
IconButton prefix, IconButton? prefix,
String labelText, String? labelText,
IconData suffixIcon, IconData? suffixIcon,
bool readOnly = false, bool readOnly = false,
borderColor}) borderColor})
: super( : super(
@ -83,7 +83,7 @@ class AppTextFormField extends FormField<String> {
), ),
state.hasError state.hasError
? Text( ? Text(
state.errorText, state.errorText ?? "",
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
) )
: Container() : Container()

@ -8,9 +8,9 @@ class CustomAutoCompleteTextField extends StatelessWidget {
final Widget child; final Widget child;
const CustomAutoCompleteTextField({ const CustomAutoCompleteTextField({
Key ? key, Key? key,
this.isShowError, required this.isShowError,
this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@ -31,7 +31,7 @@ class CustomAutoCompleteTextField extends StatelessWidget {
), ),
if (isShowError) if (isShowError)
TextFieldsError( TextFieldsError(
error: TranslationBase.of(context).emptyMessage, error: TranslationBase.of(context).emptyMessage ?? "",
) )
], ],
), ),

@ -7,16 +7,16 @@ import 'package:flutter/material.dart';
class CountryTextField extends StatefulWidget { class CountryTextField extends StatefulWidget {
final dynamic element; final dynamic element;
final String elementError; final String? elementError;
final List<dynamic> elementList; final List<dynamic>? elementList;
final String keyName; final String? keyName;
final String keyId; final String? keyId;
final String hintText; final String? hintText;
final double width; final double? width;
final Function(dynamic) okFunction; final Function(dynamic)? okFunction;
CountryTextField( CountryTextField(
{Key ? key, {Key? key,
@required this.element, @required this.element,
@required this.elementError, @required this.elementError,
this.width, this.width,
@ -41,14 +41,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
? () { ? () {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList, list: widget.elementList!,
attributeName: '${widget.keyName}', attributeName: '${widget.keyName}',
attributeValueId: widget.elementList.length == 1 attributeValueId: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyId}'] ? widget.elementList![0]['${widget.keyId}']
: '${widget.keyId}', : '${widget.keyId}',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) => okFunction: (selectedValue) =>
widget.okFunction(selectedValue), widget.okFunction!(selectedValue),
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -61,14 +61,14 @@ class _CountryTextfieldState extends State<CountryTextField> {
: null, : null,
child: AppTextFieldCustom( child: AppTextFieldCustom(
hintText: widget.hintText, hintText: widget.hintText,
dropDownText: widget.elementList.length == 1 dropDownText: widget.elementList!.length == 1
? widget.elementList[0]['${widget.keyName}'] ? widget.elementList![0]['${widget.keyName}']
: widget.element != null : widget.element != null
? widget.element['${widget.keyName}'] ? widget.element['${widget.keyName}']
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: validationError:
widget.elementList.length != 1 ? widget.elementError : null, widget.elementList!.length != 1 ? widget.elementError : null,
enabled: false, enabled: false,
), ),
), ),

@ -12,7 +12,16 @@ import 'package:speech_to_text/speech_to_text.dart' as stt;
import '../speech-text-popup.dart'; import '../speech-text-popup.dart';
class HtmlRichEditor extends StatefulWidget { class HtmlRichEditor extends StatefulWidget {
HtmlRichEditor({ final String hint;
final String? initialText;
final double height;
final BoxDecoration? decoration;
final bool darkMode;
final bool showBottomToolbar;
final List<Toolbar>? toolbar;
final HtmlEditorController controller;
HtmlRichEditor({
key, key,
this.hint = "Your text here...", this.hint = "Your text here...",
this.initialText, this.initialText,
@ -21,22 +30,15 @@ class HtmlRichEditor extends StatefulWidget {
this.darkMode = false, this.darkMode = false,
this.showBottomToolbar = false, this.showBottomToolbar = false,
this.toolbar, this.toolbar,
required this.controller,
}) : super(key: key); }) : super(key: key);
final String hint;
final String initialText;
final double height;
final BoxDecoration decoration;
final bool darkMode;
final bool showBottomToolbar;
final List<Toolbar> toolbar;
@override @override
_HtmlRichEditorState createState() => _HtmlRichEditorState(); _HtmlRichEditorState createState() => _HtmlRichEditorState();
} }
class _HtmlRichEditorState extends State<HtmlRichEditor> { class _HtmlRichEditorState extends State<HtmlRichEditor> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
stt.SpeechToText speech = stt.SpeechToText(); stt.SpeechToText speech = stt.SpeechToText();
var recognizedWord; var recognizedWord;
var event = RobotProvider(); var event = RobotProvider();
@ -64,51 +66,42 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
return Stack( return Stack(
children: [ children: [
HtmlEditor( HtmlEditor(
hint: widget.hint, controller: widget.controller,
height: widget.height, htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [
initialText: widget.initialText, StyleButtons(),
showBottomToolbar: widget.showBottomToolbar, FontSettingButtons(),
darkMode: widget.darkMode, FontButtons(),
decoration: widget.decoration ?? // ColorButtons(),
BoxDecoration( ListButtons(),
color: Colors.transparent, ParagraphButtons(),
borderRadius: BorderRadius.all( // InsertButtons(),
Radius.circular(30.0), // OtherButtons(),
), ]),
border: Border.all(color: Colors.grey[200], width: 0.5), htmlEditorOptions: HtmlEditorOptions(
), hint: widget.hint,
toolbar: widget.toolbar ?? initialText: widget.initialText,
const [ darkMode: widget.darkMode,
// Style(), ),
Font(buttons: [ otherOptions: OtherOptions(
FontButtons.bold, height: widget.height,
FontButtons.italic, decoration: widget.decoration ??
FontButtons.underline, BoxDecoration(
]), color: Colors.transparent,
// ColorBar(buttons: [ColorButtons.color]), borderRadius: BorderRadius.all(
Paragraph(buttons: [ Radius.circular(30.0),
ParagraphButtons.ul, ),
ParagraphButtons.ol, border: Border.all(color: Colors.grey[200]!, width: 0.5),
ParagraphButtons.paragraph ),
]), )),
// Insert(buttons: [InsertButtons.link, InsertButtons.picture, InsertButtons.video, InsertButtons.table]),
// Misc(buttons: [MiscButtons.fullscreen, MiscButtons.codeview, MiscButtons.help])
],
),
Positioned( Positioned(
top: top: 50, //MediaQuery.of(context).size.height * 0,
50, //MediaQuery.of(context).size.height * 0, right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15,
right: projectViewModel.isArabic
? MediaQuery.of(context).size.width * 0.75
: 15,
child: Column( child: Column(
children: [ children: [
IconButton( IconButton(
icon: Icon(DoctorApp.speechtotext, icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35),
color: Colors.black, size: 35),
onPressed: () { onPressed: () {
initSpeechState() initSpeechState().then((value) => {onVoiceText()});
.then((value) => {onVoiceText()});
}, },
), ),
], ],
@ -121,8 +114,7 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
onVoiceText() async { onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context); new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize( bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -150,15 +142,15 @@ class _HtmlRichEditorState extends State<HtmlRichEditor> {
].request(); ].request();
} }
void resultListener(result)async { void resultListener(result) async {
recognizedWord = result.recognizedWords; recognizedWord = result.recognizedWords;
event.setValue({"searchText": recognizedWord}); event.setValue({"searchText": recognizedWord});
String txt = await HtmlEditor.getText(); String txt = await widget.controller.getText();
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
SpeechToText.closeAlertDialog(context); SpeechToText.closeAlertDialog(context);
speech.stop(); speech.stop();
HtmlEditor.setText(txt+recognizedWord); widget.controller.setText(txt + recognizedWord);
}); });
} else { } else {
print(result.finalResult); print(result.finalResult);

@ -41,77 +41,88 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget { class NewTextFields extends StatefulWidget {
NewTextFields( NewTextFields(
{Key ? key, {Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
this.maxLines, this.maxLines,
this.inputFormatters, this.inputFormatters,
this.padding, this.padding,
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction, this.inputAction,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,
this.controller, this.controller,
this.keyboardType, this.keyboardType,
this.validator, this.validator,
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly: false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 15.0, this.fontSize = 15.0,
this.fontWeight = FontWeight.w500, this.fontWeight = FontWeight.w500,
this.autoValidate = false, this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true}) this.isEnabled = true,
this.onTapTextFields,
this.fillColor,
this.hasBorder,
this.showLabelText,
this.borderRadius,
this.borderWidth})
: super(key: key); : super(key: key);
final String? hintText;
final String hintText; final String? initialValue;
final String? type;
// final String initialValue; final bool? autoFocus;
final String type; final bool? isEnabled;
final bool autoFocus; final IconData? suffixIcon;
final IconData suffixIcon; final Color? suffixIconColor;
final Color suffixIconColor; final Icon? prefixIcon;
final Icon prefixIcon; final VoidCallback? onTap;
final VoidCallback onTap; final GestureTapCallback? onTapTextFields;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final FormFieldSetter<String>? onSaved;
final Function onSuffixTap; final GestureTapCallback? onSuffixTap;
final Function onChanged; final ValueChanged<String>? onChanged;
final Function onSubmit; final ValueChanged<String>? onSubmit;
final bool readOnly; final bool? readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool? maxLengthEnforced;
final bool bare; final bool? bare;
final bool isEnabled; final TextInputAction? inputAction;
final TextInputAction inputAction; final double? fontSize;
final double fontSize; final FontWeight? fontWeight;
final FontWeight fontWeight; final bool? keepPadding;
final bool keepPadding; final TextCapitalization? textCapitalization;
final TextCapitalization textCapitalization; final List<TextInputFormatter>? inputFormatters;
final List<TextInputFormatter> inputFormatters; final bool? autoValidate;
final bool autoValidate; final EdgeInsets? padding;
final EdgeInsets padding; final bool? focus;
final bool focus; final bool? borderOnlyError;
final bool borderOnlyError; final Color? hintColor;
final Color hintColor; final Color? fillColor;
final String initialValue; final bool? hasBorder;
final bool? showLabelText;
Color? borderColor;
final double? borderRadius;
final double? borderWidth;
bool? hasLabelText;
@override @override
_NewTextFieldsState createState() => _NewTextFieldsState(); _NewTextFieldsState createState() => _NewTextFieldsState();
} }
@ -133,7 +144,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
@override @override
void didUpdateWidget(NewTextFields oldWidget) { void didUpdateWidget(NewTextFields oldWidget) {
if (widget.focus) _focusNode.requestFocus(); if (widget.focus!) _focusNode.requestFocus();
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
} }
@ -144,7 +155,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
} }
bool _determineReadOnly() { bool _determineReadOnly() {
if (widget.readOnly != null && widget.readOnly) { if (widget.readOnly != null && widget.readOnly!) {
_focusNode.unfocus(); _focusNode.unfocus();
return true; return true;
} else { } else {
@ -172,8 +183,8 @@ class _NewTextFieldsState extends State<NewTextFields> {
initialValue: widget.initialValue, initialValue: widget.initialValue,
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
// autovalidate: widget.autoValidate, // autovalidate: widget.autoValidate!,
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization!,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit
@ -184,8 +195,8 @@ class _NewTextFieldsState extends State<NewTextFields> {
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1, maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced, // maxLengthEnforced: widget.maxLengthEnforced!,
onChanged: widget.onChanged, onChanged: widget.onChanged!,
focusNode: _focusNode, focusNode: _focusNode,
maxLength: widget.maxLength ?? null, maxLength: widget.maxLength ?? null,
controller: widget.controller, controller: widget.controller,
@ -195,8 +206,11 @@ class _NewTextFieldsState extends State<NewTextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith( style: Theme.of(context).textTheme.bodyText1!.copyWith(
fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), fontSize: widget.fontSize,
fontWeight: widget.fontWeight,
color: Color(0xFF575757),
fontFamily: 'Poppins'),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
// WhitelistingTextInputFormatter.digitsOnly, // WhitelistingTextInputFormatter.digitsOnly,

@ -6,8 +6,8 @@ import '../app_texts_widget.dart';
class TextFieldsError extends StatelessWidget { class TextFieldsError extends StatelessWidget {
const TextFieldsError({ const TextFieldsError({
Key ? key, Key? key,
@required this.error, required this.error,
}) : super(key: key); }) : super(key: key);
final String error; final String error;

@ -1,9 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class TextFieldsUtils { class TextFieldsUtils {
static BoxDecoration containerBorderDecoration( static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor,
Color containerColor, Color borderColor, {double borderWidth = -1, double borderRadius = 12}) {
{double borderWidth = -1, double borderRadius = 10.0}) {
return BoxDecoration( return BoxDecoration(
color: containerColor, color: containerColor,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -15,9 +14,8 @@ class TextFieldsUtils {
); );
} }
static InputDecoration textFieldSelectorDecoration( static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown,
String hintText, String selectedText, bool isDropDown, {IconData? suffixIcon, Color? dropDownColor}) {
{IconData suffixIcon, Color dropDownColor}) {
return InputDecoration( return InputDecoration(
isDense: true, isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),

@ -5,21 +5,17 @@ import '../app_texts_widget.dart';
class CustomRow extends StatelessWidget { class CustomRow extends StatelessWidget {
const CustomRow({ const CustomRow({
Key ? key, Key? key,
this.label, this.label,
this.value, required this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true,
this.labelSize,
this.valueSize,
this.width,
this.isCopyable = true,
}) : super(key: key); }) : super(key: key);
final String label; final String? label;
final String value; final String value;
final double labelSize; final double? labelSize;
final double valueSize; final double? valueSize;
final double width; final double? width;
final bool isCopyable; final bool? isCopyable;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -1,183 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:flutter/material.dart';
/// Displays an overlay Widget anchored directly above the center of this
/// [AnchoredOverlay].
///
/// The overlay Widget is created by invoking the provided [overlayBuilder].
///
/// The [anchor] position is provided to the [overlayBuilder], but the builder
/// does not have to respect it. In other words, the [overlayBuilder] can
/// interpret the meaning of "anchor" however it wants - the overlay will not
/// be forced to be centered about the [anchor].
///
/// The overlay built by this [AnchoredOverlay] can be conditionally shown
/// and hidden by settings the [showOverlay] property to true or false.
///
/// The [overlayBuilder] is invoked every time this Widget is rebuilt.
///
class AnchoredOverlay extends StatelessWidget {
final bool showOverlay;
final Widget Function(BuildContext, Rect anchorBounds, Offset anchor)
overlayBuilder;
final Widget child;
AnchoredOverlay({
key,
this.showOverlay = false,
this.overlayBuilder,
this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return OverlayBuilder(
showOverlay: showOverlay,
overlayBuilder: (BuildContext overlayContext) {
// To calculate the "anchor" point we grab the render box of
// our parent Container and then we find the center of that box.
RenderBox box = context.findRenderObject() as RenderBox;
final topLeft =
box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0)));
final bottomRight =
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0)));
final Rect anchorBounds = Rect.fromLTRB(
topLeft.dx,
topLeft.dy,
bottomRight.dx,
bottomRight.dy,
);
final anchorCenter = box.size.center(topLeft);
return overlayBuilder(overlayContext, anchorBounds, anchorCenter);
},
child: child,
);
},
);
}
}
//
// Displays an overlay Widget as constructed by the given [overlayBuilder].
//
// The overlay built by the [overlayBuilder] can be conditionally shown and hidden by settings the [showOverlay]
// property to true or false.
//
// The [overlayBuilder] is invoked every time this Widget is rebuilt.
//
// Implementation note: the reason we rebuild the overlay every time our state changes is because there doesn't seem
// to be any better way to invalidate the overlay itself than to invalidate this Widget.
// Remember, overlay Widgets exist in [OverlayEntry]s which are inaccessible to outside Widgets.
// But if a better approach is found then feel free to use it.
//
class OverlayBuilder extends StatefulWidget {
final bool showOverlay;
final Widget Function(BuildContext) overlayBuilder;
final Widget child;
OverlayBuilder({
key,
this.showOverlay = false,
this.overlayBuilder,
this.child,
}) : super(key: key);
@override
_OverlayBuilderState createState() => _OverlayBuilderState();
}
class _OverlayBuilderState extends State<OverlayBuilder> {
OverlayEntry _overlayEntry;
@override
void initState() {
super.initState();
if (widget.showOverlay) {
WidgetsBinding.instance.addPostFrameCallback((_) => showOverlay());
}
}
@override
void didUpdateWidget(OverlayBuilder oldWidget) {
super.didUpdateWidget(oldWidget);
WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay());
}
@override
void reassemble() {
super.reassemble();
WidgetsBinding.instance.addPostFrameCallback((_) => syncWidgetAndOverlay());
}
@override
void dispose() {
if (isShowingOverlay()) {
hideOverlay();
}
super.dispose();
}
bool isShowingOverlay() => _overlayEntry != null;
void showOverlay() {
if (_overlayEntry == null) {
// Create the overlay.
_overlayEntry = OverlayEntry(
builder: widget.overlayBuilder,
);
addToOverlay(_overlayEntry);
} else {
// Rebuild overlay.
buildOverlay();
}
}
void addToOverlay(OverlayEntry overlayEntry) async {
Overlay.of(context).insert(overlayEntry);
final overlay = Overlay.of(context);
if (overlayEntry == null)
WidgetsBinding.instance
.addPostFrameCallback((_) => overlay.insert(overlayEntry));
}
void hideOverlay() {
if (_overlayEntry != null) {
_overlayEntry.remove();
_overlayEntry = null;
}
}
void syncWidgetAndOverlay() {
if (isShowingOverlay() && !widget.showOverlay) {
hideOverlay();
} else if (!isShowingOverlay() && widget.showOverlay) {
showOverlay();
}
}
void buildOverlay() async {
WidgetsBinding.instance
.addPostFrameCallback((_) => _overlayEntry?.markNeedsBuild());
}
@override
Widget build(BuildContext context) {
buildOverlay();
return widget.child;
}
}

@ -1,75 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:flutter/material.dart';
class GetPosition {
final GlobalKey key;
GetPosition({this.key});
Rect getRect() {
RenderBox box = key.currentContext.findRenderObject();
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0)));
final bottomRight =
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0)));
Rect rect = Rect.fromLTRB(
topLeft.dx,
topLeft.dy,
bottomRight.dx,
bottomRight.dy,
);
return rect;
}
///Get the bottom position of the widget
double getBottom() {
RenderBox box = key.currentContext.findRenderObject();
final bottomRight =
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0)));
return bottomRight.dy;
}
///Get the top position of the widget
double getTop() {
RenderBox box = key.currentContext.findRenderObject();
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0)));
return topLeft.dy;
}
///Get the left position of the widget
double getLeft() {
RenderBox box = key.currentContext.findRenderObject();
final topLeft = box.size.topLeft(box.localToGlobal(const Offset(0.0, 0.0)));
return topLeft.dx;
}
///Get the right position of the widget
double getRight() {
RenderBox box = key.currentContext.findRenderObject();
final bottomRight =
box.size.bottomRight(box.localToGlobal(const Offset(0.0, 0.0)));
return bottomRight.dx;
}
double getHeight() {
return getBottom() - getTop();
}
double getWidth() {
return getRight() - getLeft();
}
double getCenter() {
return (getLeft() + getRight()) / 2;
}
}

@ -1,42 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:flutter/material.dart';
class ShapePainter extends CustomPainter {
Rect rect;
final ShapeBorder shapeBorder;
final Color color;
final double opacity;
ShapePainter({
@required this.rect,
this.color,
this.shapeBorder,
this.opacity,
});
@override
void paint(Canvas canvas, Size size) {
final paint = Paint();
paint.color = color.withOpacity(opacity);
RRect outer =
RRect.fromLTRBR(0, 0, size.width, size.height, Radius.circular(0));
double radius = shapeBorder == CircleBorder() ? 50 : 3;
RRect inner = RRect.fromRectAndRadius(rect, Radius.circular(radius));
canvas.drawDRRect(outer, inner, paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}

@ -1,349 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'app_anchored_overlay_widget.dart';
import 'app_get_position.dart';
import 'app_shape_painter.dart';
import 'app_showcase_widget.dart';
import 'app_tool_tip_widget.dart';
class AppShowcase extends StatefulWidget {
final Widget child;
final String title;
final String description;
final ShapeBorder shapeBorder;
final TextStyle titleTextStyle;
final TextStyle descTextStyle;
final GlobalKey key;
final Color overlayColor;
final double overlayOpacity;
final Widget container;
final Color showcaseBackgroundColor;
final Color textColor;
final bool showArrow;
final double height;
final double width;
final Duration animationDuration;
final VoidCallback onToolTipClick;
final VoidCallback onTargetClick;
final VoidCallback onSkipClick;
final bool disposeOnTap;
final bool disableAnimation;
const AppShowcase(
{@required this.key,
@required this.child,
this.title,
@required this.description,
this.shapeBorder,
this.overlayColor = Colors.black,
this.overlayOpacity = 0.75,
this.titleTextStyle,
this.descTextStyle,
this.showcaseBackgroundColor = Colors.white,
this.textColor = Colors.black,
this.showArrow = true,
this.onTargetClick,
this.onSkipClick,
this.disposeOnTap,
this.animationDuration = const Duration(milliseconds: 2000),
this.disableAnimation = false})
: height = null,
width = null,
container = null,
this.onToolTipClick = null,
assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
"overlay opacity should be >= 0.0 and <= 1.0."),
assert(
onTargetClick == null
? true
: (disposeOnTap == null ? false : true),
"disposeOnTap is required if you're using onTargetClick"),
assert(
disposeOnTap == null
? true
: (onTargetClick == null ? false : true),
"onTargetClick is required if you're using disposeOnTap"),
assert(key != null ||
child != null ||
title != null ||
showArrow != null ||
description != null ||
shapeBorder != null ||
overlayColor != null ||
titleTextStyle != null ||
descTextStyle != null ||
showcaseBackgroundColor != null ||
textColor != null ||
shapeBorder != null ||
animationDuration != null);
const AppShowcase.withWidget(
{this.key,
@required this.child,
@required this.container,
@required this.height,
@required this.width,
this.title,
this.description,
this.shapeBorder,
this.overlayColor = Colors.black,
this.overlayOpacity = 0.75,
this.titleTextStyle,
this.descTextStyle,
this.showcaseBackgroundColor = Colors.white,
this.textColor = Colors.black,
this.onTargetClick,
this.onSkipClick,
this.disposeOnTap,
this.animationDuration = const Duration(milliseconds: 2000),
this.disableAnimation = false})
: this.showArrow = false,
this.onToolTipClick = null,
assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
"overlay opacity should be >= 0.0 and <= 1.0."),
assert(key != null ||
child != null ||
title != null ||
description != null ||
shapeBorder != null ||
overlayColor != null ||
titleTextStyle != null ||
descTextStyle != null ||
showcaseBackgroundColor != null ||
textColor != null ||
shapeBorder != null ||
animationDuration != null);
@override
_AppShowcaseState createState() => _AppShowcaseState();
}
class _AppShowcaseState extends State<AppShowcase>
with TickerProviderStateMixin {
bool _showShowCase = false;
Animation<double> _slideAnimation;
AnimationController _slideAnimationController;
GetPosition position;
@override
void initState() {
super.initState();
_slideAnimationController = AnimationController(
duration: widget.animationDuration,
vsync: this,
)..addStatusListener((AnimationStatus status) {
if (status == AnimationStatus.completed) {
_slideAnimationController.reverse();
}
if (_slideAnimationController.isDismissed) {
if (!widget.disableAnimation) {
_slideAnimationController.forward();
}
}
});
_slideAnimation = CurvedAnimation(
parent: _slideAnimationController,
curve: Curves.easeInOut,
);
position = GetPosition(key: widget.key);
}
@override
void dispose() {
_slideAnimationController.dispose();
super.dispose();
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
showOverlay();
}
///
/// show overlay if there is any target widget
///
void showOverlay() {
GlobalKey activeStep = ShowCaseWidget.activeTargetWidget(context);
setState(() {
_showShowCase = activeStep == widget.key;
});
if (activeStep == widget.key) {
if (!widget.disableAnimation) {
_slideAnimationController.forward();
}
}
}
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return AnchoredOverlay(
overlayBuilder: (BuildContext context, Rect rectBound, Offset offset) =>
buildOverlayOnTarget(offset, rectBound.size, rectBound, size),
showOverlay: true,
child: widget.child,
);
}
_nextIfAny() {
ShowCaseWidget.of(context).completed(widget.key);
if (!widget.disableAnimation) {
_slideAnimationController.forward();
}
}
_getOnTargetTap() {
if (widget.disposeOnTap == true) {
return widget.onTargetClick == null
? () {
ShowCaseWidget.of(context).dismiss();
}
: () {
ShowCaseWidget.of(context).dismiss();
widget.onTargetClick();
};
} else {
return widget.onTargetClick ?? _nextIfAny;
}
}
_getOnTooltipTap() {
if (widget.disposeOnTap == true) {
return widget.onToolTipClick == null
? () {
ShowCaseWidget.of(context).dismiss();
}
: () {
ShowCaseWidget.of(context).dismiss();
widget.onToolTipClick();
};
} else {
return widget.onToolTipClick ?? () {};
}
}
buildOverlayOnTarget(
Offset offset,
Size size,
Rect rectBound,
Size screenSize,
) =>
Visibility(
visible: _showShowCase,
maintainAnimation: true,
maintainState: true,
child: Stack(
children: [
GestureDetector(
onTap: _nextIfAny,
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: CustomPaint(
painter: ShapePainter(
opacity: widget.overlayOpacity,
rect: position.getRect(),
shapeBorder: widget.shapeBorder,
color: widget.overlayColor),
),
),
),
_TargetWidget(
offset: offset,
size: size,
onTap: _getOnTargetTap(),
shapeBorder: widget.shapeBorder,
),
AppToolTipWidget(
position: position,
offset: offset,
screenSize: screenSize,
title: widget.title,
description: widget.description,
animationOffset: _slideAnimation,
titleTextStyle: widget.titleTextStyle,
descTextStyle: widget.descTextStyle,
container: widget.container,
tooltipColor: widget.showcaseBackgroundColor,
textColor: widget.textColor,
showArrow: widget.showArrow,
contentHeight: widget.height,
contentWidth: widget.width,
onTooltipTap: _getOnTooltipTap(),
),
GestureDetector(
child: AppText(
"Skip",
color: Colors.white,
fontSize: 20,
marginRight: 15,
marginLeft: 15,
marginTop: 15,
),
onTap: widget.onSkipClick)
],
),
);
}
class _TargetWidget extends StatelessWidget {
final Offset offset;
final Size size;
final Animation<double> widthAnimation;
final VoidCallback onTap;
final ShapeBorder shapeBorder;
_TargetWidget({
Key ? key,
@required this.offset,
this.size,
this.widthAnimation,
this.onTap,
this.shapeBorder,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Positioned(
top: offset.dy,
left: offset.dx,
child: FractionalTranslation(
translation: const Offset(-0.5, -0.5),
child: GestureDetector(
onTap: onTap,
child: Container(
height: size.height + 16,
width: size.width + 16,
decoration: ShapeDecoration(
shape: shapeBorder ??
RoundedRectangleBorder(
borderRadius: const BorderRadius.all(
Radius.circular(8),
),
),
),
),
),
),
);
}
}

@ -1,97 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:flutter/material.dart';
class ShowCaseWidget extends StatefulWidget {
final Builder builder;
final VoidCallback onFinish;
const ShowCaseWidget({@required this.builder, this.onFinish});
static activeTargetWidget(BuildContext context) {
return context
.dependOnInheritedWidgetOfExactType<_InheritedShowCaseView>()
.activeWidgetIds;
}
static ShowCaseWidgetState of(BuildContext context) {
ShowCaseWidgetState state =
context.findAncestorStateOfType<ShowCaseWidgetState>();
if (state != null) {
return context.findAncestorStateOfType<ShowCaseWidgetState>();
} else {
throw Exception('Please provide ShowCaseView context');
}
}
@override
ShowCaseWidgetState createState() => ShowCaseWidgetState();
}
class ShowCaseWidgetState extends State<ShowCaseWidget> {
List<GlobalKey> ids;
int activeWidgetId;
void startShowCase(List<GlobalKey> widgetIds) {
setState(() {
this.ids = widgetIds;
activeWidgetId = 0;
});
}
void completed(GlobalKey id) {
if (ids != null && ids[activeWidgetId] == id) {
setState(() {
++activeWidgetId;
if (activeWidgetId >= ids.length) {
_cleanupAfterSteps();
if (widget.onFinish != null) {
widget.onFinish();
}
}
});
}
}
void dismiss() {
setState(() {
_cleanupAfterSteps();
});
}
void _cleanupAfterSteps() {
ids = null;
activeWidgetId = null;
}
@override
Widget build(BuildContext context) {
return _InheritedShowCaseView(
child: widget.builder,
activeWidgetIds: ids?.elementAt(activeWidgetId),
);
}
}
class _InheritedShowCaseView extends InheritedWidget {
final GlobalKey activeWidgetIds;
_InheritedShowCaseView({
@required this.activeWidgetIds,
@required child,
}) : super(child: child);
@override
bool updateShouldNotify(_InheritedShowCaseView oldWidget) =>
oldWidget.activeWidgetIds != activeWidgetIds;
}

@ -1,290 +0,0 @@
/*
* Copyright © 2020, Simform Solutions
* All rights reserved.
* https://github.com/simformsolutions/flutter_showcaseview
*/
/*
Customized By: Ibrahim Albitar
*/
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'app_get_position.dart';
class AppToolTipWidget extends StatelessWidget {
final GetPosition position;
final Offset offset;
final Size screenSize;
final String title;
final String description;
final Animation<double> animationOffset;
final TextStyle titleTextStyle;
final TextStyle descTextStyle;
final Widget container;
final Color tooltipColor;
final Color textColor;
final bool showArrow;
final double contentHeight;
final double contentWidth;
static bool isArrowUp;
final VoidCallback onTooltipTap;
AppToolTipWidget({
this.position,
this.offset,
this.screenSize,
this.title,
this.description,
this.animationOffset,
this.titleTextStyle,
this.descTextStyle,
this.container,
this.tooltipColor,
this.textColor,
this.showArrow,
this.contentHeight,
this.contentWidth,
this.onTooltipTap,
});
bool isCloseToTopOrBottom(Offset position) {
double height = 120;
if (contentHeight != null) {
height = contentHeight;
}
return (screenSize.height - position.dy) <= height;
}
String findPositionForContent(Offset position) {
if (isCloseToTopOrBottom(position)) {
return 'ABOVE';
} else {
return 'BELOW';
}
}
double _getTooltipWidth() {
double titleLength = title == null ? 0 : (title.length * 10.0);
double descriptionLength = (description.length * 7.0);
if (titleLength > descriptionLength) {
return titleLength + 10;
} else {
return descriptionLength + 10;
}
}
bool _isLeft() {
double screenWidth = screenSize.width / 3;
return !(screenWidth <= position.getCenter());
}
bool _isRight() {
double screenWidth = screenSize.width / 3;
return ((screenWidth * 2) <= position.getCenter());
}
double _getLeft() {
if (_isLeft()) {
double leftPadding = position.getCenter() - (_getTooltipWidth() * 0.1);
if (leftPadding + _getTooltipWidth() > screenSize.width) {
leftPadding = (screenSize.width - 20) - _getTooltipWidth();
}
if (leftPadding < 20) {
leftPadding = 14;
}
return leftPadding;
} else if (!(_isRight())) {
return position.getCenter() - (_getTooltipWidth() * 0.5);
} else {
return null;
}
}
double _getRight() {
if (_isRight()) {
double rightPadding = position.getCenter() + (_getTooltipWidth() / 2);
if (rightPadding + _getTooltipWidth() > screenSize.width) {
rightPadding = 14;
}
return rightPadding;
} else if (!(_isLeft())) {
return position.getCenter() - (_getTooltipWidth() * 0.5);
} else {
return null;
}
}
double _getSpace() {
double space = position.getCenter() - (contentWidth / 2);
if (space + contentWidth > screenSize.width) {
space = screenSize.width - contentWidth - 8;
} else if (space < (contentWidth / 2)) {
space = 16;
}
return space;
}
@override
Widget build(BuildContext context) {
final contentOrientation = findPositionForContent(offset);
final contentOffsetMultiplier = contentOrientation == "BELOW" ? 1.0 : -1.0;
isArrowUp = contentOffsetMultiplier == 1.0 ? true : false;
final contentY = isArrowUp
? position.getBottom() + (contentOffsetMultiplier * 3)
: position.getTop() + (contentOffsetMultiplier * 3);
final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0);
double paddingTop = isArrowUp ? 22 : 0;
double paddingBottom = isArrowUp ? 0 : 27;
if (!showArrow) {
paddingTop = 10;
paddingBottom = 10;
}
if (container == null) {
return Stack(
children: <Widget>[
showArrow ? _getArrow(contentOffsetMultiplier) : Container(),
Positioned(
top: contentY,
left: _getLeft(),
right: _getRight(),
child: FractionalTranslation(
translation: Offset(0.0, contentFractionalOffset),
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(0.0, contentFractionalOffset / 10),
end: Offset(0.0, 0.100),
).animate(animationOffset),
child: Material(
color: Colors.transparent,
child: Container(
padding:
EdgeInsets.only(top: paddingTop, bottom: paddingBottom),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: GestureDetector(
onTap: onTooltipTap,
child: Container(
width: _getTooltipWidth(),
padding: EdgeInsets.symmetric(vertical: 8),
color: tooltipColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Column(
crossAxisAlignment: title != null
? CrossAxisAlignment.start
: CrossAxisAlignment.center,
children: <Widget>[
title != null
? Row(
children: <Widget>[
Padding(
padding:
const EdgeInsets.all(8.0),
child: Icon(
DoctorApp.search_patient),
),
AppText(
title,
color: textColor,
margin: 2,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
)
: Container(),
AppText(
description,
color: textColor,
margin: 8,
),
],
),
)
],
),
),
),
),
),
),
),
),
)
],
);
} else {
return Stack(
children: <Widget>[
Positioned(
left: _getSpace(),
top: contentY - 10,
child: FractionalTranslation(
translation: Offset(0.0, contentFractionalOffset),
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(0.0, contentFractionalOffset / 5),
end: Offset(0.0, 0.100),
).animate(animationOffset),
child: Material(
color: Colors.transparent,
child: GestureDetector(
onTap: onTooltipTap,
child: Container(
padding: EdgeInsets.only(
top: paddingTop,
),
color: Colors.transparent,
child: Center(
child: container,
),
),
),
),
),
),
),
],
);
}
}
Widget _getArrow(contentOffsetMultiplier) {
final contentFractionalOffset = contentOffsetMultiplier.clamp(-1.0, 0.0);
return Positioned(
top: isArrowUp ? position.getBottom() : position.getTop() - 1,
left: position.getCenter() - 24,
child: FractionalTranslation(
translation: Offset(0.0, contentFractionalOffset),
child: SlideTransition(
position: Tween<Offset>(
begin: Offset(0.0, contentFractionalOffset / 5),
end: Offset(0.0, 0.150),
).animate(animationOffset),
child: isArrowUp
? Icon(
Icons.arrow_drop_up,
color: tooltipColor,
size: 50,
)
: Icon(
Icons.arrow_drop_down,
color: tooltipColor,
size: 50,
),
),
),
);
}
}

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class CustomValidationError extends StatelessWidget { class CustomValidationError extends StatelessWidget {
String error; String? error;
CustomValidationError({ CustomValidationError({
Key ? key, this.error, Key ? key, this.error,
}) : super(key: key); }) : super(key: key);

@ -7,15 +7,15 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class InPatientDoctorCard extends StatelessWidget { class InPatientDoctorCard extends StatelessWidget {
final String doctorName; final String? doctorName;
final String branch; final String? branch;
final DateTime appointmentDate; final DateTime? appointmentDate;
final String profileUrl; final String? profileUrl;
final String invoiceNO; final String? invoiceNO;
final String orderNo; final String? orderNo;
final Function onTap; final VoidCallback? onTap;
final bool isPrescriptions; final bool? isPrescriptions;
final String clinic; final String? clinic;
final createdBy; final createdBy;
InPatientDoctorCard( InPatientDoctorCard(
@ -63,14 +63,14 @@ class InPatientDoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}',
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
), ),
if (!isPrescriptions) if (!isPrescriptions!)
AppText( AppText(
'${AppDateUtils.getHour(appointmentDate)}', '${AppDateUtils.getHour(appointmentDate!)}',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.grey[700], color: Colors.grey[700],
fontSize: 14, fontSize: 14,

@ -4,30 +4,25 @@ import 'package:flutter/material.dart';
/// [page] /// [page]
class FadePage extends PageRouteBuilder { class FadePage extends PageRouteBuilder {
final Widget page; final Widget page;
FadePage({this.page}) FadePage({required this.page})
: super( : super(
opaque: false, opaque: false,
settings: RouteSettings(name: page.runtimeType.toString()), settings: RouteSettings(name: page.runtimeType.toString()),fullscreenDialog: true,
fullscreenDialog: true, barrierDismissible: true,
barrierDismissible: true, barrierColor: Colors.black.withOpacity(0.8),
barrierColor: Colors.black.withOpacity(0.8), pageBuilder: (
pageBuilder: ( BuildContext context,
BuildContext context, Animation<double> animation,
Animation<double> animation, Animation<double> secondaryAnimation,
Animation<double> secondaryAnimation, ) =>
) => page,
page, transitionDuration: Duration(milliseconds: 300),
transitionDuration: Duration(milliseconds: 300), transitionsBuilder: (
transitionsBuilder: ( BuildContext context,
BuildContext context, Animation<double> animation,
Animation<double> animation, Animation<double> secondaryAnimation,
Animation<double> secondaryAnimation, Widget child,
Widget child, ) {
) { return FadeTransition(opacity: animation, child: child);
return FadeTransition( });
opacity: animation,
child: child
);
}
);
} }

@ -9,9 +9,9 @@ class SlideUpPageRoute extends PageRouteBuilder {
final Widget widget; final Widget widget;
final bool fullscreenDialog; final bool fullscreenDialog;
final bool opaque; final bool opaque;
final String settingRoute; final String? settingRoute;
SlideUpPageRoute({this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute}) SlideUpPageRoute({required this.widget, this.fullscreenDialog = false, this.opaque = true, this.settingRoute})
: super( : super(
pageBuilder: ( pageBuilder: (
BuildContext context, BuildContext context,

Loading…
Cancel
Save