Merge branch 'h20_E_referral' into 'master'
H20 e referral See merge request Cloud_Solution/diplomatic-quarter!59merge-update-with-lab-changes
commit
9aa217c247
@ -0,0 +1,6 @@
|
||||
#Sun Sep 20 09:53:06 EEST 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@ -0,0 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@ -0,0 +1,8 @@
|
||||
## This file must *NOT* be checked into Version Control Systems,
|
||||
# as it contains information specific to your local configuration.
|
||||
#
|
||||
# Location of the SDK. This is only used by Gradle.
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#Sun Sep 20 09:53:03 EEST 2020
|
||||
sdk.dir=/Users/erababah/Library/Android/sdk
|
||||
@ -0,0 +1,57 @@
|
||||
class CheckActivationCodeForEReferralResponseModel {
|
||||
String logInTokenID;
|
||||
String activationCode;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
CheckActivationCodeForEReferralResponseModel(
|
||||
{this.logInTokenID,
|
||||
this.activationCode,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
CheckActivationCodeForEReferralResponseModel.fromJson(
|
||||
Map<String, dynamic> json) {
|
||||
logInTokenID = json['LogInTokenID'];
|
||||
activationCode = json['activationCode'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['LogInTokenID'] = this.logInTokenID;
|
||||
data['activationCode'] = this.activationCode;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
class CreateEReferralRequestModel {
|
||||
bool isInsuredPatient;
|
||||
String cityCode;
|
||||
String cityName;
|
||||
String requesterName;
|
||||
String requesterContactNo;
|
||||
int requesterRelationship;
|
||||
String otherRelationship;
|
||||
String fullName;
|
||||
int identificationNo;
|
||||
String patientMobileNumber;
|
||||
int preferredBranchCode;
|
||||
String preferredBranchName;
|
||||
List<EReferralAttachment> medicalReportAttachment;
|
||||
dynamic insuranceCardAttachment;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
CreateEReferralRequestModel(
|
||||
{this.isInsuredPatient,
|
||||
this.cityCode,
|
||||
this.cityName,
|
||||
this.requesterName,
|
||||
this.requesterContactNo,
|
||||
this.requesterRelationship,
|
||||
this.otherRelationship,
|
||||
this.fullName,
|
||||
this.identificationNo,
|
||||
this.patientMobileNumber,
|
||||
this.preferredBranchCode,
|
||||
this.preferredBranchName,
|
||||
this.medicalReportAttachment,
|
||||
this.insuranceCardAttachment,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
CreateEReferralRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
isInsuredPatient = json['IsInsuredPatient'];
|
||||
cityCode = json['CityCode'];
|
||||
cityName = json['CityName'];
|
||||
requesterName = json['RequesterName'];
|
||||
requesterContactNo = json['RequesterContactNo'];
|
||||
requesterRelationship = json['RequesterRelationship'];
|
||||
otherRelationship = json['OtherRelationship'];
|
||||
fullName = json['FullName'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
preferredBranchCode = json['PreferredBranchCode'];
|
||||
preferredBranchName = json['PreferredBranchName'];
|
||||
if (json['MedicalReportAttachment'] != null) {
|
||||
medicalReportAttachment = new List<EReferralAttachment>();
|
||||
json['MedicalReportAttachment'].forEach((v) {
|
||||
medicalReportAttachment.add(new EReferralAttachment.fromJson(v));
|
||||
});
|
||||
}
|
||||
insuranceCardAttachment = json['InsuranceCardAttachment'] != null
|
||||
? new EReferralAttachment.fromJson(json['InsuranceCardAttachment'])
|
||||
: null;
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IsInsuredPatient'] = this.isInsuredPatient;
|
||||
data['CityCode'] = this.cityCode;
|
||||
data['CityName'] = this.cityName;
|
||||
data['RequesterName'] = this.requesterName;
|
||||
data['RequesterContactNo'] = this.requesterContactNo;
|
||||
data['RequesterRelationship'] = this.requesterRelationship;
|
||||
data['OtherRelationship'] = this.otherRelationship;
|
||||
data['FullName'] = this.fullName;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['PreferredBranchCode'] = this.preferredBranchCode;
|
||||
data['PreferredBranchName'] = this.preferredBranchName;
|
||||
if (this.medicalReportAttachment != null) {
|
||||
data['MedicalReportAttachment'] =
|
||||
this.medicalReportAttachment.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (this.insuranceCardAttachment == null) {
|
||||
data['InsuranceCardAttachment'] = {};
|
||||
} else
|
||||
data['InsuranceCardAttachment'] = this.insuranceCardAttachment.toJson();
|
||||
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class EReferralAttachment {
|
||||
String fileName;
|
||||
String base64String;
|
||||
|
||||
EReferralAttachment({this.fileName, this.base64String});
|
||||
|
||||
EReferralAttachment.fromJson(Map<String, dynamic> json) {
|
||||
fileName = json['FileName'];
|
||||
base64String = json['Base64String'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['FileName'] = this.fileName;
|
||||
data['Base64String'] = this.base64String;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
class GetAllCitiesRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
GetAllCitiesRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
GetAllCitiesRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
class GetAllCitiesResponseModel {
|
||||
int iD;
|
||||
String description;
|
||||
String descriptionN;
|
||||
|
||||
GetAllCitiesResponseModel({this.iD, this.description, this.descriptionN});
|
||||
|
||||
GetAllCitiesResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
description = json['Description'];
|
||||
descriptionN = json['DescriptionN'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['Description'] = this.description;
|
||||
data['DescriptionN'] = this.descriptionN;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
class GetAllRelationshipTypeRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
GetAllRelationshipTypeRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
GetAllRelationshipTypeRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
class GetAllRelationshipTypeResponseModel {
|
||||
int iD;
|
||||
String text;
|
||||
String textAr;
|
||||
String textEn;
|
||||
|
||||
GetAllRelationshipTypeResponseModel(
|
||||
{this.iD, this.text, this.textAr, this.textEn});
|
||||
|
||||
GetAllRelationshipTypeResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
text = json['Text'];
|
||||
textAr = json['Text_Ar'];
|
||||
textEn = json['Text_En'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['Text'] = this.text;
|
||||
data['Text_Ar'] = this.textAr;
|
||||
data['Text_En'] = this.textEn;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
class SearchCriteriaModel {
|
||||
String name;
|
||||
String nameAr;
|
||||
int value;
|
||||
|
||||
SearchCriteriaModel({this.name, this.nameAr, this.value});
|
||||
|
||||
SearchCriteriaModel.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'];
|
||||
nameAr = json['name_ar'];
|
||||
value = json['value'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['name'] = this.name;
|
||||
data['name_ar'] = this.nameAr;
|
||||
data['value'] = this.value;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
class SearchEReferralRequestModel {
|
||||
String patientMobileNumber;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int referralNumber;
|
||||
String identificationNo;
|
||||
|
||||
SearchEReferralRequestModel(
|
||||
{this.patientMobileNumber,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.referralNumber,
|
||||
this.identificationNo});
|
||||
|
||||
SearchEReferralRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
referralNumber = json['ReferralNumber'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['ReferralNumber'] = this.referralNumber;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
class SearchEReferralResponseModel {
|
||||
String patientMobileNumber;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int referralNumber;
|
||||
String identificationNo;
|
||||
|
||||
SearchEReferralResponseModel(
|
||||
{this.patientMobileNumber,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.referralNumber,
|
||||
this.identificationNo});
|
||||
|
||||
SearchEReferralResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
referralNumber = json['ReferralNumber'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['ReferralNumber'] = this.referralNumber;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
class SendActivationCodeForEReferralRequestModel {
|
||||
int patientMobileNumber;
|
||||
String zipCode;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
|
||||
SendActivationCodeForEReferralRequestModel(
|
||||
{this.patientMobileNumber,
|
||||
this.zipCode,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID});
|
||||
|
||||
SendActivationCodeForEReferralRequestModel.fromJson(
|
||||
Map<String, dynamic> json) {
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
zipCode = json['ZipCode'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['ZipCode'] = this.zipCode;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
class InsertUserActivityRequestModel {
|
||||
String identificationNo;
|
||||
String mobileNumber;
|
||||
int quantityIntake;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
InsertUserActivityRequestModel(
|
||||
{this.identificationNo,
|
||||
this.mobileNumber,
|
||||
this.quantityIntake,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
InsertUserActivityRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
identificationNo = json['IdentificationNo'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
quantityIntake = json['QuantityIntake'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['QuantityIntake'] = this.quantityIntake;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
class UserProgressForMonthDataModel {
|
||||
int monthNumber;
|
||||
String monthName;
|
||||
int percentageConsumed;
|
||||
|
||||
UserProgressForMonthDataModel(
|
||||
{this.monthNumber, this.monthName, this.percentageConsumed});
|
||||
|
||||
UserProgressForMonthDataModel.fromJson(Map<String, dynamic> json) {
|
||||
monthNumber = json['MonthNumber'];
|
||||
monthName = json['MonthName'];
|
||||
percentageConsumed = json['PercentageConsumed'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['MonthNumber'] = this.monthNumber;
|
||||
data['MonthName'] = this.monthName;
|
||||
data['PercentageConsumed'] = this.percentageConsumed;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
class UserProgressForTodayDataModel {
|
||||
dynamic quantityConsumed;
|
||||
dynamic percentageConsumed;
|
||||
dynamic percentageLeft;
|
||||
dynamic quantityLimit;
|
||||
|
||||
UserProgressForTodayDataModel(
|
||||
{this.quantityConsumed,
|
||||
this.percentageConsumed,
|
||||
this.percentageLeft,
|
||||
this.quantityLimit});
|
||||
|
||||
UserProgressForTodayDataModel.fromJson(Map<String, dynamic> json) {
|
||||
quantityConsumed = json['QuantityConsumed'];
|
||||
percentageConsumed = json['PercentageConsumed'];
|
||||
percentageLeft = json['PercentageLeft'];
|
||||
quantityLimit = json['QuantityLimit'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['QuantityConsumed'] = this.quantityConsumed;
|
||||
data['PercentageConsumed'] = this.percentageConsumed;
|
||||
data['PercentageLeft'] = this.percentageLeft;
|
||||
data['QuantityLimit'] = this.quantityLimit;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
class UserProgressForWeekDataModel {
|
||||
int dayNumber;
|
||||
dynamic dayDate;
|
||||
String dayName;
|
||||
int percentageConsumed;
|
||||
|
||||
UserProgressForWeekDataModel(
|
||||
{this.dayNumber, this.dayDate, this.dayName, this.percentageConsumed});
|
||||
|
||||
UserProgressForWeekDataModel.fromJson(Map<String, dynamic> json) {
|
||||
dayNumber = json['DayNumber'];
|
||||
dayDate = json['DayDate'];
|
||||
dayName = json['DayName'];
|
||||
percentageConsumed = json['PercentageConsumed'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['DayNumber'] = this.dayNumber;
|
||||
data['DayDate'] = this.dayDate;
|
||||
data['DayName'] = this.dayName;
|
||||
data['PercentageConsumed'] = this.percentageConsumed;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
class UserProgressRequestModel {
|
||||
int progress;
|
||||
String mobileNumber;
|
||||
String identificationNo;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
int patientID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
|
||||
UserProgressRequestModel(
|
||||
{this.progress,
|
||||
this.mobileNumber,
|
||||
this.identificationNo,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.patientID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType});
|
||||
|
||||
UserProgressRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
progress = json['Progress'];
|
||||
mobileNumber = json['MobileNumber'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
versionID = json['VersionID'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
patientID = json['PatientID'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['Progress'] = this.progress;
|
||||
data['MobileNumber'] = this.mobileNumber;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class H2OService extends BaseService {
|
||||
List<UserProgressForTodayDataModel> userProgressForTodayDataList = List();
|
||||
List<UserProgressForWeekDataModel> userProgressForWeekDataList = List();
|
||||
List<UserProgressForMonthDataModel> userProgressForMonthDataList = List();
|
||||
UserProgressRequestModel userProgressRequestModel =
|
||||
UserProgressRequestModel();
|
||||
|
||||
Future getUserProgressForTodayData() async {
|
||||
userProgressRequestModel.progress = 1;
|
||||
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
|
||||
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(H2O_GET_USER_PROGRESS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
userProgressForTodayDataList.clear();
|
||||
response['UserProgressForTodayData'].forEach((progressData) {
|
||||
userProgressForTodayDataList
|
||||
.add(UserProgressForTodayDataModel.fromJson(progressData));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: userProgressRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getUserProgressForWeekData() async {
|
||||
userProgressRequestModel.progress = 2;
|
||||
userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1);
|
||||
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(H2O_GET_USER_PROGRESS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
userProgressForTodayDataList.clear();
|
||||
response['UserProgressForWeekData'].forEach((hospital) {
|
||||
userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: userProgressRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getUserProgressForMonthData() async {
|
||||
userProgressRequestModel.progress = 3;
|
||||
userProgressRequestModel.mobileNumber = super.user.mobileNumber.substring(1);
|
||||
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(H2O_GET_USER_PROGRESS,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
userProgressForMonthDataList.clear();
|
||||
response['UserProgressForMonthData'].forEach((hospital) {
|
||||
userProgressForMonthDataList.add(UserProgressForMonthDataModel.fromJson(hospital));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: userProgressRequestModel.toJson());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
|
||||
|
||||
hasError = false;
|
||||
await baseAppClient.post(H2O_INSERT_USER_ACTIVITY,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
userProgressForTodayDataList.clear();
|
||||
response['UserProgressForTodayData'].forEach((progressData) {
|
||||
userProgressForTodayDataList
|
||||
.add(UserProgressForTodayDataModel.fromJson(progressData));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: insertUserActivityRequestModel.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
|
||||
class EReferralService extends BaseService {
|
||||
List<GetAllRelationshipTypeResponseModel> _relationTypes = List();
|
||||
List<GetAllRelationshipTypeResponseModel> get relationTypes => _relationTypes;
|
||||
List<GetAllCitiesResponseModel> _allCities = List();
|
||||
List<GetAllCitiesResponseModel> get allCities => _allCities;
|
||||
|
||||
List<SearchEReferralResponseModel> _allReferral = List();
|
||||
List<SearchEReferralResponseModel> get allReferral => _allReferral;
|
||||
String _activationCode;
|
||||
String _logInTokenID;
|
||||
|
||||
String get activationCode => _activationCode;
|
||||
|
||||
bool _isActivationCodeValid = false;
|
||||
|
||||
bool get isActivationCodeValid => _isActivationCodeValid;
|
||||
|
||||
Future getRelationTypes() async {
|
||||
await baseAppClient.post(GET_ALL_RELATIONSHIP_TYPES,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_relationTypes.clear();
|
||||
response['List_EReferralResult'].forEach((relation) {
|
||||
_relationTypes
|
||||
.add(GetAllRelationshipTypeResponseModel.fromJson(relation));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: {});
|
||||
}
|
||||
|
||||
Future getAllCities() async {
|
||||
await baseAppClient.post(GET_ALL_CITIES,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_allCities.clear();
|
||||
response['ListCities'].forEach((city) {
|
||||
_allCities
|
||||
.add(GetAllCitiesResponseModel.fromJson(city));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: {});
|
||||
}
|
||||
|
||||
Future sendActivationCodeForEReferral(
|
||||
|
||||
SendActivationCodeForEReferralRequestModel
|
||||
sendActivationCodeForEReferralRequestModel) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_activationCode = response["VerificationCode"];
|
||||
_logInTokenID = response["LogInTokenID"];
|
||||
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: sendActivationCodeForEReferralRequestModel.toJson());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Future checkActivationCodeForEReferral(
|
||||
CheckActivationCodeForEReferralResponseModel
|
||||
checkActivationCodeForEReferralRequestModel) async {
|
||||
checkActivationCodeForEReferralRequestModel.isDentalAllowedBackend = false;
|
||||
checkActivationCodeForEReferralRequestModel.logInTokenID= _logInTokenID;
|
||||
hasError =false;
|
||||
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_E_REFERRAL,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_isActivationCodeValid = true;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: checkActivationCodeForEReferralRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future createEReferral(
|
||||
CreateEReferralRequestModel createEReferralRequestModel
|
||||
) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
// TODO Waiting for fix service
|
||||
var asd= ("EEEEEE");
|
||||
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: createEReferralRequestModel.toJson());
|
||||
}
|
||||
|
||||
Future getEReferrals(
|
||||
SearchEReferralRequestModel searchEReferralRequestModel
|
||||
) async {
|
||||
hasError = false;
|
||||
// TODO return this code when the fix the server
|
||||
// await baseAppClient.post(GET_E_REFERRALS,
|
||||
// onSuccess: (dynamic response, int statusCode) {
|
||||
// print("EEEEEE");
|
||||
// // TODO Waiting for fix service
|
||||
// // ToDo change this one when you have data
|
||||
// _allReferral.clear();
|
||||
// // response['ListCities'].forEach((city) {
|
||||
// // _allReferral
|
||||
// // .add(SearchEReferralResponseModel.fromJson(city));
|
||||
// // });
|
||||
//
|
||||
// }, onFailure: (String error, int statusCode) {
|
||||
// hasError = true;
|
||||
// super.error = error;
|
||||
// }, body: searchEReferralRequestModel.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
|
||||
class AuthenticatedUserObject{
|
||||
AuthenticatedUser user;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
bool isLogin = false;
|
||||
AuthenticatedUserObject(){
|
||||
getUser();
|
||||
}
|
||||
|
||||
getUser() async {
|
||||
if (user==null) {
|
||||
var userData = await sharedPref.getObject(USER_PROFILE);
|
||||
if (userData != null) user = AuthenticatedUser.fromJson(userData);
|
||||
}
|
||||
|
||||
var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID);
|
||||
this.isLogin = isLogin != null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,125 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_month_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_today_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/user_progress_for_week_data_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import '../../../locator.dart';
|
||||
|
||||
class H2OViewModel extends BaseViewModel {
|
||||
|
||||
H2OService _h2OService = locator<H2OService>();
|
||||
|
||||
List<charts.Series> userProgressForWeekDataSeries;
|
||||
List<charts.Series> userProgressForMonthDataSeries;
|
||||
|
||||
UserProgressForTodayDataModel get userProgressData {
|
||||
if (_h2OService.userProgressForTodayDataList.length != 0)
|
||||
return _h2OService.userProgressForTodayDataList[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Future getUserProgressForTodayData() async {
|
||||
// if(_h2OService.userProgressForTodayDataList.length==0){
|
||||
setState(ViewState.Busy);
|
||||
await _h2OService.getUserProgressForTodayData();
|
||||
if (_h2OService.hasError) {
|
||||
error = _h2OService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Future getUserProgressForWeekData() async {
|
||||
setState(ViewState.Busy);
|
||||
await _h2OService.getUserProgressForWeekData();
|
||||
if (_h2OService.hasError) {
|
||||
error = _h2OService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
userProgressForWeekDataSeries = createUserProgressForWeekDataSeries();
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Future getUserProgressForMonthData() async {
|
||||
setState(ViewState.Busy);
|
||||
await _h2OService.getUserProgressForMonthData();
|
||||
if (_h2OService.hasError) {
|
||||
error = _h2OService.error;
|
||||
setState(ViewState.Error);
|
||||
} else {
|
||||
userProgressForMonthDataSeries = createUserProgressForMonthDataSeries();
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<charts.Series<ChartSeries,
|
||||
String>> createUserProgressForWeekDataSeries() {
|
||||
List<ChartSeries> globalData = [
|
||||
];
|
||||
_h2OService.userProgressForWeekDataList.forEach((
|
||||
UserProgressForWeekDataModel data) {
|
||||
globalData.add(new ChartSeries(data.dayName, data.percentageConsumed));
|
||||
});
|
||||
return [
|
||||
new charts.Series<ChartSeries, String>(
|
||||
id: 'Global Revenue',
|
||||
domainFn: (ChartSeries sales, _) => sales.y,
|
||||
measureFn: (ChartSeries sales, _) => sales.x,
|
||||
data: globalData,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
List<charts.Series<ChartSeries,
|
||||
String>> createUserProgressForMonthDataSeries() {
|
||||
List<ChartSeries> globalData = [
|
||||
];
|
||||
_h2OService.userProgressForMonthDataList.forEach((
|
||||
UserProgressForMonthDataModel data) {
|
||||
globalData.add(new ChartSeries(data.monthName, data.percentageConsumed));
|
||||
});
|
||||
return [
|
||||
new charts.Series<ChartSeries, String>(
|
||||
id: 'Global Revenue',
|
||||
domainFn: (ChartSeries sales, _) => sales.y,
|
||||
measureFn: (ChartSeries sales, _) => sales.x,
|
||||
data: globalData,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Future insertUserActivity(
|
||||
InsertUserActivityRequestModel insertUserActivityRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
insertUserActivityRequestModel.mobileNumber =
|
||||
user.mobileNumber.substring(1);
|
||||
insertUserActivityRequestModel.identificationNo =
|
||||
user.patientIdentificationNo;
|
||||
|
||||
await _h2OService.insertUserActivity(insertUserActivityRequestModel);
|
||||
if (_h2OService.hasError) {
|
||||
error = _h2OService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Sample ordinal data type.
|
||||
class ChartSeries {
|
||||
final String y;
|
||||
final int x;
|
||||
|
||||
ChartSeries(this.y, this.x);
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/e_referral_service.dart';
|
||||
|
||||
import '../../../locator.dart';
|
||||
import '../base_view_model.dart';
|
||||
|
||||
class EReferralViewModel extends BaseViewModel {
|
||||
EReferralService _eReferralService = locator<EReferralService>();
|
||||
|
||||
List<GetAllRelationshipTypeResponseModel> get relationTypes =>
|
||||
_eReferralService.relationTypes;
|
||||
List<GetAllCitiesResponseModel> get allCities => _eReferralService.allCities;
|
||||
List<SearchEReferralResponseModel> get allReferral => _eReferralService.allReferral;
|
||||
|
||||
|
||||
|
||||
void getRelationTypes() async {
|
||||
setState(ViewState.Busy);
|
||||
await _eReferralService.getRelationTypes();
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.Error);
|
||||
} else{
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
void getAllCities() async {
|
||||
setState(ViewState.Busy);
|
||||
await _eReferralService.getAllCities();
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.Error);
|
||||
} else{
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else{
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else{
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
void createEReferral(
|
||||
CreateEReferralRequestModel createEReferralRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
await _eReferralService.createEReferral(createEReferralRequestModel);
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
|
||||
getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async {
|
||||
setState(ViewState.BusyLocal);
|
||||
await _eReferralService.getEReferrals(searchEReferralRequestModel);
|
||||
if (_eReferralService.hasError) {
|
||||
error = _eReferralService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
|
||||
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'new_e_referral_step_three_page.dart';
|
||||
import 'new_e_referral_step_two_page.dart';
|
||||
|
||||
class StartIndexForNewEReferral extends StatefulWidget {
|
||||
|
||||
StartIndexForNewEReferral();
|
||||
|
||||
@override
|
||||
_StartIndexForNewEReferralState createState() =>
|
||||
_StartIndexForNewEReferralState();
|
||||
}
|
||||
|
||||
class _StartIndexForNewEReferralState extends State<StartIndexForNewEReferral>
|
||||
with TickerProviderStateMixin {
|
||||
PageController _controller;
|
||||
int _currentIndex = 1;
|
||||
int pageSelected = 2;
|
||||
|
||||
|
||||
CreateEReferralRequestModel createEReferralRequestModel = new CreateEReferralRequestModel();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = new PageController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
changePageViewIndex(pageIndex) {
|
||||
_controller.jumpToPage(pageIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height,
|
||||
child: PageView(
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
controller: _controller,
|
||||
onPageChanged: (index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
NewEReferralStepOnePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
createEReferralRequestModel: createEReferralRequestModel,
|
||||
),
|
||||
NewEReferralStepTowPage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
createEReferralRequestModel: createEReferralRequestModel,
|
||||
|
||||
),
|
||||
NewEReferralStepThreePage(
|
||||
changePageViewIndex: changePageViewIndex,
|
||||
createEReferralRequestModel: createEReferralRequestModel,
|
||||
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,308 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/send_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class NewEReferralStepOnePage extends StatefulWidget {
|
||||
final CreateEReferralRequestModel createEReferralRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
|
||||
const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState();
|
||||
}
|
||||
|
||||
class _NewEReferralStepOnePageState extends State<NewEReferralStepOnePage> {
|
||||
TextEditingController _nameTextController = TextEditingController();
|
||||
TextEditingController _mobileTextController = TextEditingController();
|
||||
GetAllRelationshipTypeResponseModel _selectedRelation;
|
||||
String email;
|
||||
AuthenticatedUser authenticatedUser;
|
||||
GetAllSharedRecordsByStatusList selectedPatientFamily;
|
||||
AdvanceModel advanceModel = AdvanceModel();
|
||||
|
||||
// todo create a model for Country
|
||||
// todo use country from the json
|
||||
dynamic _selectedCountry = {
|
||||
"name": "Saudi Arabia",
|
||||
"name_ar": "المملكة العربية السعودية",
|
||||
"code": "+966",
|
||||
"countryCode": "SA",
|
||||
"pattern": "5xxxxxxxx",
|
||||
"maxLength": 9
|
||||
};
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AuthenticatedUser authUser;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void showSMSDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
child: EReferralConfirmSMSDialog(
|
||||
phoneNumber: _selectedCountry['code']+_mobileTextController.text,
|
||||
onSucces: (){
|
||||
Navigator.of(context).pop();
|
||||
widget.changePageViewIndex(1);
|
||||
widget.createEReferralRequestModel.requesterName=_nameTextController.text;
|
||||
widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text;
|
||||
widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
),
|
||||
).then((value) {
|
||||
print("dialog dismissed");
|
||||
print(value);
|
||||
if (value != null && value) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
return BaseView<EReferralViewModel>(
|
||||
onModelReady: (model) => model.getRelationTypes(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Center(
|
||||
child: Texts(
|
||||
// TranslationBase.of(context).advancePaymentLabel,
|
||||
"Referral requester information",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "Enter Referral Requester Name*",
|
||||
controller: _nameTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmSelectCountryTypeDialog(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getCountryName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
MobileNumberTextFiled(
|
||||
controller: _mobileTextController,
|
||||
code: _selectedCountry == null
|
||||
? "11"
|
||||
: _selectedCountry["code"],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Center(
|
||||
child: Texts(
|
||||
// TranslationBase.of(context).advancePaymentLabel,
|
||||
"Requester Relationship",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmSelectRelationTypeDialog(
|
||||
model.relationTypes),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getRelationName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height * 0.1,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(9),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: "Next",
|
||||
onTap: () async {
|
||||
SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel =
|
||||
SendActivationCodeForEReferralRequestModel(
|
||||
zipCode: _selectedCountry['code'],
|
||||
patientMobileNumber: int.parse(
|
||||
_mobileTextController.text),);
|
||||
await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel);
|
||||
|
||||
showSMSDialog();
|
||||
},
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
disabled:
|
||||
_nameTextController.text.isEmpty ||
|
||||
_selectedRelation == null ||
|
||||
_mobileTextController.text.isEmpty,
|
||||
),
|
||||
)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void confirmSelectRelationTypeDialog(
|
||||
List<GetAllRelationshipTypeResponseModel> relations) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectRelationTypeDialog(
|
||||
relationTypes: relations,
|
||||
selectedRelation: _selectedRelation,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedRelation = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void confirmSelectCountryTypeDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectCountryDialog(
|
||||
selectedCountry: _selectedCountry,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedCountry = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getRelationName() {
|
||||
if (_selectedRelation != null)
|
||||
return _selectedRelation.text;
|
||||
else
|
||||
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
|
||||
}
|
||||
|
||||
String getCountryName() {
|
||||
if (_selectedCountry != null)
|
||||
return _selectedCountry["name"];
|
||||
else
|
||||
return "Country";
|
||||
}
|
||||
}
|
||||
|
||||
class MobileNumberTextFiled extends StatelessWidget {
|
||||
const MobileNumberTextFiled({
|
||||
Key key,
|
||||
this.controller,
|
||||
this.code
|
||||
}) : super(key: key);
|
||||
|
||||
|
||||
final TextEditingController controller;
|
||||
final String code;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15), color: Colors.white),
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Icon(
|
||||
Icons.phone,
|
||||
color: Colors.red,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
code.toString(),
|
||||
overflow: TextOverflow.clip,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none, hintText: '5xxxxxxxx'),
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,427 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../dialogs/select_city_dialog.dart';
|
||||
|
||||
class NewEReferralStepThreePage extends StatefulWidget {
|
||||
final CreateEReferralRequestModel createEReferralRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
|
||||
const NewEReferralStepThreePage(
|
||||
{Key key, this.createEReferralRequestModel, this.changePageViewIndex})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_NewEReferralStepThreePageState createState() =>
|
||||
_NewEReferralStepThreePageState();
|
||||
}
|
||||
|
||||
class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
|
||||
TextEditingController _nameTextController = TextEditingController();
|
||||
TextEditingController _mobileTextController = TextEditingController();
|
||||
GetAllCitiesResponseModel _selectedCity;
|
||||
|
||||
GetAllSharedRecordsByStatusList selectedPatientFamily;
|
||||
List<EReferralAttachment> medicalReportImages = [];
|
||||
List<EReferralAttachment> insuredPatientImages = [];
|
||||
|
||||
bool isPatientInsured = false;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AuthenticatedUser authUser;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<EReferralViewModel>(
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Center(
|
||||
child: Texts(
|
||||
// TranslationBase.of(context).advancePaymentLabel,
|
||||
"Other details",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 9),
|
||||
child: Texts(
|
||||
"Medical Report",
|
||||
color: Colors.grey,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
ImageOptions.showImageOptions(context,
|
||||
(String image) {
|
||||
setState(() {
|
||||
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
|
||||
medicalReportImages.add(eReferralAttachment);
|
||||
});
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 10, right: 10, top: 15),
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
color: Colors.white,
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Center(
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(Icons.attach_file),
|
||||
Texts(
|
||||
'selected attachment',
|
||||
variant: 'bodyText',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
...List.generate(
|
||||
medicalReportImages.length,
|
||||
(index) => Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
FontAwesomeIcons.paperclip),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Texts(
|
||||
medicalReportImages[index].fileName,
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
medicalReportImages
|
||||
.remove(medicalReportImages[index]);
|
||||
});
|
||||
},
|
||||
child: Icon(
|
||||
FontAwesomeIcons.trashAlt,
|
||||
color: Colors.red[300],
|
||||
))
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 9),
|
||||
child: Texts(
|
||||
"Preferred Branch",
|
||||
color: Colors.grey,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () =>
|
||||
confirmSelectCityDialog(model.allCities),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getRelationName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: isPatientInsured,
|
||||
activeColor: Colors.black38,
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
isPatientInsured = newValue;
|
||||
});
|
||||
}),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: Texts(
|
||||
"Insured Patient",
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if(isPatientInsured)
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Opacity(
|
||||
opacity: isPatientInsured?1:0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
InkWell(
|
||||
onTap: () {
|
||||
ImageOptions.showImageOptions(context,
|
||||
(String image) {
|
||||
setState(() {
|
||||
|
||||
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
|
||||
|
||||
insuredPatientImages=[eReferralAttachment];
|
||||
});
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 10, right: 10, top: 15),
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
color: Colors.white,
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
child: Center(
|
||||
child: Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(Icons.attach_file),
|
||||
Texts(
|
||||
'selected attachment',
|
||||
variant: 'bodyText',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
...List.generate(
|
||||
insuredPatientImages.length,
|
||||
(index) => Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Icon(
|
||||
FontAwesomeIcons.paperclip),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Texts(
|
||||
'image ${index + 1}.png',
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
insuredPatientImages
|
||||
.remove(insuredPatientImages[index]);
|
||||
});
|
||||
},
|
||||
child: Icon(
|
||||
FontAwesomeIcons.trashAlt,
|
||||
color: Colors.red[300],
|
||||
))
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(9),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: "Submit",
|
||||
onTap: () async {
|
||||
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
|
||||
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null;
|
||||
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
|
||||
// ToDo make the preferred Branch info dynamic
|
||||
this.widget.createEReferralRequestModel.preferredBranchCode = 15;
|
||||
this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
|
||||
|
||||
|
||||
|
||||
// this.widget.createEReferralRequestModel.fullName= "";
|
||||
this.widget.createEReferralRequestModel.otherRelationship= "";
|
||||
// this.widget.createEReferralRequestModel.;
|
||||
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
|
||||
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
|
||||
|
||||
await model.createEReferral(this.widget.createEReferralRequestModel);
|
||||
},
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
disabled: medicalReportImages.length == 0 ,
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
void confirmSelectCityDialog(List<GetAllCitiesResponseModel> cities) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectCityDialog(
|
||||
cities: cities,
|
||||
selectedCity: _selectedCity,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedCity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
String getRelationName() {
|
||||
if (_selectedCity != null)
|
||||
return _selectedCity.description;
|
||||
else
|
||||
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,294 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import '../dialogs/select_city_dialog.dart';
|
||||
|
||||
|
||||
class NewEReferralStepTowPage extends StatefulWidget {
|
||||
final CreateEReferralRequestModel createEReferralRequestModel;
|
||||
final Function changePageViewIndex;
|
||||
|
||||
const NewEReferralStepTowPage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key);
|
||||
|
||||
@override
|
||||
_NewEReferralStepTowPageState createState() => _NewEReferralStepTowPageState();
|
||||
}
|
||||
|
||||
class _NewEReferralStepTowPageState extends State<NewEReferralStepTowPage> {
|
||||
TextEditingController _patientNameTextController = TextEditingController();
|
||||
TextEditingController _patientIdentificationTextController = TextEditingController();
|
||||
TextEditingController _mobileTextController = TextEditingController();
|
||||
GetAllCitiesResponseModel _selectedCity ;
|
||||
GetAllSharedRecordsByStatusList selectedPatientFamily;
|
||||
|
||||
// todo create a model for Country
|
||||
// todo use country from the json
|
||||
dynamic _selectedCountry = {
|
||||
"name": "Saudi Arabia",
|
||||
"name_ar": "المملكة العربية السعودية",
|
||||
"code": "+966",
|
||||
"countryCode": "SA",
|
||||
"pattern": "5xxxxxxxx",
|
||||
"maxLength": 9
|
||||
};
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AuthenticatedUser authUser;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<EReferralViewModel>(
|
||||
onModelReady: (model) => model.getAllCities(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Center(
|
||||
child: Texts(
|
||||
// TranslationBase.of(context).advancePaymentLabel,
|
||||
"Patient information",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "Enter Identification Number",
|
||||
controller: _patientIdentificationTextController,
|
||||
keyboardType:TextInputType.number ,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "Enter Patient Name",
|
||||
controller: _patientNameTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmSelectCountryTypeDialog(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getCountryName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
MobileNumberTextFiled(
|
||||
controller: _mobileTextController,
|
||||
code: _selectedCountry == null
|
||||
? "11"
|
||||
: _selectedCountry["code"],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Center(
|
||||
child: Texts(
|
||||
// TranslationBase.of(context).advancePaymentLabel,
|
||||
"Where the patient located",
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmSelectCityDialog(
|
||||
model.allCities),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getRelationName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.height * 0.1,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(9),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: "Next",
|
||||
onTap: () async {
|
||||
this.widget.changePageViewIndex(2);
|
||||
this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text);
|
||||
this.widget.createEReferralRequestModel.fullName = _patientNameTextController.text;
|
||||
this.widget.createEReferralRequestModel.patientMobileNumber = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text;
|
||||
this.widget.createEReferralRequestModel.cityCode = _selectedCity.iD.toString();
|
||||
this.widget.createEReferralRequestModel.cityName = _selectedCity.description;
|
||||
|
||||
|
||||
},
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
disabled:
|
||||
_patientNameTextController.text.isEmpty || _patientIdentificationTextController.text.isEmpty||
|
||||
_selectedCity == null ||
|
||||
_mobileTextController.text.isEmpty,
|
||||
),
|
||||
)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
void confirmSelectCityDialog(
|
||||
List<GetAllCitiesResponseModel> cities) {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectCityDialog(
|
||||
cities: cities,
|
||||
selectedCity: _selectedCity,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedCity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void confirmSelectCountryTypeDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectCountryDialog(
|
||||
selectedCountry: _selectedCountry,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedCountry = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getRelationName() {
|
||||
if (_selectedCity != null)
|
||||
return _selectedCity.description;
|
||||
else
|
||||
return "Select City" /*TranslationBase.of(context).selectHospital*/;
|
||||
}
|
||||
|
||||
String getCountryName() {
|
||||
if (_selectedCountry != null)
|
||||
return _selectedCountry["name"];
|
||||
else
|
||||
return "Country";
|
||||
}
|
||||
}
|
||||
|
||||
class MobileNumberTextFiled extends StatelessWidget {
|
||||
const MobileNumberTextFiled({
|
||||
Key key,
|
||||
this.controller,
|
||||
this.code
|
||||
}) : super(key: key);
|
||||
|
||||
|
||||
final TextEditingController controller;
|
||||
final String code;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15), color: Colors.white),
|
||||
child: Row(children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Icon(
|
||||
Icons.phone,
|
||||
color: Colors.red,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
code.toString(),
|
||||
overflow: TextOverflow.clip,
|
||||
)),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(5),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none, hintText: 'Mobile No'),
|
||||
),
|
||||
),
|
||||
)
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectCityDialog extends StatefulWidget {
|
||||
final List<GetAllCitiesResponseModel> cities;
|
||||
final Function(GetAllCitiesResponseModel) onValueSelected;
|
||||
GetAllCitiesResponseModel selectedCity;
|
||||
|
||||
SelectCityDialog(
|
||||
{Key key, this.cities, this.onValueSelected, this.selectedCity});
|
||||
|
||||
@override
|
||||
_SelectCityDialogState createState() => _SelectCityDialogState();
|
||||
}
|
||||
|
||||
class _SelectCityDialogState extends State<SelectCityDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedCity = widget.selectedCity ?? widget.cities[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.cities.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedCity = widget.cities[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.cities[index].description),
|
||||
leading: Radio(
|
||||
value: widget.cities[index],
|
||||
groupValue: widget.selectedCity,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedCity = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedCity);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,129 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectRelationTypeDialog extends StatefulWidget {
|
||||
final List<GetAllRelationshipTypeResponseModel> relationTypes;
|
||||
final Function(GetAllRelationshipTypeResponseModel) onValueSelected;
|
||||
GetAllRelationshipTypeResponseModel selectedRelation;
|
||||
|
||||
SelectRelationTypeDialog(
|
||||
{Key key, this.relationTypes, this.onValueSelected, this.selectedRelation});
|
||||
|
||||
@override
|
||||
_SelectRelationTypeDialogState createState() => _SelectRelationTypeDialogState();
|
||||
}
|
||||
|
||||
class _SelectRelationTypeDialogState extends State<SelectRelationTypeDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedRelation = widget.selectedRelation ?? widget.relationTypes[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.relationTypes.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedRelation = widget.relationTypes[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.relationTypes[index].text),
|
||||
leading: Radio(
|
||||
value: widget.relationTypes[index],
|
||||
groupValue: widget.selectedRelation,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedRelation = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedRelation);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectSearchCriteriaDialog extends StatefulWidget {
|
||||
List<SearchCriteriaModel> searchCriteria = [
|
||||
SearchCriteriaModel(name: "Identification Number",nameAr:"رقم المحول",value: 1),
|
||||
SearchCriteriaModel(name: "Referral Number",nameAr:"رقم المحول",value: 2),
|
||||
];
|
||||
final Function(SearchCriteriaModel) onValueSelected;
|
||||
SearchCriteriaModel selectedCriteria;
|
||||
|
||||
SelectSearchCriteriaDialog(
|
||||
{Key key, this.onValueSelected, this.selectedCriteria});
|
||||
|
||||
@override
|
||||
_SelectSearchCriteriaDialogState createState() => _SelectSearchCriteriaDialogState();
|
||||
}
|
||||
|
||||
class _SelectSearchCriteriaDialogState extends State<SelectSearchCriteriaDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedCriteria = widget.selectedCriteria ?? widget.searchCriteria[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Texts(" Select Search Criteria", fontSize: 20,),
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.searchCriteria.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedCriteria = widget.searchCriteria[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.searchCriteria[index].name),
|
||||
leading: Radio(
|
||||
value: widget.searchCriteria[index],
|
||||
groupValue: widget.selectedCriteria,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedCriteria = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedCriteria);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,380 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EReferralConfirmSMSDialog extends StatefulWidget {
|
||||
final String phoneNumber;
|
||||
final Function onSucces;
|
||||
// final AdvanceModel advanceModel;
|
||||
// final PatientInfoAndMobileNumber patientInfoAndMobileNumber;
|
||||
// final String selectedPaymentMethod;
|
||||
|
||||
const EReferralConfirmSMSDialog(
|
||||
{Key key,
|
||||
this.phoneNumber,
|
||||
this.onSucces
|
||||
// this.advanceModel,
|
||||
// this.selectedPaymentMethod,
|
||||
// this.patientInfoAndMobileNumber
|
||||
})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_EReferralConfirmSMSDialogState createState() => _EReferralConfirmSMSDialogState();
|
||||
}
|
||||
|
||||
class _EReferralConfirmSMSDialogState extends State<EReferralConfirmSMSDialog> {
|
||||
final verifyAccountForm = GlobalKey<FormState>();
|
||||
Map verifyAccountFormValue = {
|
||||
'digit1': null,
|
||||
'digit2': null,
|
||||
'digit3': null,
|
||||
'digit4': null,
|
||||
};
|
||||
|
||||
TextEditingController digit1 = TextEditingController(text: "");
|
||||
TextEditingController digit2 = TextEditingController(text: "");
|
||||
TextEditingController digit3 = TextEditingController(text: "");
|
||||
TextEditingController digit4 = TextEditingController(text: "");
|
||||
|
||||
String timerText = (TIMER_MIN - 1).toString() + ':59';
|
||||
int min = TIMER_MIN - 1;
|
||||
int sec = 59;
|
||||
Timer _timer;
|
||||
|
||||
resendCode() {
|
||||
min = TIMER_MIN - 1;
|
||||
sec = 59;
|
||||
_timer = Timer.periodic(Duration(seconds: 1), (Timer timer) {
|
||||
if (min <= 0 && sec <= 0) {
|
||||
timer.cancel();
|
||||
} else {
|
||||
setState(() {
|
||||
sec = sec - 1;
|
||||
if (sec == 0 && min == 0) {
|
||||
Navigator.pop(context);
|
||||
min = 0;
|
||||
sec = 0;
|
||||
} else if (sec == 0) {
|
||||
min = min - 1;
|
||||
sec = 59;
|
||||
}
|
||||
timerText = min.toString() + ':' + sec.toString();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
FocusNode focusD1;
|
||||
FocusNode focusD2;
|
||||
FocusNode focusD3;
|
||||
FocusNode focusD4;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
resendCode();
|
||||
focusD1 = FocusNode();
|
||||
focusD2 = FocusNode();
|
||||
focusD3 = FocusNode();
|
||||
focusD4 = FocusNode();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_timer.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<EReferralViewModel>(
|
||||
builder: (_, model, w) => Dialog(
|
||||
elevation: 0.6,
|
||||
child: Container(
|
||||
height: 520,
|
||||
child: ListView(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 40,
|
||||
color: Colors.grey[700],
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
'SMS',
|
||||
color: Colors.white,
|
||||
textAlign: TextAlign.center,
|
||||
))),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.pop(context),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle, color: Colors.white),
|
||||
child: Icon(
|
||||
Icons.clear,
|
||||
color: Colors.grey[900],
|
||||
)),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
'assets/images/login/103.png',
|
||||
height: MediaQuery.of(context).size.width * 0.25,
|
||||
width: MediaQuery.of(context).size.width * 0.25,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Texts(
|
||||
TranslationBase.of(context).pleaseEnterTheVerificationCode +
|
||||
'[${widget.phoneNumber}]',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Form(
|
||||
key: verifyAccountForm,
|
||||
child: Container(
|
||||
width: SizeConfig.realScreenWidth * 0.90,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 65,
|
||||
child: TextFormField(
|
||||
textInputAction: TextInputAction.next,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
),
|
||||
focusNode: focusD1,
|
||||
maxLength: 1,
|
||||
controller: digit1,
|
||||
textAlign: TextAlign.center,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
onSaved: (val) {
|
||||
verifyAccountFormValue['digit1'] = val;
|
||||
},
|
||||
validator: validateCodeDigit,
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(focusD2);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context).requestFocus(focusD2);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 65,
|
||||
child: TextFormField(
|
||||
focusNode: focusD2,
|
||||
controller: digit2,
|
||||
textInputAction: TextInputAction.next,
|
||||
maxLength: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
validator: validateCodeDigit,
|
||||
onSaved: (val) {
|
||||
verifyAccountFormValue['digit2'] = val;
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(focusD3);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context).requestFocus(focusD3);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 65,
|
||||
child: TextFormField(
|
||||
focusNode: focusD3,
|
||||
controller: digit3,
|
||||
textInputAction: TextInputAction.next,
|
||||
maxLength: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
validator: validateCodeDigit,
|
||||
onSaved: (val) {
|
||||
verifyAccountFormValue['digit3'] = val;
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(focusD4);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD4);
|
||||
}
|
||||
},
|
||||
)),
|
||||
Container(
|
||||
width: 65,
|
||||
child: TextFormField(
|
||||
focusNode: focusD4,
|
||||
controller: digit4,
|
||||
maxLength: 1,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: buildInputDecoration(context),
|
||||
validator: validateCodeDigit,
|
||||
onSaved: (val) {
|
||||
verifyAccountFormValue['digit4'] = val;
|
||||
},
|
||||
onFieldSubmitted: (_) {
|
||||
FocusScope.of(context).requestFocus(focusD4);
|
||||
submit(model);
|
||||
},
|
||||
onChanged: (val) {
|
||||
if (val.length == 1) {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(focusD4);
|
||||
submit(model);
|
||||
}
|
||||
}),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if (model.state == ViewState.ErrorLocal ||
|
||||
model.state == ViewState.Error)
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 8, right: 8),
|
||||
width: double.maxFinite,
|
||||
child: Texts(
|
||||
model.error,
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
// buildText(),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Texts(
|
||||
TranslationBase.of(context)
|
||||
.theVerificationCodeExpiresIn +
|
||||
' $timerText',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20),
|
||||
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.all(12),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label:
|
||||
TranslationBase.of(context).submit.toUpperCase(),
|
||||
onTap: () {
|
||||
submit(model);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void submit(EReferralViewModel model) async {
|
||||
if (verifyAccountForm.currentState.validate()) {
|
||||
final activationCode =
|
||||
digit1.text + digit2.text + digit3.text + digit4.text;
|
||||
|
||||
|
||||
// ToDo call service
|
||||
CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel= new CheckActivationCodeForEReferralResponseModel(activationCode: activationCode);
|
||||
await model.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel);
|
||||
if(model.state == ViewState.ErrorLocal) {
|
||||
// Utils.showErrorToast(model.error);
|
||||
} else {
|
||||
widget.onSucces();
|
||||
// Navigator.push(context, FadePage(page: StartIndexForAddProduct()));
|
||||
// Navigate to new page
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String validateCodeDigit(value) {
|
||||
if (value.isEmpty) {
|
||||
return '';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
InputDecoration buildInputDecoration(BuildContext context) {
|
||||
return InputDecoration(
|
||||
// ts/images/password_icon.png
|
||||
contentPadding: EdgeInsets.only(top: 20, bottom: 20),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5)),
|
||||
borderSide: BorderSide(color: Colors.black),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).primaryColor),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(5.0)),
|
||||
borderSide: BorderSide(color: Theme.of(context).errorColor),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/qr_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/CarouselSlider.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
import '../../../d_q_icons_icons.dart';
|
||||
import 'e_referral_page.dart';
|
||||
|
||||
class EReferralIndexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "Service Information",
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(12),
|
||||
child:
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
"E-Referral: ",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 25,
|
||||
color: Hexcolor("#60686b"),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts(
|
||||
"This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 17,
|
||||
),
|
||||
SizedBox(
|
||||
height: 22,
|
||||
),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.55,
|
||||
width: MediaQuery.of(context).size.width * 0.50,
|
||||
child: CarouselSlider(
|
||||
imagesUrlList: [
|
||||
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png",
|
||||
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png"
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 77,
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
onTap: ()=> Navigator.push(context, FadePage(page: EReferralPage())),
|
||||
label: "E-Referral",
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class EReferralPage extends StatefulWidget {
|
||||
@override
|
||||
_EReferralPageState createState() => _EReferralPageState();
|
||||
}
|
||||
|
||||
class _EReferralPageState extends State<EReferralPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 2, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<EReferralViewModel>(
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "E-Referral",
|
||||
body: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(65.0),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
bottom: 1,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
height: 70.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 60.0,
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
color: Theme.of(context).dividerColor,
|
||||
width: 0.7),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: true,
|
||||
controller: _tabController,
|
||||
indicatorWeight: 5.0,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorColor: Colors.red[800],
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding:
|
||||
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts("New Referral"),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.37,
|
||||
child: Center(
|
||||
child: Texts("Search for Referrals"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[
|
||||
StartIndexForNewEReferral(
|
||||
),
|
||||
SearchForReferralsPage(
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,227 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'New_E_Referral/new_e_referral_step_one_page.dart';
|
||||
import 'dialogs/select_country_ingo_Dialog.dart';
|
||||
import 'dialogs/select_search_criteria_dialog.dart';
|
||||
|
||||
class SearchForReferralsPage extends StatefulWidget {
|
||||
SearchForReferralsPage({Key key});
|
||||
|
||||
@override
|
||||
_SearchForReferralsPageState createState() => _SearchForReferralsPageState();
|
||||
}
|
||||
|
||||
class _SearchForReferralsPageState extends State<SearchForReferralsPage> {
|
||||
TextEditingController _searchTextController = TextEditingController();
|
||||
|
||||
TextEditingController _mobileTextController = TextEditingController();
|
||||
bool _isSubmitted = false;
|
||||
|
||||
dynamic _selectedCountry = {
|
||||
"name": "Saudi Arabia",
|
||||
"name_ar": "المملكة العربية السعودية",
|
||||
"code": "+966",
|
||||
"countryCode": "SA",
|
||||
"pattern": "5xxxxxxxx",
|
||||
"maxLength": 9
|
||||
};
|
||||
|
||||
SearchCriteriaModel selectedCriteria = SearchCriteriaModel(
|
||||
name: "Identification Number", nameAr: "رقم المحول", value: 1);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<EReferralViewModel>(
|
||||
onModelReady: (model) => model.getAllCities(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 77,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => selectSearchCriteriaDialog(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getSearchCriteriaName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: selectedCriteria.value == 1
|
||||
? "Enter Patient Identification No"
|
||||
: "Enter Referral Number",
|
||||
controller: _searchTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmSelectCountryTypeDialog(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getCountryName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
MobileNumberTextFiled(
|
||||
controller: _mobileTextController,
|
||||
code: _selectedCountry == null
|
||||
? "11"
|
||||
: _selectedCountry["code"],
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
if ((model.state == ViewState.Idle &&
|
||||
model.allReferral.length == 0))
|
||||
Text("There's No Referral To deliver"),
|
||||
if ((
|
||||
model.state == ViewState.ErrorLocal))
|
||||
AppEmbeddedError( error:model.error),
|
||||
NetworkBaseView(
|
||||
baseViewModel: model,
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: model.allReferral == null
|
||||
? 0
|
||||
: model.allReferral.length < 3
|
||||
? model.allReferral.length
|
||||
: 3,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.2),
|
||||
child: Container(
|
||||
child: Texts("TODO add referral info"),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.1,
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(9),
|
||||
child: SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: "Search",
|
||||
onTap: () async {
|
||||
SearchEReferralRequestModel searchEReferralRequestModel =
|
||||
new SearchEReferralRequestModel(
|
||||
patientMobileNumber:
|
||||
_selectedCountry['code'] + _mobileTextController.text,
|
||||
);
|
||||
if (selectedCriteria.value == 1) {
|
||||
searchEReferralRequestModel.identificationNo =
|
||||
_searchTextController.text;
|
||||
searchEReferralRequestModel.referralNumber = 0;
|
||||
} else {
|
||||
searchEReferralRequestModel.referralNumber =
|
||||
int.parse(_searchTextController.text);
|
||||
searchEReferralRequestModel.identificationNo = '';
|
||||
}
|
||||
await model.getEReferrals(searchEReferralRequestModel);
|
||||
setState(() {
|
||||
_isSubmitted = true;
|
||||
});
|
||||
},
|
||||
loading: model.state == ViewState.BusyLocal,
|
||||
disabled: _searchTextController.text.isEmpty ||
|
||||
_mobileTextController.text.isEmpty,
|
||||
),
|
||||
)));
|
||||
}
|
||||
|
||||
void confirmSelectCountryTypeDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectCountryDialog(
|
||||
selectedCountry: _selectedCountry,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
_selectedCountry = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getCountryName() {
|
||||
if (_selectedCountry != null)
|
||||
return _selectedCountry["name"];
|
||||
else
|
||||
return "Country";
|
||||
}
|
||||
|
||||
void selectSearchCriteriaDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectSearchCriteriaDialog(
|
||||
selectedCriteria: selectedCriteria,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
selectedCriteria = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getSearchCriteriaName() {
|
||||
return selectedCriteria.name;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class ConfirmAddAmountDialog extends StatefulWidget {
|
||||
final int amount;
|
||||
final String unit;
|
||||
final H2OViewModel model;
|
||||
|
||||
|
||||
ConfirmAddAmountDialog(
|
||||
{Key key, this.model,this.amount,this.unit ="ml"});
|
||||
|
||||
@override
|
||||
_ConfirmAddAmountDialogState createState() => _ConfirmAddAmountDialogState();
|
||||
}
|
||||
|
||||
class _ConfirmAddAmountDialogState extends State<ConfirmAddAmountDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
|
||||
title: Center(
|
||||
child: Texts(
|
||||
"Confirm",
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Divider(),
|
||||
Center(
|
||||
child: Texts(
|
||||
"Are you sure you want to Add ${widget.amount} ${widget.unit} ?",
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () async{
|
||||
InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:widget.amount );
|
||||
await widget.model.insertUserActivity(insertUserActivityRequestModel);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,157 @@
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class SelectAmountDialog extends StatefulWidget {
|
||||
List<AmountModel> searchAmount = [
|
||||
AmountModel(name: "l",nameAr:"لتر",value: 1),
|
||||
AmountModel(name: "ml",nameAr:"مم لتر",value: 2),
|
||||
];
|
||||
final Function(AmountModel) onValueSelected;
|
||||
AmountModel selectedAmount;
|
||||
|
||||
SelectAmountDialog(
|
||||
{Key key, this.onValueSelected, this.selectedAmount});
|
||||
|
||||
@override
|
||||
_SelectAmountDialogState createState() => _SelectAmountDialogState();
|
||||
}
|
||||
|
||||
class _SelectAmountDialogState extends State<SelectAmountDialog> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.selectedAmount = widget.selectedAmount ?? widget.searchAmount[0];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SimpleDialog(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Texts("Select the preferred unit", fontSize: 20,),
|
||||
Divider(),
|
||||
...List.generate(
|
||||
widget.searchAmount.length,
|
||||
(index) => Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.selectedAmount = widget.searchAmount[index];
|
||||
});
|
||||
},
|
||||
child: ListTile(
|
||||
title: Text(widget.searchAmount[index].name),
|
||||
leading: Radio(
|
||||
value: widget.searchAmount[index],
|
||||
groupValue: widget.selectedAmount,
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
widget.selectedAmount = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5.0,
|
||||
),
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).cancel.toUpperCase(),
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 1,
|
||||
height: 30,
|
||||
color: Colors.grey[500],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
widget.onValueSelected(widget.selectedAmount);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Texts(
|
||||
TranslationBase.of(context).ok,
|
||||
fontWeight: FontWeight.w400,
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
class AmountModel {
|
||||
String name;
|
||||
String nameAr;
|
||||
int value;
|
||||
|
||||
AmountModel({this.name, this.nameAr, this.value});
|
||||
|
||||
AmountModel.fromJson(Map<String, dynamic> json) {
|
||||
name = json['name'];
|
||||
nameAr = json['nameAr'];
|
||||
value = json['value'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['name'] = this.name;
|
||||
data['nameAr'] = this.nameAr;
|
||||
data['value'] = this.value;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,131 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'Dialog/select_amount_dialog.dart';
|
||||
|
||||
class AddCustomAmount extends StatefulWidget {
|
||||
final H2OViewModel model;
|
||||
final Function changePageViewIndex;
|
||||
|
||||
const AddCustomAmount({Key key, this.model, this.changePageViewIndex})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AddCustomAmountState createState() => _AddCustomAmountState();
|
||||
}
|
||||
|
||||
class _AddCustomAmountState extends State<AddCustomAmount> {
|
||||
TextEditingController _nameTextController = TextEditingController();
|
||||
AmountModel selectedAmount;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setState(() {
|
||||
_nameTextController.text = "0";
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "Enter amount",
|
||||
body: SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(12),
|
||||
child: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.94,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
NewTextFields(
|
||||
hintText: "Enter the amount of water:",
|
||||
// type: "Number",
|
||||
controller: _nameTextController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () => confirmAmountTypeDialog(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
width: double.infinity,
|
||||
height: 65,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Texts(getAmountName()),
|
||||
Icon(Icons.arrow_drop_down)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
SecondaryButton(
|
||||
textColor: Colors.white,
|
||||
label: "OK",
|
||||
onTap: () async {
|
||||
Navigator.of(context).pop();
|
||||
showConfirmMessage (int.parse(_nameTextController.text), widget.model);
|
||||
},
|
||||
// loading: model.state == ViewState.BusyLocal,
|
||||
disabled: _nameTextController.text.isEmpty || selectedAmount == null),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void confirmAmountTypeDialog() {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: SelectAmountDialog(
|
||||
selectedAmount: selectedAmount,
|
||||
onValueSelected: (value) {
|
||||
setState(() {
|
||||
selectedAmount = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
String getAmountName() {
|
||||
if (selectedAmount != null)
|
||||
return selectedAmount.name;
|
||||
else
|
||||
return "Select unit";
|
||||
}
|
||||
|
||||
|
||||
|
||||
void showConfirmMessage(int amount, H2OViewModel model) {
|
||||
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/CarouselSlider.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
|
||||
class H2OPageIndexPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "Service Information",
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Texts(
|
||||
"Water Tracker:",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 25,
|
||||
color: Hexcolor("#60686b"),
|
||||
),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Texts(
|
||||
"This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 17,
|
||||
),
|
||||
SizedBox(
|
||||
height: 22,
|
||||
),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.55,
|
||||
width: MediaQuery.of(context).size.width * 0.50,
|
||||
child: CarouselSlider(
|
||||
imagesUrlList: [
|
||||
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png",
|
||||
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png"
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 77,
|
||||
),
|
||||
],
|
||||
)),
|
||||
bottomSheet: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.10,
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
child: SecondaryButton(
|
||||
onTap: () =>
|
||||
Navigator.push(context, FadePage(page: H2OPage())),
|
||||
label: "Water Tracker",
|
||||
textColor: Theme.of(context).backgroundColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class H2OPage extends StatefulWidget {
|
||||
@override
|
||||
_H2OPageState createState() => _H2OPageState();
|
||||
}
|
||||
|
||||
class _H2OPageState extends State<H2OPage>
|
||||
with SingleTickerProviderStateMixin {
|
||||
TabController _tabController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = TabController(length: 3, vsync: this,);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_tabController.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<H2OViewModel>(
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: true,
|
||||
appBarTitle: "Water Tracker",
|
||||
body: Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(65.0),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Positioned(
|
||||
bottom: 1,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||
child: Container(
|
||||
color: Theme.of(context)
|
||||
.scaffoldBackgroundColor
|
||||
.withOpacity(0.8),
|
||||
height: 70.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
height: 60.0,
|
||||
margin: EdgeInsets.only(top: 10.0),
|
||||
width: MediaQuery.of(context).size.width * 0.9,
|
||||
|
||||
child: Center(
|
||||
child: TabBar(
|
||||
isScrollable: false,
|
||||
controller: _tabController,
|
||||
indicatorWeight: 5.0,
|
||||
indicatorSize: TabBarIndicatorSize.label,
|
||||
indicatorColor: Colors.red[800],
|
||||
labelColor: Theme.of(context).primaryColor,
|
||||
labelPadding:
|
||||
EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
|
||||
unselectedLabelColor: Colors.grey[800],
|
||||
tabs: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.28,
|
||||
child: Center(
|
||||
child: Texts(
|
||||
"Today"),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.28,
|
||||
child: Center(
|
||||
child: Texts("Week"),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.28,
|
||||
child: Center(
|
||||
child: Texts("Month"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[TodayPage(), WeekPage(), MonthPage()],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class MonthPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<H2OViewModel>(
|
||||
onModelReady: (model) => model.getUserProgressForMonthData(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
appBarTitle: "Water Tracker",
|
||||
baseViewModel:model ,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: AppBarChart(
|
||||
seriesList: model.userProgressForMonthDataSeries),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,184 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/widgets/h20_floating_action_button.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hexcolor/hexcolor.dart';
|
||||
import 'package:percent_indicator/circular_percent_indicator.dart';
|
||||
|
||||
class TodayPage extends StatefulWidget {
|
||||
@override
|
||||
_TodayPageState createState() => _TodayPageState();
|
||||
}
|
||||
|
||||
class _TodayPageState extends State<TodayPage> with TickerProviderStateMixin {
|
||||
AnimationController _controller;
|
||||
@override
|
||||
void initState() {
|
||||
_controller = new AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
|
||||
return BaseView<H2OViewModel>(
|
||||
onModelReady: (model) => model.getUserProgressForTodayData(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
appBarTitle: "Water Tracker",
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 60),
|
||||
child: Column(
|
||||
children: [
|
||||
Center(
|
||||
child: CircularPercentIndicator(
|
||||
radius: 180.0,
|
||||
animation: true,
|
||||
animationDuration: 1200,
|
||||
lineWidth: 15.0,
|
||||
percent:model.userProgressData ==null ?0.0:
|
||||
(model.userProgressData.percentageConsumed /
|
||||
100) >= 1 ? 1 : (model.userProgressData
|
||||
.percentageConsumed /
|
||||
100),
|
||||
//,
|
||||
center: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 40,
|
||||
),
|
||||
Text(
|
||||
"Consumed",
|
||||
style: TextStyle(fontSize: 20.0),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(model.userProgressData ==null ?"0.0":
|
||||
model.userProgressData.quantityConsumed
|
||||
.toString() + 'ml',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20.0,
|
||||
color: Hexcolor("#60BCF9")),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
width: 50,
|
||||
child: Container(
|
||||
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
"Remaining",
|
||||
style: TextStyle(fontSize: 20.0),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(model.userProgressData ==null ?"0.0":
|
||||
(model.userProgressData.quantityLimit -
|
||||
model.userProgressData
|
||||
.quantityConsumed) < 0 ? "0 ml" :
|
||||
(model.userProgressData.quantityLimit -
|
||||
model.userProgressData
|
||||
.quantityConsumed).toString() + ' ml',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18.0),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
circularStrokeCap: CircularStrokeCap.butt,
|
||||
backgroundColor: Hexcolor("#D1E3F6"),
|
||||
progressColor: Hexcolor("#60BCF9"),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20),
|
||||
height: 30,
|
||||
width: 70,
|
||||
decoration: BoxDecoration(
|
||||
color: Hexcolor("#D1E3F6"),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(30))),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Remaining % ",
|
||||
style: TextStyle(fontSize: 20.0),
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20),
|
||||
height: 30,
|
||||
width: 70,
|
||||
decoration: BoxDecoration(
|
||||
color: Hexcolor("#60BCF9"),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(30))),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Consumed % ",
|
||||
style: TextStyle(fontSize: 20.0),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
SizedBox(
|
||||
height: 0.5,
|
||||
width: MediaQuery
|
||||
.of(context)
|
||||
.size
|
||||
.width,
|
||||
child: Container(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
floatingActionButton: H20FloatingActionButton(
|
||||
controller: _controller,
|
||||
model: model,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/charts/app_bar_chart.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class WeekPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<H2OViewModel>(
|
||||
onModelReady: (model) => model.getUserProgressForWeekData(),
|
||||
builder: (_, model, widget) => AppScaffold(
|
||||
isShowAppBar: false,
|
||||
appBarTitle: "Water Tracker",
|
||||
baseViewModel: model,
|
||||
body: SingleChildScrollView(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: AppBarChart(seriesList: model.userProgressForWeekDataSeries),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,280 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/insert_user_activity_request_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/Dialog/confirm_add_amount_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../add_custom_amount.dart';
|
||||
|
||||
class H20FloatingActionButton extends StatelessWidget {
|
||||
const H20FloatingActionButton({
|
||||
Key key,
|
||||
@required AnimationController controller,
|
||||
@required this.model
|
||||
|
||||
}) : _controller = controller,
|
||||
super(key: key);
|
||||
|
||||
final AnimationController _controller;
|
||||
final H2OViewModel model;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// _showMaterialDialog(String count, H2OViewModel model) {
|
||||
// return SimpleDialog(
|
||||
// contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
|
||||
// title: Center(
|
||||
// child: Texts(
|
||||
// "Confirm",
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// children: [
|
||||
// Column(
|
||||
// children: [
|
||||
// Divider(),
|
||||
// Center(
|
||||
// child: Texts(
|
||||
// "Are you sure you want to Add $count ?",
|
||||
// color: Colors.grey,
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 5.0,
|
||||
// ),
|
||||
// Row(
|
||||
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: <Widget>[
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Container(
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).cancel.toUpperCase(),
|
||||
// color: Colors.red,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Container(
|
||||
// width: 1,
|
||||
// height: 30,
|
||||
// color: Colors.grey[500],
|
||||
// ),
|
||||
// Expanded(
|
||||
// flex: 1,
|
||||
// child: InkWell(
|
||||
// onTap: () async{
|
||||
// // insertUserActivity
|
||||
// int addedValue;
|
||||
//
|
||||
// switch(count) {
|
||||
// case "600ml": {
|
||||
// addedValue = 600;
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// case "330ml": {
|
||||
// addedValue = 330;
|
||||
//
|
||||
// }
|
||||
// break;
|
||||
// case "200ml": {
|
||||
// addedValue = 200;
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// InsertUserActivityRequestModel insertUserActivityRequestModel= InsertUserActivityRequestModel(quantityIntake:addedValue );
|
||||
// await model.insertUserActivity(insertUserActivityRequestModel);
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Center(
|
||||
// child: Texts(
|
||||
// TranslationBase.of(context).ok,
|
||||
// fontWeight: FontWeight.w400,
|
||||
// )),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// )
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
|
||||
void showConfirmMessage(int amount, H2OViewModel model) {
|
||||
showDialog(context: context, child: ConfirmAddAmountDialog(model: model,amount:amount,));
|
||||
}
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(left: 20),
|
||||
child: new Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
ActionButton(
|
||||
controller: _controller,
|
||||
text: "600ml",
|
||||
onTap: () {
|
||||
showConfirmMessage(600, model);
|
||||
},
|
||||
),
|
||||
ActionButton(
|
||||
controller: _controller,
|
||||
text: "330ml",
|
||||
onTap: () {
|
||||
showConfirmMessage(330, model);
|
||||
},
|
||||
),
|
||||
ActionButton(
|
||||
controller: _controller,
|
||||
text: "200ml",
|
||||
onTap: () {
|
||||
showConfirmMessage(200, model);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
FloatingActionButton(
|
||||
heroTag: null,
|
||||
child: new AnimatedBuilder(
|
||||
animation: _controller,
|
||||
builder: (BuildContext context, Widget child) {
|
||||
return new Transform(
|
||||
transform: new Matrix4.rotationZ(
|
||||
_controller.value * 0.5 * math.pi),
|
||||
alignment: FractionalOffset.center,
|
||||
child: new Icon(
|
||||
_controller.isDismissed ? Icons.add : Icons.close),
|
||||
);
|
||||
},
|
||||
),
|
||||
onPressed: () {
|
||||
if (_controller.isDismissed) {
|
||||
_controller.forward();
|
||||
} else {
|
||||
_controller.reverse();
|
||||
}
|
||||
},
|
||||
),
|
||||
new Container(
|
||||
alignment: FractionalOffset.topCenter,
|
||||
child: new ScaleTransition(
|
||||
scale: new CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0,
|
||||
curve: Curves.easeOut),
|
||||
),
|
||||
child: new FloatingActionButton(
|
||||
backgroundColor: Colors.white,
|
||||
heroTag: null,
|
||||
mini: true,
|
||||
child: Text(
|
||||
"Custom",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: AddCustomAmount(
|
||||
model: model,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
new Container(
|
||||
alignment: FractionalOffset.topCenter,
|
||||
child: new ScaleTransition(
|
||||
scale: new CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0,
|
||||
curve: Curves.easeOut),
|
||||
),
|
||||
child: new FloatingActionButton(
|
||||
backgroundColor: Colors.white,
|
||||
heroTag: null,
|
||||
mini: true,
|
||||
child: Text(
|
||||
"Undo",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ActionButton extends StatelessWidget {
|
||||
const ActionButton(
|
||||
{Key key,
|
||||
@required AnimationController controller,
|
||||
@required this.text,
|
||||
this.onTap})
|
||||
: _controller = controller,
|
||||
super(key: key);
|
||||
|
||||
final AnimationController _controller;
|
||||
final String text;
|
||||
final Function onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
alignment: FractionalOffset.topCenter,
|
||||
child: new ScaleTransition(
|
||||
scale: new CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: new Interval(0.0, 1.0 - 0 / 6 / 2.0, curve: Curves.easeOut),
|
||||
),
|
||||
child: new FloatingActionButton(
|
||||
heroTag: null,
|
||||
backgroundColor: Colors.white,
|
||||
mini: true,
|
||||
child: Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 14.0, color: Colors.grey),
|
||||
),
|
||||
onPressed: onTap
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
|
||||
class AppBarChart extends StatelessWidget {
|
||||
const AppBarChart({
|
||||
Key key,
|
||||
@required this.seriesList,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<charts.Series> seriesList;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 400,
|
||||
margin: EdgeInsets.only(top: 60),
|
||||
child: charts.BarChart(
|
||||
seriesList,
|
||||
// animate: animate,
|
||||
|
||||
/// Customize the primary measure axis using a small tick renderer.
|
||||
/// Use String instead of num for ordinal domain axis
|
||||
/// (typically bar charts).
|
||||
primaryMeasureAxis: new charts.NumericAxisSpec(
|
||||
renderSpec: new charts.GridlineRendererSpec(
|
||||
// Display the measure axis labels below the gridline.
|
||||
//
|
||||
// 'Before' & 'after' follow the axis value direction.
|
||||
// Vertical axes draw 'before' below & 'after' above the tick.
|
||||
// Horizontal axes draw 'before' left & 'after' right the tick.
|
||||
labelAnchor: charts.TickLabelAnchor.before,
|
||||
|
||||
// Left justify the text in the axis.
|
||||
//
|
||||
// Note: outside means that the secondary measure axis would right
|
||||
// justify.
|
||||
labelJustification:
|
||||
charts.TickLabelJustification.outside,
|
||||
)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
import 'package:carousel_pro/carousel_pro.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CarouselSlider extends StatelessWidget {
|
||||
const CarouselSlider({
|
||||
@required this.imagesUrlList,
|
||||
@required this.width,
|
||||
@required this.height,
|
||||
this.onImageChange,
|
||||
this.autoPlay = false,
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
final List imagesUrlList;
|
||||
final double height;
|
||||
final double width;
|
||||
final bool autoPlay;
|
||||
final Function onImageChange;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Carousel(
|
||||
boxFit: BoxFit.cover,
|
||||
autoplay: true,
|
||||
animationCurve: Curves.fastOutSlowIn,
|
||||
animationDuration: Duration(milliseconds: 1000),
|
||||
dotSize: 0.0,
|
||||
dotIncreasedColor: Colors.transparent,
|
||||
dotBgColor: Colors.transparent,
|
||||
dotPosition: DotPosition.bottomCenter,
|
||||
dotVerticalPadding: 10.0,
|
||||
onImageChange: onImageChange,
|
||||
showIndicator: true,
|
||||
indicatorBgPadding: 7.0,
|
||||
|
||||
images: imagesUrlList.map((image) {
|
||||
return Builder(builder: (BuildContext context) {
|
||||
return Container(
|
||||
child: Image.network(image, loadingBuilder: (BuildContext context,
|
||||
Widget child, ImageChunkEvent loadingProgress) {
|
||||
if (loadingProgress == null) return child;
|
||||
return Center(
|
||||
child: SizedBox(
|
||||
width: 40.0,
|
||||
height: 40.0,
|
||||
child: AppCircularProgressIndicator(
|
||||
// background: Theme
|
||||
// .of(context)
|
||||
// .primaryColor,
|
||||
// value: loadingProgress.expectedTotalBytes != null
|
||||
// ? loadingProgress.cumulativeBytesLoaded /
|
||||
// loadingProgress.expectedTotalBytes
|
||||
// : 0,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
width: width,
|
||||
height: height,
|
||||
fit: BoxFit.fill),
|
||||
);
|
||||
});
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue