Merge branch 'master' of https://34.17.52.180/Haroon6138/queuing_system into development

development
sultan khan 1 year ago
commit 2dfaf356ff

@ -0,0 +1 @@
/Users/zik/fvm/versions/3.7.5

@ -0,0 +1,4 @@
{
"flutterSdkVersion": "3.7.5",
"flavors": {}
}

@ -21,14 +21,17 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0'
} }
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
namespace = "com.example.queuing_system"
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
compileOptions { compileOptions {
compileSdkVersion 34
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
@ -44,10 +47,12 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.queuing_system" applicationId "com.example.queuing_system"
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() minSdkVersion 24
targetSdkVersion flutter.targetSdkVersion // minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion 31
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true
} }
buildTypes { buildTypes {
@ -65,4 +70,6 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
} }

@ -1,34 +1,55 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.queuing_system"> package="com.example.queuing_system">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" />
<queries> <queries>
<intent> <intent>
<action android:name="android.intent.action.TTS_SERVICE" /> <action android:name="android.intent.action.TTS_SERVICE" />
</intent> </intent>
</queries> </queries>
<application <application
android:label="queuing_system"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"> android:icon="@mipmap/ic_launcher"
android:label="queuing_system">
<receiver
android:name="BootReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true" android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop" android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:theme="@style/LaunchTheme"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data
android:name="io.flutter.embedding.android.NormalTheme" android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" android:resource="@style/NormalTheme" />
/>
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
@ -36,5 +57,5 @@
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
</application> </application>
</manifest> </manifest>

@ -0,0 +1,14 @@
package com.example.queuing_system
import android.content.BroadcastReceiver
import android.content.Context;
import android.content.Intent;
class BootReceiver: BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
val i = Intent(context, MainActivity::class.java)
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
}
}
}

@ -1,6 +1,24 @@
package com.example.queuing_system package com.example.queuing_system
import android.content.Intent
import android.net.Uri
import android.os.Build
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
import android.os.Bundle
import android.provider.Settings
import androidx.annotation.RequiresApi
class MainActivity: FlutterActivity() { class MainActivity: FlutterActivity() {
@RequiresApi(Build.VERSION_CODES.M)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// var REQUEST_OVERLAY_PERMISSIONS = 100
// if (!Settings.canDrawOverlays(applicationContext)) {
// val myIntent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION)
// val uri: Uri = Uri.fromParts("package", packageName, null)
// myIntent.data = uri
// startActivityForResult(myIntent, REQUEST_OVERLAY_PERMISSIONS)
// return
// }
}
} }

@ -1,31 +1,40 @@
buildscript { buildscript {
ext.kotlin_version = '1.6.0' ext.kotlin_version = '1.9.10'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:8.7.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
allprojects { allprojects {
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
} }
rootProject.buildDir = '../build' rootProject.buildDir = '../build'
subprojects { subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}" project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
task clean(type: Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017 #Tue Nov 12 09:01:21 AST 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

@ -1,11 +1,26 @@
include ':app' pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties") includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
def properties = new Properties()
assert localPropertiesFile.exists() repositories {
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } google()
mavenCentral()
gradlePluginPortal()
}
}
def flutterSdkPath = properties.getProperty("flutter.sdk") plugins {
assert flutterSdkPath != null, "flutter.sdk not set in local.properties" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" id "com.android.application" version '8.7.0' apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}
include ":app"

@ -0,0 +1,33 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<g clip-rule="evenodd" fill-rule="evenodd">
<path
d="m10.5714 5.7738c-2.78119 0-5.03576 2.25457-5.03576 5.0357 0 .8311.20189 1.6171.55995 2.3098.12879.2491.3858.4056.66624.4056h8.09527c.4142 0 .75-.3358.75-.75v-1.4892-.4762c0-2.78113-2.2546-5.0357-5.0357-5.0357z"
fill="#E5B045" />
<path
d="m10.5 5.77429v7.22571h-4.46407c-.32074-.6631-.50029-1.4068-.50029-2.1905 0-2.75731 2.21611-4.99704 4.96436-5.03521z"
fill="#e5b045" />
<path
d="m11.5831 9.58331c-3.37338 0-6.18137 2.53149-6.39207 5.78539-1.68658.3293-2.98888 1.7661-2.98888 3.536 0 2.0208 1.69742 3.6072 3.72619 3.6072h1.78571 10.11905c.5478 0 1.0705-.1149 1.5418-.3225 1.9561-.7122 3.3749-2.5408 3.3749-4.7132 0-2.8097-2.3637-5.0357-5.2143-5.0357-.18 0-.358.0088-.5336.0261-1.1384-1.7391-3.1458-2.88329-5.4188-2.88329z"
fill="#cfd8dc" />
<path
d="m12 9.59621v12.91569h-4.28595-1.78571c-2.02877 0-3.72619-1.5864-3.72619-3.6072 0-1.7699 1.3023-3.2067 2.98888-3.536.2107-3.2539 3.01869-5.78539 6.39207-5.78539.14 0 .279.00435.4169.0129z"
fill="#cfd8dc" />
<path
d="m10.5714 1.4881c.4142 0 .75.33578.75.75v1.90476c0 .41421-.3358.75-.75.75s-.74997-.33579-.74997-.75v-1.90476c0-.41422.33577-.75.74997-.75z"
fill="#ff884d" />
<g fill="#e57a45">
<path
d="m10.5 1.49146v3.39805c-.3807-.03596-.67859-.35652-.67859-.74665v-1.90476c0-.39013.29789-.71068.67859-.74664z" />
<path
d="m1.25 10.3333c0-.41417.33579-.74996.75-.74996h1.90476c.41422 0 .75.33579.75.74996 0 .4143-.33578.75-.75.75h-1.90476c-.41421 0-.75-.3357-.75-.75z" />
<path
d="m3.85063 4.08872c.29289-.29289.76776-.29289 1.06066 0l1.34687 1.34687c.29289.29289.29289.76777 0 1.06066-.2929.29289-.76777.29289-1.06066 0l-1.34687-1.34687c-.2929-.29289-.2929-.76777 0-1.06066z" />
</g>
<path
d="m17.2104 4.08872c-.2929-.29289-.7678-.29289-1.0607 0l-1.3468 1.34687c-.2929.29289-.2929.76777 0 1.06066s.7677.29289 1.0606 0l1.3469-1.34687c.2929-.29289.2929-.76777 0-1.06066z"
fill="#ff884d" />
<path
d="m16.4881 10.3333c0-.41417.3358-.74996.75-.74996h1.9048c.4142 0 .75.33579.75.74996 0 .4143-.3358.75-.75.75h-1.9048c-.4142 0-.75-.3357-.75-.75z"
fill="#ff884d" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><g fill="#45B0E5"><path d="m12.0003 1.25c.4142 0 .75.33579.75.75v20c0 .4142-.3358.75-.75.75s-.75-.3358-.75-.75v-20c0-.41421.3358-.75.75-.75z"/><path d="m8.69303 1.87619c.33138-.24852.80148-.18137 1.05.15l2.25717 3.00953 2.2571-3.00953c.2485-.33137.7186-.39852 1.05-.15.3314.24853.3985.71863.15 1.05l-2.8467 3.79562c-.0237.03322-.0504.06479-.08.09431-.0627.06281-.1346.11257-.2119.14874-.1014.04773-.2103.07099-.3185.0709-.1082.00009-.2171-.02317-.3186-.0709-.0773-.03616-.1492-.08593-.2118-.14874-.0296-.02952-.0563-.06109-.08-.0943l-2.84677-3.79563c-.24852-.33137-.18137-.80147.15-1.05z"/><path d="m8.69303 22.1238c.33138.2485.80148.1814 1.05-.15l2.25717-3.0095 2.2571 3.0095c.2485.3314.7186.3985 1.05.15s.3985-.7186.15-1.05l-2.8467-3.7956c-.0237-.0332-.0504-.0648-.08-.0943-.0627-.0628-.1346-.1126-.2119-.1488-.1014-.0477-.2103-.0709-.3185-.0709s-.2171.0232-.3186.0709c-.0773.0362-.1492.086-.2118.1488-.0296.0295-.0563.0611-.08.0943l-2.84677 3.7956c-.24852.3314-.18137.8015.15 1.05z"/><path d="m2.69035 6.625c.2071-.35872.6658-.48162 1.02451-.27452l17.32054 10.00002c.3587.2071.4816.6658.2745 1.0245s-.6658.4816-1.0245.2745l-17.32054-9.99998c-.35871-.20711-.48162-.6658-.27451-1.02452z"/><path d="m1.57915 9.80218c-.04955-.41124.24366-.78478.6549-.83433l3.7349-.44998-1.47775-3.45951c-.16271-.38091.01418-.82161.39509-.98432.38092-.16272.82162.01418.98433.39509l1.86374 4.36314c.0169.03717.03089.07607.04166.11646.02307.08567.03022.17281.0229.25782-.0094.11175-.0437.21766-.09788.31134-.05404.09376-.12861.17642-.22069.24044-.06996.04884-.149.08622-.23473.10907-.04036.01087-.08104.01821-.12168.02216l-4.71046.56754c-.41124.0495-.78478-.2437-.83433-.65492z"/><path d="m19.1137 19.926c.3809-.1627.5578-.6034.3951-.9843l-1.4777-3.4596 3.7348-.4499c.4113-.0496.7045-.4231.655-.8344-.0496-.4112-.4231-.7044-.8344-.6549l-4.7104.5676c-.0407.0039-.0814.0112-.1217.0221-.0857.0229-.1648.0602-.2347.1091-.0921.064-.1667.1467-.2207.2404-.0542.0937-.0885.1996-.0979.3114-.0073.085-.0002.1721.0229.2578.0108.0404.0247.0793.0416.1164l1.8638 4.3632c.1627.3809.6034.5578.9843.3951z"/><path d="m2.69035 17.375c.2071.3587.6658.4816 1.02451.2745l17.32054-10.00001c.3587-.20711.4816-.6658.2745-1.02452s-.6658-.48163-1.0245-.27452l-17.32054 9.99995c-.35871.2072-.48162.6658-.27451 1.0246z"/><path d="m1.57915 14.1978c-.04955.4113.24366.7848.6549.8344l3.7349.4499-1.47775 3.4595c-.16271.381.01418.8217.39509.9844.38092.1627.82162-.0142.98433-.3951l1.86374-4.3632c.0169-.0371.03089-.076.04166-.1164.02307-.0857.03022-.1728.0229-.2578-.0094-.1118-.0437-.2177-.09788-.3114-.05404-.0938-.12861-.1764-.22069-.2404-.06996-.0489-.149-.0862-.23473-.1091-.04036-.0109-.08104-.0182-.12168-.0222l-4.71046-.5675c-.41124-.0495-.78478.2437-.83433.6549z"/><path d="m19.1137 4.07402c.3809.16271.5578.60341.3951.98433l-1.4777 3.4595 3.7348.44998c.4113.04955.7045.42309.655.83433-.0496.41124-.4231.70444-.8344.65494l-4.7104-.56756c-.0407-.00395-.0814-.01128-.1217-.02215-.0857-.02286-.1648-.06024-.2347-.10908-.0921-.06402-.1667-.14667-.2207-.24044-.0542-.09368-.0885-.19959-.0979-.31134-.0073-.08501-.0002-.17215.0229-.25782.0108-.04038.0247-.07928.0416-.11645l1.8638-4.36314c.1627-.38092.6034-.55781.9843-.3951z"/></g><path d="m12 1.25v21.5c-.4141-.0002-.7497-.3359-.7497-.75v-2.0358l-1.50726 2.0096c-.24853.3314-.71863.3985-1.05.15s-.39853-.7186-.15-1.05l2.70726-3.6096v-4.1653l-3.60728 2.0827-1.7724 4.1493c-.16271.3809-.60341.5578-.98433.3951-.38091-.1627-.5578-.6034-.39509-.9844l.98676-2.31-1.76308 1.0179c-.35872.2071-.81741.0842-1.02452-.2745-.20711-.3588-.0842-.8174.27452-1.0245l1.76296-1.0179-2.49378-.3004c-.41124-.0496-.70445-.4231-.65491-.8344.04955-.4112.42309-.7044.83433-.6549l4.47943.5397 3.60719-2.0826-3.60715-2.08261-4.47947.53971c-.41124.0495-.78478-.2437-.83433-.65493-.04954-.41124.24367-.78478.65491-.83432l2.49383-.30046-1.76301-1.01787c-.35872-.20711-.48163-.6658-.27452-1.02452s.6658-.48163 1.02452-.27452l1.76306 1.0179-.98674-2.31002c-.16271-.38092.01418-.82161.39509-.98432.38092-.16272.82162.01417.98433.39509l1.77238 4.14925 3.6073 2.08262v-4.16515l-2.70726-3.60965c-.24853-.33137-.18137-.80148.15-1.05.33137-.24853.80147-.18137 1.05.15l1.50726 2.00965v-2.03585c0-.41411.3356-.74984.7497-.75z" fill="#45b0e5"/></g></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m7.39024 1.73781c-2.03065 0-3.67683 1.64617-3.67683 3.67683v8.60306c-.90458.9259-1.46341 2.1941-1.46341 3.5921 0 2.8388 2.30137 5.1402 5.14024 5.1402 2.83886 0 5.14026-2.3014 5.14026-5.1402 0-1.398-.5588-2.6662-1.4634-3.5921v-8.60306c0-2.03066-1.6462-3.67683-3.67686-3.67683z" fill="#cfd8dc"/><path d="m7.5 1.73942v21.00948c-.03649.0007-.07308.0011-.10976.0011-2.83887 0-5.14024-2.3014-5.14024-5.1402 0-1.398.55883-2.6662 1.46341-3.5921v-8.60306c0-2.03066 1.64618-3.67683 3.67683-3.67683.03672 0 .07331.00054.10976.00161z" fill="#cfd8dc"/><path d="m7.39018 14.9085c-1.49184 0-2.70122 1.2094-2.70122 2.7013 0 1.4918 1.20938 2.7012 2.70122 2.7012 1.49185 0 2.70122-1.2094 2.70122-2.7012 0-1.4919-1.20937-2.7013-2.70122-2.7013z" fill="#ee4d4d"/><path d="m7.5 14.9107v5.3981c-.03642.0014-.07303.0022-.10982.0022-1.49184 0-2.70122-1.2094-2.70122-2.7012 0-1.4919 1.20938-2.7013 2.70122-2.7013.03679 0 .0734.0008.10982.0022z" fill="#d64545"/><path d="m15.1954 5.64024c-1.4919 0-2.7013 1.20938-2.7013 2.70122 0 1.49185 1.2094 2.70124 2.7013 2.70124 1.4918 0 2.7012-1.20939 2.7012-2.70124 0-1.49184-1.2094-2.70122-2.7012-2.70122z" fill="#E5B045"/><path d="m17.892 8.5h-5.3933c.0821 1.41805 1.258 2.5427 2.6967 2.5427 1.4386 0 2.6145-1.12465 2.6966-2.5427z" fill="#e5b045"/><path d="m15.1951 1.25c.4142 0 .75.33579.75.75v1.95122c0 .41421-.3358.75-.75.75s-.75-.33579-.75-.75v-1.95122c0-.41421.3358-.75.75-.75z" fill="#ff884d"/><path d="m15.1951 11.9817c.4142 0 .75.3358.75.75v1.9512c0 .4142-.3358.75-.75.75s-.75-.3358-.75-.75v-1.9512c0-.4142.3358-.75.75-.75z" fill="#e57a45"/><path d="m17.7693 10.9155c.2929-.2929.7678-.2929 1.0607 0l1.3797 1.3797c.2929.2929.2929.7678 0 1.0607s-.7678.2929-1.0607 0l-1.3797-1.3797c-.2929-.2929-.2929-.7678 0-1.0607z" fill="#e57a45"/><path d="m20.2095 3.32705c-.2929-.2929-.7677-.2929-1.0606 0l-1.3797 1.37972c-.2929.29289-.2929.76776 0 1.06066.2929.29289.7677.29289 1.0606 0l1.3797-1.37972c.2929-.2929.2929-.76777 0-1.06066z" fill="#ff884d"/><path d="m18.8354 8.34146c0-.41421.3357-.75.75-.75h1.9512c.4142 0 .75.33579.75.75s-.3358.75-.75.75h-1.9512c-.4143 0-.75-.33579-.75-.75z" fill="#ff884d"/><path d="m22.2698 8.5c-.0727.33807-.3734.59146-.7332.59146h-1.9512c-.3598 0-.6605-.25339-.7332-.59146z" fill="#e57a45"/></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1 @@
<svg height="512" viewBox="0 0 64 64" width="512" xmlns="http://www.w3.org/2000/svg"><g id="Ka_bah" data-name="Ka'bah"><path d="m57 12v39l-25 8-25-8v-39l25-7z" fill="#1a1a1a"/><path d="m7 12 25-7 25 7-25 8z" fill="#4d4d4d"/><path d="m32 20-18.33-5.87 18.33-5.13 18.33 5.13z" fill="#333"/><path d="m57 12v39l-12 3.84-9 2.88-4 1.28v-39z"/><path d="m45 38v16.84l-7.83 2.51-1.17.37v-16.72z" fill="#f8be31"/><path d="m36 29.62-4 1.28-4-1.28v4l4 1.28 4-1.28z" fill="#fbd63b"/><path d="m36 29.62-4 1.28v4l4-1.28z" fill="#f8be31"/><path d="m42 27.75-2 2.25 2 2 2-2z" fill="#f8be31"/><path d="m22 27.75-2 2.25 2 2 2-2z" fill="#fbd63b"/><path d="m54 23.86v4l-6 1.92v-4z" fill="#f8be31"/><path d="m10 23.86v4l6 1.92v-4z" fill="#fbd63b"/><path d="m57 14.9v4l-25 8-25-8v-4l25 8z" fill="#fbd63b"/><path d="m57 19-25 8v-4.1l25-7.9z" fill="#f8be31"/><path d="m45 38v16.84l-7.83 2.51a15.3966 15.3966 0 0 0 4.83-4.67 15.5638 15.5638 0 0 0 2.56-7.61z" fill="#f7a62b"/></g></svg>

After

Width:  |  Height:  |  Size: 959 B

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m11.1071 1.25c-3.37334 0-6.18133 2.53144-6.39203 5.78536-1.68658.32932-2.98888 1.76608-2.98888 3.53604 0 2.0208 1.69742 3.6072 3.72619 3.6072h1.78571 10.11901c.5479 0 1.0705-.1149 1.5419-.3225 1.956-.7122 3.3748-2.5408 3.3748-4.71324 0-2.80971-2.3637-5.03572-5.2143-5.03572-.1799 0-.358.00883-.5336.0261-1.1383-1.73901-3.1458-2.88324-5.4188-2.88324z" fill="#cfd8dc"/><path d="m12 1.30962v12.86898h-4.76191-1.78571c-2.02877 0-3.72619-1.5864-3.72619-3.6072 0-1.76996 1.3023-3.20672 2.98888-3.53604.2107-3.25392 3.01869-5.78536 6.39203-5.78536.3028 0 .6009.02031.8929.05962z" fill="#cfd8dc"/><path d="m7.57334 15.1387c.37049.1853.52065.6358.33541 1.0063l-1.42857 2.8571c-.18524.3705-.63575.5207-1.00623.3354-.37048-.1852-.52065-.6357-.33541-1.0062l1.42857-2.8572c.18524-.3704.63575-.5206 1.00623-.3354z" fill="#45b0e5"/><path d="m12.3356 15.1387c.3705.1853.5207.6358.3354 1.0063l-1.4285 2.8571c-.1853.3705-.6358.5207-1.0063.3354-.37044-.1852-.52061-.6357-.33537-1.0062l1.42857-2.8572c.1852-.3704.6357-.5206 1.0062-.3354z" fill="#4dc4ff"/><path d="m17.0975 15.1387c.3704.1853.5206.6358.3354 1.0063l-1.4286 2.8571c-.1853.3705-.6358.5207-1.0062.3354-.3705-.1852-.5207-.6357-.3355-1.0062l1.4286-2.8572c.1853-.3704.6358-.5206 1.0063-.3354z" fill="#4dc4ff"/><path d="m8.52609 18.472c.37048.1853.52065.6358.33541 1.0062l-1.42858 2.8572c-.18524.3705-.63574.5206-1.00623.3354-.37048-.1852-.52065-.6357-.33541-1.0062l1.42858-2.8572c.18524-.3705.63574-.5206 1.00623-.3354z" fill="#45b0e5"/><path d="m13.2879 18.472c.3705.1853.5207.6358.3354 1.0062l-1.4286 2.8572c-.1852.3705-.6357.5206-1.0062.3354s-.5206-.6357-.3354-1.0062l1.4286-2.8572c.1852-.3705.6357-.5206 1.0062-.3354z" fill="#4dc4ff"/><path d="m12 19.3708v3.209c-.2218.1819-.5384.2276-.8115.091-.3705-.1852-.5206-.6357-.3354-1.0062zm0-4.3114v2.4277l-.7575 1.515c-.1853.3705-.6358.5207-1.0063.3354-.37044-.1852-.52061-.6357-.33537-1.0062l1.42857-2.8572c.1313-.2625.3958-.4144.6706-.4147z" fill="#45b0e5"/><path d="m18.0497 18.472c.3705.1853.5207.6358.3354 1.0062l-1.4285 2.8572c-.1853.3705-.6358.5206-1.0063.3354s-.5206-.6357-.3354-1.0062l1.4286-2.8572c.1852-.3705.6357-.5206 1.0062-.3354z" fill="#4dc4ff"/></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m12 1.25c.4142 0 .75.33579.75.75v4.54545c0 .41422-.3358.75-.75.75s-.75-.33578-.75-.75v-4.54545c0-.41421.3358-.75.75-.75z" fill="#ff884d"/><path d="m12 16.7046c.4142 0 .75.3357.75.75v4.5454c0 .4142-.3358.75-.75.75s-.75-.3358-.75-.75v-4.5454c0-.4143.3358-.75.75-.75z" fill="#ff884d"/><g fill="#e57a45"><path d="m12 1.25c-.4142 0-.75.33579-.75.75v4.27273c0 .41421.3358.75.75.75z"/><path d="m12 16.9773c-.4142 0-.75.3358-.75.75v4.2727c0 .4142.3358.75.75.75z"/><path d="m4.39843 4.39859c.2929-.29289.76777-.29289 1.06066 0l3.21413 3.21413c.29289.29289.29289.76776 0 1.06066-.2929.29289-.76777.29289-1.06066 0l-3.21413-3.21413c-.29289-.29289-.29289-.76776 0-1.06066z"/></g><path d="m15.3266 15.3266c.2929-.2929.7678-.2929 1.0607 0l3.2141 3.2141c.2929.2929.2929.7678 0 1.0607-.2929.2928-.7678.2928-1.0607 0l-3.2141-3.2142c-.2929-.2929-.2929-.7677 0-1.0606z" fill="#ff884d"/><path d="m19.6011 4.39859c-.2929-.29289-.7678-.29289-1.0607 0l-3.2141 3.21413c-.2929.29289-.2929.76776 0 1.06066.2929.29289.7678.29289 1.0607 0l3.2141-3.21413c.2929-.29289.2929-.76776 0-1.06066z" fill="#ff884d"/><path d="m8.67337 15.3266c-.29289-.2929-.76776-.2929-1.06066 0l-3.21412 3.2141c-.29289.2929-.29289.7678 0 1.0607.2929.2928.76777.2928 1.06066 0l3.21412-3.2142c.2929-.2929.2929-.7677 0-1.0606z" fill="#e57a45"/><path d="m1.25 12c0-.4142.33579-.75.75-.75h4.54545c.41422 0 .75.3358.75.75s-.33578.75-.75.75h-4.54545c-.41421 0-.75-.3358-.75-.75z" fill="#e57a45"/><path d="m16.7043 12c0-.4142.3358-.75.75-.75h4.5455c.4142 0 .75.3358.75.75s-.3358.75-.75.75h-4.5455c-.4142 0-.75-.3358-.75-.75z" fill="#ff884d"/><path d="m12.0004 5.79544c-3.42663 0-6.2045 2.77787-6.2045 6.20456 0 3.4267 2.77787 6.2045 6.2045 6.2045 3.4267 0 6.2046-2.7778 6.2046-6.2045 0-3.42669-2.7779-6.20456-6.2046-6.20456z" fill="#E5B045"/><path d="m12 5.79547v12.40913c-3.42672 0-6.20459-2.7779-6.20459-6.2046 0-3.42666 2.77787-6.20453 6.20459-6.20453z" fill="#e5b045"/></g></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m10.5714 5.7738c-2.78119 0-5.03576 2.25457-5.03576 5.0357 0 .8311.20189 1.6171.55995 2.3098.12879.2491.3858.4056.66624.4056h8.09527c.4142 0 .75-.3358.75-.75v-1.4892-.4762c0-2.78113-2.2546-5.0357-5.0357-5.0357z" fill="#E5B045"/><path d="m10.5 5.77429v7.22571h-4.46407c-.32074-.6631-.50029-1.4068-.50029-2.1905 0-2.75731 2.21611-4.99704 4.96436-5.03521z" fill="#e5b045"/><path d="m11.5831 9.58331c-3.37338 0-6.18137 2.53149-6.39207 5.78539-1.68658.3293-2.98888 1.7661-2.98888 3.536 0 2.0208 1.69742 3.6072 3.72619 3.6072h1.78571 10.11905c.5478 0 1.0705-.1149 1.5418-.3225 1.9561-.7122 3.3749-2.5408 3.3749-4.7132 0-2.8097-2.3637-5.0357-5.2143-5.0357-.18 0-.358.0088-.5336.0261-1.1384-1.7391-3.1458-2.88329-5.4188-2.88329z" fill="#cfd8dc"/><path d="m12 9.59621v12.91569h-4.28595-1.78571c-2.02877 0-3.72619-1.5864-3.72619-3.6072 0-1.7699 1.3023-3.2067 2.98888-3.536.2107-3.2539 3.01869-5.78539 6.39207-5.78539.14 0 .279.00435.4169.0129z" fill="#cfd8dc"/><path d="m10.5714 1.4881c.4142 0 .75.33578.75.75v1.90476c0 .41421-.3358.75-.75.75s-.74997-.33579-.74997-.75v-1.90476c0-.41422.33577-.75.74997-.75z" fill="#ff884d"/><g fill="#e57a45"><path d="m10.5 1.49146v3.39805c-.3807-.03596-.67859-.35652-.67859-.74665v-1.90476c0-.39013.29789-.71068.67859-.74664z"/><path d="m1.25 10.3333c0-.41417.33579-.74996.75-.74996h1.90476c.41422 0 .75.33579.75.74996 0 .4143-.33578.75-.75.75h-1.90476c-.41421 0-.75-.3357-.75-.75z"/><path d="m3.85063 4.08872c.29289-.29289.76776-.29289 1.06066 0l1.34687 1.34687c.29289.29289.29289.76777 0 1.06066-.2929.29289-.76777.29289-1.06066 0l-1.34687-1.34687c-.2929-.29289-.2929-.76777 0-1.06066z"/></g><path d="m17.2104 4.08872c-.2929-.29289-.7678-.29289-1.0607 0l-1.3468 1.34687c-.2929.29289-.2929.76777 0 1.06066s.7677.29289 1.0606 0l1.3469-1.34687c.2929-.29289.2929-.76777 0-1.06066z" fill="#ff884d"/><path d="m16.4881 10.3333c0-.41417.3358-.74996.75-.74996h1.9048c.4142 0 .75.33579.75.74996 0 .4143-.3358.75-.75.75h-1.9048c-.4142 0-.75-.3357-.75-.75z" fill="#ff884d"/></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1 @@
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m14.1957 16.8961c-.394 0-.7135.3194-.7135.7134 0 .3941.3195.7135.7135.7135h7.3174c.4143 0 .75.3358.75.75s-.3357.75-.75.75h-7.3174c-1.2225 0-2.2135-.991-2.2135-2.2135 0-1.2224.991-2.2134 2.2135-2.2134h.4878c.4143 0 .75.3357.75.75 0 .4142-.3357.75-.75.75z" fill="#8b98a6"/><path d="m17.6105 21.25c-.394 0-.7135-.3194-.7135-.7135 0-.394.3195-.7135.7135-.7135h4.3905c.4142 0 .75-.3358.75-.75s-.3358-.75-.75-.75h-4.3905c-1.2225 0-2.2135.991-2.2135 2.2135s.991 2.2135 2.2135 2.2135h.4878c.4143 0 .75-.3358.75-.75s-.3357-.75-.75-.75z" fill="#8b98a6"/><path d="m12 17.8913v-.5635c.1384-1.0894 1.0687-1.9317 2.1957-1.9317h.4879c.4142 0 .75.3357.75.75 0 .4142-.3358.75-.75.75h-.4879c-.394 0-.7135.3194-.7135.7134 0 .3941.3195.7135.7135.7135h3.4119.0029 1.3895v1.5h-1.3911c-.3933.0009-.7119.32-.7119.7135 0 .3941.3195.7135.7135.7135h.4878c.4143 0 .75.3358.75.75s-.3357.75-.75.75h-.4878c-1.2225 0-2.2135-.991-2.2135-2.2135 0-.2496.0414-.4896.1175-.7135h-1.3188c-1.127 0-2.0573-.8423-2.1957-1.9317z" fill="#7d8995"/><path d="m3.70066 15.9224c.39295.131.60532.5557.47434.9487l-.97566 2.9269c-.13098.393-.55572.6054-.94868.4744s-.60533-.5558-.47434-.9487l.97565-2.927c.13099-.3929.55573-.6053.94869-.4743z" fill="#45b0e5"/><path d="m7.11546 15.9224c.39296.131.60533.5557.47434.9487l-.97566 2.9269c-.13098.393-.55572.6054-.94868.4744s-.60533-.5558-.47434-.9487l.97566-2.927c.13098-.3929.55572-.6053.94868-.4743z" fill="#4dc4ff"/><path d="m6.5 15.9863v4.0284c-.1889.2487-.52178.3619-.83452.2577-.39296-.131-.60533-.5558-.47434-.9487l.97565-2.927c.05995-.1798.18142-.3218.33321-.4104z" fill="#45b0e5"/><path d="m10.5303 15.9224c.3929.131.6053.5557.4743.9487l-.9757 2.9269c-.13094.393-.55568.6054-.94864.4744s-.60533-.5558-.47434-.9487l.97565-2.927c.13099-.3929.55573-.6053.94873-.4743z" fill="#4dc4ff"/><path d="m16.6342 1.24902c-3.647.00029-6.6034 2.95687-6.6034 6.60395 0 .18488.0076.36815.0225.54949.0094.11306.0442.22252.102.32016l2.5968 4.39048c.0575.0972.1363.1802.2303.2427 1.0464.6957 2.3032 1.1011 3.6523 1.1011 2.7484 0 5.103-1.6787 6.0976-4.0639.1243-.2981.0438-.64238-.1999-.85442-.2437-.21205-.5958-.24423-.8739-.07988-.614.36283-1.3299.5712-2.0968.5712-.1399 0-.2779-.0069-.4137-.0204-2.0854-.20702-3.7146-1.96764-3.7146-4.10785 0-1.34996.6472-2.54855 1.6513-3.30301.258-.19384.3631-.53101.2609-.83712s-.3887-.51252-.7114-.5125z" fill="#E5B045"/><path d="m16.3634 8.5h-6.2928c.0173.07382.0458.14481.0846.21044l2.5969 4.39046c.0575.0972.1362.1802.2303.2427 1.0464.6958 2.3031 1.1011 3.6523 1.1011 2.7484 0 5.103-1.6787 6.0975-4.0638.1244-.2982.0438-.64245-.1999-.8545-.2437-.21204-.5958-.24422-.8739-.07987-.6139.36282-1.3298.57127-2.0967.57127-.1399 0-.2779-.007-.4138-.02045-1.1205-.11126-2.1094-.67109-2.7845-1.49735z" fill="#e5b045"/><path d="m7.30514 6.1273c-2.11887 0-3.94284 1.49742-4.19586 3.51307-1.04955.29212-1.85928 1.20703-1.85928 2.35913 0 1.4051 1.2044 2.4574 2.57936 2.4574h1.09761 6.21983c.371 0 .7265-.075 1.0487-.2116 1.2952-.4623 2.2624-1.6542 2.2624-3.0995 0-1.87656-1.6139-3.3111-3.494-3.3111-.0636 0-.1268.00162-.1897.00481-.77-1.0448-2.04614-1.71221-3.46906-1.71221z" fill="#cfd8dc"/><path d="m8 6.16899v8.27571h-3.07303-1.09761c-1.37496 0-2.57936-1.0523-2.57936-2.4574 0-1.152.80973-2.06697 1.85928-2.35909.25302-2.01565 2.07699-3.51307 4.19586-3.51307.23621 0 .46838.0184.69486.05385z" fill="#cfd8dc"/></g></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="28.704" height="36.818" viewBox="0 0 28.704 36.818">
<g id="doctor_10_" data-name="doctor (10)" transform="translate(-5.291)">
<path id="Path_5102" data-name="Path 5102" d="M21.572,0a8,8,0,1,0,7.994,8A8,8,0,0,0,21.572,0Z" transform="translate(-1.931)" fill="#52964f"/>
<path id="Path_5103" data-name="Path 5103" d="M25.819,23.474a17.6,17.6,0,0,1,.584,4.767c1.176,1.042,4.261,4.115,3.59,7.147a3.551,3.551,0,0,1-2.485,2.52.767.767,0,0,1-.5-1.452,2.072,2.072,0,0,0,1.477-1.362c.459-2.079-1.842-4.6-3.122-5.726-1.531.743-4.426,2.567-4.538,4.654a2.057,2.057,0,0,0,1.055,1.742.767.767,0,1,1-.863,1.269A3.545,3.545,0,0,1,19.3,33.9c.174-3.241,4.41-5.449,5.592-6a20.9,20.9,0,0,0-.759-4.869.855.855,0,0,1-.008-.125,13.292,13.292,0,0,0-3.5-.48H18.657a13.318,13.318,0,0,0-3.9.585.7.7,0,0,1-.043.164,33.366,33.366,0,0,0-2.471,8.754,3.142,3.142,0,1,1-1.546-.035,37.409,37.409,0,0,1,2.081-8.085A13.373,13.373,0,0,0,5.291,35.793v5.482a.766.766,0,0,0,.767.767h27.17A.776.776,0,0,0,34,41.264V35.793a13.392,13.392,0,0,0-8.177-12.319Z" transform="translate(0 -5.223)" fill="#52964f"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="36.818" height="36.818" viewBox="0 0 36.818 36.818">
<g id="_x30_6" transform="translate(-2 -2)">
<path id="Path_5097" data-name="Path 5097" d="M7.26,16.753a3.945,3.945,0,1,1,5.26,0v3.389c4.5-.973,5.26-4.465,5.26-6.683C17.779,8.9,14.633,2,9.89,2S2,8.9,2,13.459c0,2.218.761,5.71,5.26,6.683Z" transform="translate(0 0)" fill="#3c86d0"/>
<path id="Path_5098" data-name="Path 5098" d="M19.149,31.354a2.63,2.63,0,1,0-2.264-3.945H12.575a2.632,2.632,0,0,1-2.63-2.63V23.464a1.315,1.315,0,0,0,1.315-1.315V19.52A1.315,1.315,0,0,0,9.945,18.2V14.26a1.267,1.267,0,0,0-.067-.33,2.63,2.63,0,1,0-2.5,0,1.267,1.267,0,0,0-.067.33V18.2A1.315,1.315,0,0,0,6,19.52v2.63a1.315,1.315,0,0,0,1.315,1.315v1.315a5.266,5.266,0,0,0,5.26,5.26h4.311A2.621,2.621,0,0,0,19.149,31.354Z" transform="translate(1.26 2.205)" fill="#3c86d0"/>
<path id="Path_5099" data-name="Path 5099" d="M31.409,18H16.945A3.949,3.949,0,0,0,13,21.945V23.26h1.026a3.945,3.945,0,1,1,0,5.26H13v1.315a3.949,3.949,0,0,0,3.945,3.945H31.409a3.949,3.949,0,0,0,3.945-3.945v-7.89A3.949,3.949,0,0,0,31.409,18Zm-5.26,10.52a2.63,2.63,0,1,1,2.63-2.63A2.632,2.632,0,0,1,26.149,28.52Zm5.26-.657a.657.657,0,0,1-1.315,0V23.917a.657.657,0,0,1,1.315,0Zm2.63,0a.657.657,0,0,1-1.315,0V23.917a.657.657,0,1,1,1.315,0Z" transform="translate(3.464 5.039)" fill="#3c86d0"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="34.908" height="36.818" viewBox="0 0 34.908 36.818">
<path id="blood-test" d="M33.07,14.711H24.688v3.537H26.1a.522.522,0,0,1,0,1.043H24.688v2.618H27.95a.522.522,0,0,1,0,1.043H24.688V25.57H26.1a.522.522,0,0,1,0,1.043H24.688V30.6h4.62a10.235,10.235,0,0,0,4.806,5.97v4.011a5.235,5.235,0,0,1-10.47,0V14.7a2.079,2.079,0,0,1-1.829-2.06V11.075A2.078,2.078,0,0,1,23.89,9h9.978a2.078,2.078,0,0,1,2.075,2.075v1.562a2.079,2.079,0,0,1-1.829,2.06v4.042a10.224,10.224,0,0,0-1.043.669v-4.7ZM46.976,36.933l1.384-1.384a1.179,1.179,0,0,1,1.662,0l6.359,6.359a1.179,1.179,0,0,1,0,1.662L55,44.954a1.179,1.179,0,0,1-1.662,0l-6.359-6.359a1.179,1.179,0,0,1,0-1.662ZM39.082,21.193a6.463,6.463,0,1,0,6.463,6.463,6.463,6.463,0,0,0-6.463-6.463Zm1.5,9.109a2.125,2.125,0,0,1-3,0c-.824-.824-.609-2.474,0-3.468l1.5-2.442,1.5,2.442c.609.993.824,2.644,0,3.468Zm7.666-2.646a9.163,9.163,0,1,0-3.653,7.322l1.446,1.446a2.223,2.223,0,0,1,.2-.228l1.384-1.384a2.213,2.213,0,0,1,.228-.2L46.4,33.167a9.123,9.123,0,0,0,1.842-5.511Zm-9.164,7.506a7.506,7.506,0,1,1,7.506-7.506,7.506,7.506,0,0,1-7.506,7.506Z" transform="translate(-21.815 -9)" fill="#c99609" fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="36.819" height="36.819" viewBox="0 0 36.819 36.819">
<g id="syringe_3_" data-name="syringe (3)" transform="translate(0.002 0)">
<path id="Path_5100" data-name="Path 5100" d="M20.326,80.649A1.079,1.079,0,1,0,18.8,82.175l1.548,1.548L17.83,86.241l1.733,1.733A1.079,1.079,0,1,1,18.038,89.5L16.3,87.767l-2.518,2.518,1.733,1.733a1.079,1.079,0,1,1-1.525,1.525l-1.733-1.733L9.743,94.329l1.733,1.733A1.079,1.079,0,0,1,9.95,97.588L8.217,95.854,6.768,97.3a3.367,3.367,0,0,0-.993,2.4v4.373L.314,109.534A1.079,1.079,0,0,0,1.84,111.06L7.3,105.6h4.373a3.368,3.368,0,0,0,2.4-.993l13.58-13.581L29.2,92.573a1.079,1.079,0,0,0,1.525-1.525Z" transform="translate(0 -74.556)" fill="#ea2864"/>
<path id="Path_5101" data-name="Path 5101" d="M375.793,7.669,368.441.316a1.079,1.079,0,1,0-1.526,1.525l2.914,2.914L365.58,9l1.525,1.525,4.249-4.249,2.914,2.914a1.079,1.079,0,0,0,1.526-1.526Z" transform="translate(-339.292 0)" fill="#ea2864"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 985 B

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="58" height="36.818" viewBox="0 0 58 36.818">
<g id="heart-rate" transform="translate(-6.46 -15.787)">
<path id="Path_5093" data-name="Path 5093" d="M45.091,35.4,39.9,28.233l-5.416,6.781a2.626,2.626,0,0,1-3.743.364l-4.858-4.1L23.814,35.64a4.3,4.3,0,0,1-3.869,2.446H19.16l12.88,12.88L46.422,36.584A4.254,4.254,0,0,1,45.091,35.4Z" transform="translate(1.694 1.639)" fill="#d02127"/>
<path id="Path_5094" data-name="Path 5094" d="M23.617,31.245A3.427,3.427,0,0,1,28.93,30.1l4.255,3.6,4.927-6.167a3.427,3.427,0,0,1,5.462.125l5.518,7.623h1.183a11.817,11.817,0,0,0-17.352-16.02A11.819,11.819,0,0,0,16.21,35.966l.228.228h4.824Z" transform="translate(0.866 0)" fill="#d02127"/>
<path id="Path_5095" data-name="Path 5095" d="M8.258,33.723a1.8,1.8,0,0,0,0,3.607H20.91L17.3,33.723Z" transform="translate(0 2.425)" fill="#d02127"/>
<path id="Path_5096" data-name="Path 5096" d="M57.729,32.913H46.09l-2.97,3.027a4.208,4.208,0,0,0,2.128.58H57.729a1.8,1.8,0,0,0,0-3.607Z" transform="translate(4.933 2.316)" fill="#d02127"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -21,6 +21,6 @@
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0</string> <string>1.0</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>
<string>9.0</string> <string>11.0</string>
</dict> </dict>
</plist> </plist>

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.0' # platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -1,29 +1,47 @@
PODS: PODS:
- audio_session (0.0.1):
- Flutter
- connectivity (0.0.1): - connectivity (0.0.1):
- Flutter - Flutter
- Reachability - Reachability
- Flutter (1.0.0) - Flutter (1.0.0)
- just_audio (0.0.1):
- Flutter
- path_provider_ios (0.0.1):
- Flutter
- Reachability (3.2) - Reachability (3.2)
DEPENDENCIES: DEPENDENCIES:
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- Reachability - Reachability
EXTERNAL SOURCES: EXTERNAL SOURCES:
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
connectivity: connectivity:
:path: ".symlinks/plugins/connectivity/ios" :path: ".symlinks/plugins/connectivity/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
SPEC CHECKSUMS: SPEC CHECKSUMS:
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
COCOAPODS: 1.11.2 COCOAPODS: 1.11.3

@ -340,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;
@ -418,7 +418,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos; SDKROOT = iphoneos;
@ -467,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos; SUPPORTED_PLATFORMS = iphoneos;

@ -43,5 +43,7 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<true/> <true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict> </dict>
</plist> </plist>

@ -1,47 +1,167 @@
import 'dart:developer';
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:queuing_system/core/base/base_app_client.dart'; import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/response_model/patient_call.dart'; import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfoByClinincInfo"; import 'package:queuing_system/core/response_models/patient_ticket_model.dart';
const _call_UpdateNotIsQueueRecordByIDAsync = "/Call_UpdateNotIsQueueRecordByIDAsync"; import 'package:queuing_system/core/response_models/prayers_widget_model.dart';
import 'package:queuing_system/core/response_models/rss_feed_model.dart';
class API{ import 'package:queuing_system/core/response_models/test_patients.dart';
import 'package:queuing_system/core/response_models/weathers_widget_model.dart';
static GetCallRequestInfoByClinincInfo(String deviceIp, {@required Function(List<Tickets>, List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async{ import 'package:queuing_system/core/response_models/widgets_config_model.dart';
final body = { "IPAdress" : deviceIp };
BaseAppClient.post(_getCallRequestInfoByClinicInfo, body: body, onSuccess: (response, status){ const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfo_ByIP";
if(status == 200){ const _callUpdateNotIsQueueRecordByIDAsync = "/CallRequest_QueueUpdate";
final calledByNurse = (response["CalledByNurse"] as List).map((j) => Tickets.fromJson(j)).toList(); const _waitingAreaScreenConfigGet = "/WaitingAreaScreen_Config_Get";
final clinicCurrentPatient = (response["ClinicCurrentPatient"] as List).map((j) => Tickets.fromJson(j)).toList(); const _weatherForecastGetBy5Days = "/WeatherForecast_GetBy5Days";
onSuccess(calledByNurse, clinicCurrentPatient); const _prayerTimeToday = "/PrayerTime_Today";
}else{ const _rssFeedGet = "/RssFeed_Get";
onFailure(response);
} class MyHttpOverrides extends HttpOverrides {
}, onFailure: (error, status) => onFailure(error)); @override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
} }
}
static Call_UpdateNotIsQueueRecordByIDAsync(String deviceIp, {@required List<Tickets> tickets, @required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async{ class API {
if(tickets.isEmpty) { static getCallRequestInfoByClinicInfo(String deviceIp,
{required Function(List<PatientTicketModel>, List<PatientTicketModel>, CallConfig callConfig) onSuccess, required Function(dynamic) onFailure}) async {
final body = {"ipAdress": deviceIp, "apiKey": apiKey};
bool isDevMode = false;
if (isDevMode) {
final Map<String, dynamic> response = testPatientsData["data"] as Map<String, dynamic>;
CallConfig callConfig = CallConfig.fromJson(response["callConfig"]);
var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList();
var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList();
log("callPatients: ${callPatients.toString()}");
log("isQueuePatients: ${isQueuePatients.toString()}");
onSuccess(callPatients.reversed.toList(), isQueuePatients.reversed.toList(), callConfig);
return; return;
} }
BaseAppClient.post(_getCallRequestInfoByClinicInfo,
body: body,
onSuccess: (apiResp, status) {
if (status == 200) {
final response = apiResp["data"];
List<Tickets> _ticketsUpdated = []; CallConfig callConfig = CallConfig.fromJson(response["callConfig"]);
var callPatients = (response["callPatients"] as List).map((j) => PatientTicketModel.fromJson(j)).toList().where((element) => element.callType != 0).toList();
for (var ticket in tickets) { var isQueuePatients = callPatients.where((element) => (element.isQueue == false && element.callType != 0)).toList();
final body = { "CallID" : ticket.callNo}; callPatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp));
await BaseAppClient.post(_call_UpdateNotIsQueueRecordByIDAsync, body: body, onSuccess: (response, status){ isQueuePatients.sort((a, b) => a.editedOnTimeStamp.compareTo(b.editedOnTimeStamp));
if(status == 200){ callPatients.removeWhere((element) => element.isQueue == false);
ticket.call_updated = true; callPatients.addAll(isQueuePatients);
_ticketsUpdated.add(ticket); log("callPatients: ${callPatients.reversed.toList().toString()}");
} log("isQueuePatients: ${isQueuePatients.reversed.toList().toString()}");
}, onFailure: (error, status) => onFailure(error)); onSuccess(callPatients.reversed.toList(), isQueuePatients.reversed.toList(), callConfig);
} } else {
onFailure(apiResp);
}
},
onFailure: (error, status) => onFailure(error));
}
static callUpdateNotIsQueueRecordByIDAsync(
String deviceIp, {
required PatientTicketModel ticket,
required Function(List<PatientTicketModel>) onSuccess,
required Function(dynamic) onFailure,
}) async {
List<PatientTicketModel> _ticketsUpdated = [];
// for (var ticket in tickets) {
final body = {"id": ticket.id, "apiKey": apiKey, "ipAddress": deviceIp, "callType": ticket.callType};
await BaseAppClient.post(_callUpdateNotIsQueueRecordByIDAsync,
body: body,
onSuccess: (response, status) {
if (status == 200) {
ticket.callUpdated = true;
_ticketsUpdated.add(ticket);
}
log("here response: $response");
},
onFailure: (error, status) => onFailure(error));
// }
if(_ticketsUpdated.isNotEmpty) { if (_ticketsUpdated.isNotEmpty) {
onSuccess(_ticketsUpdated); onSuccess(_ticketsUpdated);
}else{ } else {
onFailure(false); onFailure(false);
} }
} }
static Future<WidgetsConfigModel> getWidgetConfigsFromServer(String deviceIp, {required Function(dynamic) onFailure}) async {
final body = {"ipAddress": deviceIp};
WidgetsConfigModel widgetsConfigModel = WidgetsConfigModel();
await BaseAppClient.post(_waitingAreaScreenConfigGet,
body: body,
onSuccess: (response, status) {
if (status == 200 && response["data"] != null) {
List list = (response["data"] as List).map((e) => WidgetsConfigModel.fromJson(e)).toList();
if (list.isNotEmpty) {
widgetsConfigModel = list.first;
}
}
},
onFailure: (error, status) => log("error: ${error.toString()}"));
return widgetsConfigModel;
}
static Future<WeathersWidgetModel?> getWeatherDetailsFromServer(String cityId, {required Function(dynamic) onFailure}) async {
final body = {"cityID": cityId};
WeathersWidgetModel weathersWidgetModel = WeathersWidgetModel();
await BaseAppClient.post(_weatherForecastGetBy5Days,
body: body,
onSuccess: (response, status) {
if (status == 200 && response["data"] != null && response["data"].isNotEmpty) {
weathersWidgetModel = (response["data"] as List).map((e) => WeathersWidgetModel.fromJson(e)).toList().first;
}
},
onFailure: (error, status) => log("error: ${error.toString()}"));
return weathersWidgetModel;
}
static Future<PrayersWidgetModel?> getPrayerDetailsFromServer({
required double latitude,
required double longitude,
required Function(dynamic) onFailure,
}) async {
final body = {"latitude": latitude, "longitude": longitude};
PrayersWidgetModel currentPrayersWidgetModel = PrayersWidgetModel();
await BaseAppClient.post(_prayerTimeToday,
body: body,
onSuccess: (response, status) {
if (status == 200 && response["data"] != null) {
final prayersWidgetModel = (response["data"] as List).map((e) => PrayersWidgetModel.fromJson(e)).toList().first;
currentPrayersWidgetModel = prayersWidgetModel;
}
},
onFailure: (error, status) => log("error: ${error.toString()}"));
return currentPrayersWidgetModel;
}
static Future<RssFeedModel?> getRssFeedDetailsFromServer({
required int languageId,
required Function(dynamic) onFailure,
}) async {
final body = {"languageID": languageId};
RssFeedModel rssFeedModel = RssFeedModel();
await BaseAppClient.post(_rssFeedGet,
body: body,
onSuccess: (response, status) {
if (status == 200 && response["data"] != null) {
final rssFeed = (response["data"] as List).map((e) => RssFeedModel.fromJson(e)).toList().first;
rssFeedModel = rssFeed;
}
},
onFailure: (error, status) => log("error: ${error.toString()}"));
return rssFeedModel;
}
} }

@ -1,97 +1,54 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/core/base/project_view_model.dart';
import 'package:queuing_system/widget/app_loader_widget.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
import 'base_view_model.dart';
import 'network_base_view.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
final Widget body; final Widget body;
final bool isLoading; final bool isLoading;
final bool isShowAppBar; final bool isShowAppBar;
final BaseViewModel baseViewModel; final Widget? bottomSheet;
final Widget bottomSheet; final Color? backgroundColor;
final Color backgroundColor; final PreferredSizeWidget appBar;
final Widget appBar;
final Widget drawer; final Widget drawer;
final Widget bottomNavigationBar; final Widget bottomNavigationBar;
final String subtitle; final String subtitle;
final bool isHomeIcon; final bool isHomeIcon;
final bool extendBody; final bool extendBody;
final AppProvider appProvider;
AppScaffold( const AppScaffold(
{this.appBarTitle = '', {Key? key,
this.body, this.appBarTitle = '',
required this.body,
this.isLoading = false, this.isLoading = false,
this.isShowAppBar = true, this.isShowAppBar = true,
this.baseViewModel,
this.bottomSheet, this.bottomSheet,
this.backgroundColor, this.backgroundColor,
this.isHomeIcon = true, this.isHomeIcon = true,
this.appBar, required this.appBar,
this.subtitle, this.subtitle = "",
this.drawer, this.drawer = const SizedBox.shrink(),
this.extendBody = false, this.extendBody = false,
this.bottomNavigationBar}); required this.appProvider,
required this.bottomNavigationBar})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
FocusScope.of(context).requestFocus(new FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
,
drawer: drawer, drawer: drawer,
extendBody: extendBody, extendBody: extendBody,
bottomNavigationBar: bottomNavigationBar, bottomNavigationBar: bottomNavigationBar,
appBar: isShowAppBar appBar: isShowAppBar ? appBar : null,
? appBar ??
AppBar(
elevation: 0,
backgroundColor: Colors.white,
//HexColor('#515B5D'),
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.black87,
fontSize: 16.8,
)),
title: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(appBarTitle.toUpperCase()),
if (subtitle != null)
Text(
subtitle,
style: TextStyle(fontSize: 12, color: Colors.red),
),
],
),
leading: Builder(builder: (BuildContext context) {
return IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
onPressed: () => Navigator.pop(context),
);
}),
centerTitle: true,
actions: <Widget>[
],
)
: null,
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
body: projectProvider.isInternetConnection body: appProvider.isInternetConnectionAvailable
? baseViewModel != null ? body
? NetworkBaseView(
baseViewModel: baseViewModel,
child: body,
)
: Stack(
children: <Widget>[body, buildAppLoaderWidget(isLoading)])
: Center( : Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -101,15 +58,11 @@ class AppScaffold extends StatelessWidget {
"assets/images/undraw_connected_world_wuay.png", "assets/images/undraw_connected_world_wuay.png",
height: 250, height: 250,
), ),
AppText('No Internet Connection') const AppText('No Internet Connection')
], ],
), ),
), ),
), ),
); );
} }
Widget buildAppLoaderWidget(bool isLoading) {
return isLoading ? AppLoaderWidget() : Container();
}
} }

@ -1,103 +1,96 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io' show Platform; import 'dart:developer';
import 'package:http/http.dart' as http;
import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/main.dart';
import 'package:queuing_system/utils/Utils.dart'; import 'package:queuing_system/utils/Utils.dart';
import 'package:http/http.dart' as http;
class BaseAppClient { class BaseAppClient {
static post(String endPoint, static post(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
String url; String url;
url = BASE_URL + endPoint; url = "$BASE_URL/api/PatientCall" + endPoint;
try { // try {
logger.i("URL : $url");
logger.i("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
});
print("URL : $url"); final int statusCode = response.statusCode;
print("Body : ${json.encode(body)}"); logger.i("statusCode : $statusCode");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url), if (statusCode < 200 || statusCode >= 400) {
body: json.encode(body), if (onFailure != null) {
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
});
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
} else {
print(response.body.toString());
var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode);
} }
} else { } else {
logger.i("Response: ${response.body.toString()}");
var parsed = json.decode(response.body.toString());
if (onSuccess != null) {
onSuccess(parsed, statusCode);
}
}
} else {
if (onFailure != null) {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
} }
} catch (e) {
print(e);
onFailure(e.toString(), -1);
} }
// } catch (e) {
// if (onFailure != null) {
// onFailure(e.toString(), -1);
// }
// }
} }
static get(String endPoint, {Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
static get(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async {
String url; String url;
url = BASE_URL + endPoint; url = "$BASE_URL/api/PatientCall" + endPoint;
try { try {
// String token = await sharedPref.getString(TOKEN); // String token = await sharedPref.getString(TOKEN);
print("URL : $url"); logger.i("URL GET: $url");
print("Body : ${json.encode(body)}"); logger.i("Body GET: ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get(Uri.parse(url), final response = await http.get(Uri.parse(url), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) { if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode); if (onFailure != null) {
onFailure(Utils.generateContactAdminMsg(), statusCode);
}
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode); if (onSuccess != null) {
onSuccess(parsed, statusCode);
}
} }
} else { } else {
onFailure('Please Check The Internet Connection', -1); if (onFailure != null) {
onFailure('Please Check The Internet Connection', -1);
}
} }
} catch (e) { } catch (e) {
print(e); if (onFailure != null) {
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
}
} }
} }
String getError(parsed) { String getError(parsed) {
//TODO change this fun //TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) { if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null && if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
parsed["ValidationErrors"]["ValidationErrors"].length != 0) { for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) {
for (var i = 0; error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n";
i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
} }
} }
} }

@ -1,9 +0,0 @@
class BaseService {
String error;
bool hasError = false;
BaseService() {
}
}

@ -1,50 +0,0 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'base_view_model.dart';
import 'locater.dart';
class BaseView<T extends BaseViewModel> extends StatefulWidget {
final Widget Function(BuildContext context, T model, Widget child) builder;
final Function(T) onModelReady;
BaseView({
this.builder,
this.onModelReady,
});
@override
_BaseViewState<T> createState() => _BaseViewState<T>();
}
class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
T model = locator<T>();
bool isLogin = false;
@override
void initState() {
if (widget.onModelReady != null) {
widget.onModelReady(model);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<T>.value(
value: model,
child: Consumer<T>(builder: widget.builder),
);
}
@override
void dispose() {
if (model != null) {
model = null;
}
super.dispose();
}
}

@ -1,40 +0,0 @@
import 'dart:async';
import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart';
import 'package:queuing_system/core/base/view_state.dart';
class BaseViewModel extends ChangeNotifier {
ViewState _state = ViewState.Idle;
bool isInternetConnection = true;
StreamSubscription subscription;
ViewState get state => _state;
String error = "";
void setState(ViewState viewState) {
_state = viewState;
notifyListeners();
}
BaseViewModel(){
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
break;
case ConnectivityResult.mobile:
isInternetConnection = true;
break;
case ConnectivityResult.none:
isInternetConnection = false;
break;
}
notifyListeners();
});
}
}

@ -1,11 +0,0 @@
import 'package:get_it/get_it.dart';
GetIt locator = GetIt.instance;
///di
void setupLocator() {
/// Services
/// View Model
}

@ -1,40 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:queuing_system/core/base/view_state.dart';
import 'package:queuing_system/widget/app_loader_widget.dart';
import 'package:queuing_system/widget/errors/error_message.dart';
import 'base_view_model.dart';
class NetworkBaseView extends StatelessWidget {
final BaseViewModel baseViewModel;
final Widget child;
NetworkBaseView({Key key, this.baseViewModel, this.child});
@override
Widget build(BuildContext context) {
return Container(
color: Colors.grey[100],
child: buildBaseViewWidget(),
);
}
buildBaseViewWidget() {
switch (baseViewModel.state) {
case ViewState.ErrorLocal:
case ViewState.Idle:
case ViewState.BusyLocal:
return child;
break;
case ViewState.Busy:
return AppLoaderWidget();
break;
case ViewState.Error:
return ErrorMessage(
error: baseViewModel.error,
);
break;
}
}
}

@ -1,51 +0,0 @@
import 'dart:async';
import 'package:connectivity/connectivity.dart';
import 'package:flutter/cupertino.dart';
import 'package:queuing_system/core/base/base_app_client.dart';
class ProjectViewModel with ChangeNotifier {
Locale _appLocale;
String currentLanguage = 'ar';
bool _isArabic = false;
bool isInternetConnection = true;
bool isLoading = false;
bool isError = false;
String error = '';
BaseAppClient baseAppClient = BaseAppClient();
Locale get appLocal => _appLocale;
bool get isArabic => _isArabic;
StreamSubscription subscription;
ProjectViewModel() {
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
break;
case ConnectivityResult.mobile:
isInternetConnection = true;
break;
case ConnectivityResult.none:
isInternetConnection = false;
break;
}
notifyListeners();
});
}
@override
void dispose() {
if (subscription != null) subscription.cancel();
super.dispose();
}
}

@ -1 +0,0 @@
enum ViewState { Idle, Busy, Error, BusyLocal, ErrorLocal }

@ -4,23 +4,66 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL = 'https://ms.hmg.com/nscapi'; // UAT
const BASE_URL = 'https://uat.hmgwebservices.com/services/Nurses.svc/REST'; // UAT const BASE_URL = 'https://qline.hmg.com'; // LIVE
const apiKey = 'EE17D21C7943485D9780223CCE55DCE5'; // UAT
// const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST'; // const BASE_URL = 'http://10.200.204.11:2222/Services/Nurses.svc/REST';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
/// Timer Info /// Timer Info
const TIMER_MIN = 10; const TIMER_MIN = 10;
class AppGlobal { class AppGlobal {
static var CONTEX; static var CONTEX;
static Color appRedColor = const Color(0xFFD02127);
static Color appGreenColor = const Color(0xFF359846); // static Color appRedColor = const Color(0xFFD02127);
// static Color appGreenColor = const Color(0xFF359846);
static Color appTextColor = const Color(0xFF2B353E); static Color appTextColor = const Color(0xFF2B353E);
static Color scheduleTextColor = const Color(0xFF2E303A); static Color appRssFeed = const Color(0x3A1E2326);
static Color inProgressColor = const Color(0xFFCC9B14);
static Color appGreyColor = const Color(0xFF575757); //TextColors
static Color appLightGreyColor = const Color(0xFFE6E6E6); static Color nebulizationColor = const Color(0xFF3C86D0);
static Color vitalSignColor = const Color(0xFFD02127);
static Color doctorColor = const Color(0xFF52964F);
// static Color procedureColor = const Color(0xFFC99609);
static Color vaccinationColor = const Color(0xFFC99609);
static Color procedureColor = const Color(0xFF460707);
//IconPaths
static String vitalSignIcon = "assets/images/vitalsign_icon.svg";
static String nebulizationIcon = "assets/images/nebulization_icon.svg";
static String doctorIcon = "assets/images/doctor_icon.svg";
static String procedureIcon = "assets/images/procedure_icon.svg";
static String vaccinationIcon = "assets/images/vaccination_icon.svg";
//Widgets
static String mosqueIcon = "assets/icons/mosque.svg";
static String weatherIcon = "assets/icons/weather.svg";
static String cloudIcon = "assets/icons/cloudy.svg";
static String coldIcon = "assets/icons/cold.svg";
static String hotIcon = "assets/icons/hot.svg";
static String rainIcon = "assets/icons/rainy.svg";
static String sunnyIcon = "assets/icons/sunny.svg";
static String windIcon = "assets/icons/windy.svg";
//Decoration
static BoxDecoration configWidgetDecoration = BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
blurRadius: 4,
offset: const Offset(4, 4), // Shadow position
),
BoxShadow(
color: Colors.grey.withOpacity(0.2),
blurRadius: 4,
offset: const Offset(-4, -4), // Shadow position
),
],
);
} }

File diff suppressed because it is too large Load Diff

@ -1,16 +0,0 @@
const TOKEN = 'token';
const PROJECT_ID = 'projectID';
const VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID';
const VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID';
const LOGIN_TOKEN_ID = 'LogInToken';
const DOCTOR_ID = 'doctorID';
const SLECTED_PATIENT_TYPE = 'slectedPatientType';
const APP_Language = 'language';
const DOCTOR_PROFILE = 'doctorProfile';
const LIVE_CARE_PATIENT = 'livecare-patient-profile';
const LOGGED_IN_USER = 'loggedUser';
const EMPLOYEE_ID = 'EmployeeID';
const DASHBOARD_DATA = 'dashboard-data';
const OTP_TYPE = 'otp-type';
const LAST_LOGIN_USER = 'last-login-user';
const CLINIC_NAME = 'clinic-name';

@ -5,15 +5,15 @@ class SizeConfig {
static double _blockWidth = 0; static double _blockWidth = 0;
static double _blockHeight = 0; static double _blockHeight = 0;
static double realScreenWidth; static double realScreenWidth = 0.0;
static double realScreenHeight; static double realScreenHeight = 0.0;
static double screenWidth; static double screenWidth = 0.0;
static double screenHeight; static double screenHeight = 0.0;
static double textMultiplier; static double? textMultiplier;
static double imageSizeMultiplier; static double? imageSizeMultiplier;
static double heightMultiplier; static double? heightMultiplier;
static bool isPortrait = true; static bool isPortrait = true;
static double widthMultiplier; static double? widthMultiplier;
static bool isMobilePortrait = false; static bool isMobilePortrait = false;
static bool isMobile = false; static bool isMobile = false;
static bool isHeightShort = false; static bool isHeightShort = false;
@ -77,7 +77,7 @@ class SizeConfig {
// print('isMobilePortrait $isMobilePortrait'); // print('isMobilePortrait $isMobilePortrait');
} }
static getTextMultiplierBasedOnWidth({double width}) { static getTextMultiplierBasedOnWidth({required double width}) {
// TODO handel LandScape case // TODO handel LandScape case
if (width != null) { if (width != null) {
return width / 100; return width / 100;
@ -85,7 +85,7 @@ class SizeConfig {
return widthMultiplier; return widthMultiplier;
} }
static getWidthMultiplier({double width}) { static getWidthMultiplier({double? width}) {
// TODO handel LandScape case // TODO handel LandScape case
if (width != null) { if (width != null) {
return width / 100; return width / 100;
@ -93,7 +93,7 @@ class SizeConfig {
return widthMultiplier; return widthMultiplier;
} }
static getHeightMultiplier({double height}) { static getHeightMultiplier({double? height}) {
// TODO handel LandScape case // TODO handel LandScape case
if (height != null) { if (height != null) {
return height / 100; return height / 100;

@ -1,6 +0,0 @@
enum FontType {
Poppins_Bold,
poppins_Medium,
poppins_Regular,
poppins_SemiBold,
}

@ -1,75 +0,0 @@
import 'dart:convert';
import 'package:queuing_system/utils/call_type.dart';
class Tickets {
Tickets({
this.callNo,
this.roomNo,
this.callType,
this.createdON,
this.doctorName,
this.doctorNameN,
this.editedON,
this.mobileNo,
this.patientGender,
this.patientID,
this.queueNo,});
Tickets.fromJson(dynamic json) {
callNo = json['CallNo'];
roomNo = json['RoomNo'];
callType = json['CallType'];
createdON = json['CreatedON'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
editedON = json['EditedON'];
mobileNo = json['MobileNo'];
patientGender = json['PatientGender'];
patientID = json['PatientID'];
queueNo = json['QueueNo'];
}
int callNo;
String roomNo;
int callType;
String createdON;
String doctorName;
String doctorNameN;
String editedON;
String mobileNo;
int patientGender;
int patientID;
String queueNo;
bool call_updated = false;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['CallNo'] = callNo;
map['RoomNo'] = roomNo;
map['CallType'] = callType;
map['CreatedON'] = createdON;
map['DoctorName'] = doctorName;
map['DoctorNameN'] = doctorNameN;
map['EditedON'] = editedON;
map['MobileNo'] = mobileNo;
map['PatientGender'] = patientGender;
map['PatientID'] = patientID;
map['QueueNo'] = queueNo;
return map;
}
@override
String toString() {
return (callNo).toString();
}
CallType getCallType(){
if(callType == 0) return CallType.RECEPTION;
if(callType == 1) return CallType.NURSE;
if(callType == 2) return CallType.DOCTOR;
return CallType.NONE;
}
}

@ -1,59 +0,0 @@
import 'dart:convert';
Xyz xyzFromJson(String str) => Xyz.fromJson(json.decode(str));
String xyzToJson(Xyz data) => json.encode(data.toJson());
class Xyz {
Xyz({
this.callNo,
this.roomNo,
this.callType,
this.createdON,
this.doctorName,
this.doctorNameN,
this.editedON,
this.mobileNo,
this.patientGender,
this.patientID,
this.queueNo,});
Xyz.fromJson(dynamic json) {
callNo = json['CallNo'];
roomNo = json['RoomNo'];
callType = json['CallType'];
createdON = json['CreatedON'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
editedON = json['EditedON'];
mobileNo = json['MobileNo'];
patientGender = json['PatientGender'];
patientID = json['PatientID'];
queueNo = json['QueueNo'];
}
int callNo;
String roomNo;
int callType;
String createdON;
String doctorName;
String doctorNameN;
String editedON;
String mobileNo;
int patientGender;
int patientID;
String queueNo;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['CallNo'] = callNo;
map['RoomNo'] = roomNo;
map['CallType'] = callType;
map['CreatedON'] = createdON;
map['DoctorName'] = doctorName;
map['DoctorNameN'] = doctorNameN;
map['EditedON'] = editedON;
map['MobileNo'] = mobileNo;
map['PatientGender'] = patientGender;
map['PatientID'] = patientID;
map['QueueNo'] = queueNo;
return map;
}
}

@ -0,0 +1,216 @@
import 'dart:ui';
var data = {
"roomText": "غرفة",
"queueNoText": "رقم قائمة الانتظار",
"callForText": "يدعو إلى",
"currentServeText": "العرض الحالي",
"callTypeVitalSignText": "علامة حيوية",
"callTypeDoctorText": "طبيب",
"callTypeProcedureText": "إجراء",
"callTypeVaccinationText": "تلقيح",
"callTypeNebulizationText": "الإرذاذ",
};
class CallConfig {
late int id;
late bool globalClinicPrefixReq;
late bool clinicPrefixReq;
late int concurrentCallDelaySec;
late int voiceType;
late int screenLanguage;
late int voiceLanguage;
late int screenMaxDisplayPatients;
late int prioritySMS;
late int priorityWhatsApp;
late int priorityEmail;
late String vitalSignText;
late String doctorText;
late String procedureText;
late String vaccinationText;
late String nebulizationText;
late int createdBy;
late String createdOn;
late int editedBy;
late String editedOn;
late String preVoiceText;
late String roomText;
late String queueNoText;
late String callForText;
late String currentServeText;
late String nextPrayerText;
late String weatherText;
late String minText;
late String maxText;
late String fajrText;
late String dhuhrText;
late String asrText;
late String maghribText;
late String ishaText;
late String callTypeVitalSignText;
late String callTypeDoctorText;
late String callTypeProcedureText;
late String callTypeVaccinationText;
late String callTypeNebulizationText;
late TextDirection textDirection;
late ScreenOrientationEnum screenRotationEnum;
CallConfig({
this.id = 0,
this.globalClinicPrefixReq = false,
this.clinicPrefixReq = false,
this.concurrentCallDelaySec = 8,
this.voiceType = 0,
this.screenLanguage = 1,
this.voiceLanguage = 1,
this.screenMaxDisplayPatients = 5,
this.prioritySMS = 1,
this.priorityWhatsApp = 1,
this.priorityEmail = 1,
this.vitalSignText = "",
this.doctorText = "",
this.procedureText = "",
this.vaccinationText = "",
this.nebulizationText = "",
this.createdBy = 0,
this.createdOn = "",
this.editedBy = 0,
this.editedOn = "",
this.preVoiceText = "",
this.roomText = "",
this.queueNoText = "",
this.callForText = "",
this.currentServeText = "Current Serving",
this.nextPrayerText = "Next Prayer",
this.weatherText = "Weather",
this.minText = "Min",
this.maxText = "Max",
this.fajrText = "Fajar",
this.dhuhrText = "Dhuhr",
this.asrText = "Asr",
this.maghribText = "Maghrib",
this.ishaText = "Isha",
this.callTypeDoctorText = "",
this.callTypeProcedureText = "",
this.callTypeVaccinationText = "",
this.callTypeNebulizationText = "",
this.textDirection = TextDirection.ltr,
this.screenRotationEnum = ScreenOrientationEnum.portraitUp,
});
CallConfig.fromJson(Map<String, dynamic> json) {
id = json['id'];
globalClinicPrefixReq = json['globalClinicPrefixReq'];
clinicPrefixReq = json['clinicPrefixReq'];
concurrentCallDelaySec = json['concurrentCallDelaySec'];
voiceType = json['voiceType'];
screenLanguage = json['screenLanguage'] ?? 1;
voiceLanguage = screenLanguage; // json['voiceLanguage'] ?? 1;
screenMaxDisplayPatients = json['screenMaxDisplayPatients'];
// screenMaxDisplayPatients = 3;
prioritySMS = json['prioritySMS'];
priorityWhatsApp = json['priorityWhatsApp'];
priorityEmail = json['priorityEmail'];
vitalSignText = json['callForVitalSignText'];
doctorText = json['callForDoctorText'];
procedureText = json['callForProcedureText'];
vaccinationText = json['callForVaccinationText'];
nebulizationText = json['callForNebulizationText'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
editedBy = json['editedBy'];
editedOn = json['editedOn'];
preVoiceText = json['preVoiceText'] ?? (json['textDirection'] == 2 ? "رقم التذكرة" : "Ticket Number");
roomText = json['roomText'];
queueNoText = json['queueNoText'];
callForText = json['callForText'];
nextPrayerText = json['nextPrayerText'];
weatherText = json['weatherText'] ?? "Weather";
maxText = json['maxText'];
minText = json['minText'];
fajrText = json['fajarText'];
dhuhrText = json['dhuhrText'];
asrText = json['asarText'];
maghribText = json['maghribText'];
ishaText = json['ishaText'];
currentServeText = json['currentServeText'];
callTypeVitalSignText = json['vitalSignText'];
callTypeDoctorText = json['doctorText'];
callTypeProcedureText = json['procedureText'];
callTypeVaccinationText = json['vaccinationText'];
callTypeNebulizationText = json['nebulizationText'];
textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr;
screenRotationEnum = ((json['orientationType'] ?? 1) as int).toScreenOrientationEnum();
// screenRotationEnum = (json['screenRotationId'] as int).toScreenOrientationEnum();
}
static var data = {
"id": 1,
"globalClinicPrefixReq": true,
"clinicPrefixReq": true,
"concurrentCallDelaySec": 1,
"voiceType": 1,
"voiceTypeText": "Male",
"screenLanguage": 1,
"screenLanguageText": "English",
"voiceLanguage": 1,
"voiceLanguageText": "English",
"screenMaxDisplayPatients": 6,
"isNotiReq": true,
"prioritySMS": 2,
"priorityWhatsApp": 3,
"priorityEmail": 1,
"textDirection": 1,
"vitalSignText": "VitalSign",
"doctorText": "Doctor",
"procedureText": "Procedure",
"vaccinationText": "Vaccination",
"nebulizationText": "Nebulization",
"callForVitalSignText": "Call For VitalSign",
"callForDoctorText": "Call For Doctor",
"callForProcedureText": "Call For Procedure",
"callForVaccinationText": "Call For Vaccination",
"callForNebulizationText": "Call For Nebulization",
"roomText": "Room",
"queueNoText": "Queue No",
"callForText": "Call For",
"currentServeText": "Current Serving",
"maxText": "Max",
"minText": "Min",
"nextPrayerText": "Next Prayer",
"fajarText": "Fajar",
"dhuhrText": "Dhuhr",
"asarText": "Asar",
"maghribText": "Maghrib",
"ishaText": "Isha",
"createdBy": 101,
"createdOn": "2023-08-08T00:00:00",
"editedBy": 101,
"editedOn": "2023-10-08T10:07:12.5"
};
static CallConfig testCallConfig = CallConfig.fromJson(data);
}
enum ScreenOrientationEnum {
landscapeRight,
landscapeLeft,
portraitUp,
portraitDown,
}
extension ScreenOrientationEnumExt on int {
ScreenOrientationEnum toScreenOrientationEnum() {
if (this == 1) {
return ScreenOrientationEnum.portraitUp;
} else if (this == 2) {
return ScreenOrientationEnum.portraitDown;
} else if (this == 3) {
return ScreenOrientationEnum.landscapeRight;
} else if (this == 4) {
return ScreenOrientationEnum.landscapeLeft;
} else {
return ScreenOrientationEnum.portraitUp;
}
}
}

@ -0,0 +1,248 @@
import 'dart:math';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/utils/call_type.dart';
class PatientTicketModel {
late int id;
late int patientID;
late String mobileNo;
late String doctorName;
late String doctorNameN;
late int patientGender;
late int callType;
late int editedOnTimeStamp;
late int concurrentCallDelaySec;
late String roomNo;
late String createdOn;
late String editedOn;
late String queueNo;
late String callNoStr;
late bool isQueue;
late bool isToneReq;
late bool isVoiceReq;
late int voiceLanguage;
late String voiceLanguageText;
late String ticketNoText;
late String vitalSignText;
late String doctorText;
late String procedureText;
late String vaccinationText;
late String nebulizationText;
late String callForVitalSignText;
late String callForDoctorText;
late String callForProcedureText;
late String callForVaccinationText;
late String callForNebulizationText;
late String roomText;
late String queueNoText;
late String callForText;
late int orientationType;
late ScreenOrientationEnum screenRotationEnum;
late bool callUpdated = false;
PatientTicketModel({
this.id = 0,
this.patientID = 0,
this.mobileNo = "",
this.doctorName = "",
this.doctorNameN = "",
this.patientGender = 1,
this.callType = 1,
this.editedOnTimeStamp = 0,
this.roomNo = "",
this.createdOn = "",
this.editedOn = "",
this.queueNo = "",
this.callNoStr = "",
this.isQueue = false,
this.isToneReq = false,
this.isVoiceReq = false,
this.concurrentCallDelaySec = 1,
this.voiceLanguage = 1,
this.voiceLanguageText = "English",
this.ticketNoText = "Ticket Number",
this.vitalSignText = "VitalSign",
this.doctorText = "Doctor",
this.procedureText = "Procedure",
this.vaccinationText = "Vaccination",
this.nebulizationText = "Nebulization",
this.callForVitalSignText = "Call For VitalSign",
this.callForDoctorText = "Call For Doctor",
this.callForProcedureText = "Call For Procedure",
this.callForVaccinationText = "Call For Vaccination",
this.callForNebulizationText = "Call For Nebulization",
this.roomText = "Room",
this.queueNoText = "Queue No",
this.callForText = "Call For",
this.orientationType = 1,
this.screenRotationEnum = ScreenOrientationEnum.portraitUp,
});
int getRandomNum() {
return Random().nextInt(9);
}
PatientTicketModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
patientID = json['patientID'];
mobileNo = json['mobileNo'] ?? "";
doctorName = json['doctorName'] ?? "";
doctorNameN = json['doctorNameN'] ?? "";
patientGender = json['patientGender'] ?? "";
callType = json['callType'];
editedOnTimeStamp = DateTime.parse(json['editedOn']).millisecondsSinceEpoch;
roomNo = json['roomNo'];
createdOn = json['createdOn'];
editedOn = json['editedOn'];
queueNo = json['queueNoM'];
callNoStr = json['callNoStr'];
isQueue = json['isQueue'];
isToneReq = json['isToneReq'];
isVoiceReq = json['isVoiceReq'];
voiceLanguage = json['voiceLanguage'];
voiceLanguageText = json['voiceLanguageText'] ?? "English";
ticketNoText = json['ticketNoText'];
vitalSignText = json['vitalSignText'];
doctorText = json['doctorText'];
procedureText = json['procedureText'];
vaccinationText = json['vaccinationText'];
nebulizationText = json['nebulizationText'];
callForVitalSignText = json['callForVitalSignText'];
callForDoctorText = json['callForDoctorText'];
callForProcedureText = json['callForProcedureText'];
callForVaccinationText = json['callForVaccinationText'];
callForNebulizationText = json['callForNebulizationText'];
roomText = json['roomText'];
queueNoText = json['queueNoText'];
callForText = json['callForText'];
orientationType = json['orientationType'] ?? 1;
screenRotationEnum = ((json['orientationType'] ?? 1) as int).toScreenOrientationEnum();
}
// "voiceLanguage": 1,
// "voiceLanguageText": null,
// "ticketNoText": "Ticket Number",
// "vitalSignText": "VitalSign",
// "doctorText": "Doctor",
// "procedureText": "Procedure",
// "vaccinationText": "Vaccination",
// "nebulizationText": "Nebulization",
// "callForVitalSignText": "Call For VitalSign",
// "callForDoctorText": "Call For Doctor",
// "callForProcedureText": "Call For Procedure",
// "callForVaccinationText": "Call For Vaccination",
// "callForNebulizationText": "Call For Nebulization",
// "roomText": "Room",
// "queueNoText": "Queue No",
// "callForText": "Call For"
@override
String toString() {
return (queueNo).toString();
}
CallType getCallType() {
if (callType == 1) return CallType.vitalSign;
if (callType == 2) return CallType.doctor;
if (callType == 3) return CallType.procedure;
if (callType == 4) return CallType.vaccination;
if (callType == 5) return CallType.nebulization;
return CallType.vitalSign;
}
//
// static List<PatientTicketModel> testCallPatients = [
// PatientTicketModel(
// id: 1,
// patientID: 112,
// mobileNo: "112",
// doctorName: "name",
// doctorNameN: "nameN",
// patientGender: 1,
// callType: 1,
// roomNo: "617",
// createdOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOnTimeStamp: DateTime.now().millisecondsSinceEpoch,
// queueNo: "B-89",
// callNoStr: "B-89",
// isQueue: true,
// isToneReq: true,
// isVoiceReq: true,
// concurrentCallDelaySec: 8,
// ),
// PatientTicketModel(
// id: 1,
// patientID: 112,
// mobileNo: "112",
// doctorName: "name",
// doctorNameN: "nameN",
// patientGender: 1,
// callType: 1,
// roomNo: "617",
// createdOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOn: DateTime.now().millisecondsSinceEpoch.toString(),
// queueNo: "B-89",
// callNoStr: "B-89",
// isQueue: true,
// isToneReq: true,
// isVoiceReq: true,
// concurrentCallDelaySec: 8,
// ),
// PatientTicketModel(
// id: 1,
// patientID: 112,
// mobileNo: "112",
// doctorName: "name",
// doctorNameN: "nameN",
// patientGender: 1,
// callType: 1,
// roomNo: "617",
// createdOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOn: DateTime.now().millisecondsSinceEpoch.toString(),
// queueNo: "B-89",
// callNoStr: "B-89",
// isQueue: true,
// isToneReq: true,
// isVoiceReq: true,
// concurrentCallDelaySec: 8,
// ),
// PatientTicketModel(
// id: 1,
// patientID: 112,
// mobileNo: "112",
// doctorName: "name",
// doctorNameN: "nameN",
// patientGender: 1,
// callType: 1,
// roomNo: "617",
// createdOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOn: DateTime.now().millisecondsSinceEpoch.toString(),
// queueNo: "B-89",
// callNoStr: "B-89",
// isQueue: true,
// isToneReq: true,
// isVoiceReq: true,
// concurrentCallDelaySec: 8,
// ),
// PatientTicketModel(
// id: 1,
// patientID: 112,
// mobileNo: "112",
// doctorName: "name",
// doctorNameN: "nameN",
// patientGender: 1,
// callType: 1,
// roomNo: "617",
// createdOn: DateTime.now().millisecondsSinceEpoch.toString(),
// editedOn: DateTime.now().millisecondsSinceEpoch.toString(),
// queueNo: "B-89",
// callNoStr: "B-89",
// isQueue: true,
// isToneReq: true,
// isVoiceReq: true,
// concurrentCallDelaySec: 8,
// ),
// ];
}

@ -0,0 +1,49 @@
import 'package:intl/intl.dart';
class PrayersWidgetModel {
int? fajr;
String? sunrise;
int? dhuhr;
int? asr;
String? sunset;
int? maghrib;
int? isha;
String? imsak;
String? midnight;
String? firstthird;
String? lastthird;
String? dateFor;
PrayersWidgetModel({this.fajr, this.sunrise, this.dhuhr, this.asr, this.sunset, this.maghrib, this.isha, this.imsak, this.midnight, this.firstthird, this.lastthird, this.dateFor});
PrayersWidgetModel.fromJson(Map<String, dynamic> json) {
fajr = dateTimeConversion(json['dateFor'], json['fajr']);
sunrise = json['sunrise'];
dhuhr = dateTimeConversion(json['dateFor'], getDhuhrData(json), isForDhuhr: true);
asr = dateTimeConversion(json['dateFor'], json['asr']);
sunset = json['sunset'];
maghrib = dateTimeConversion(json['dateFor'], json['maghrib']);
isha = dateTimeConversion(json['dateFor'], json['isha']);
imsak = json['imsak'];
midnight = json['midnight'];
firstthird = json['firstthird'];
lastthird = json['lastthird'];
dateFor = json['dateFor'];
}
static String getDhuhrData(dynamic json) {
return (json['dhuhr'] as String).contains('PM') ? json['dhuhr'] : json['dhuhr'] + ' PM';
}
static dateTimeConversion(String date, String time, {bool isForDhuhr = false}) {
if (isForDhuhr) {
return DateFormat('DD MMM yyyy hh:mm a').parse("$date $time").millisecondsSinceEpoch;
}
return DateFormat('DD MMM yyyy hh:mm').parse("$date $time").millisecondsSinceEpoch;
}
@override
String toString() {
return 'PrayersWidgetModel{fajr: $fajr, sunrise: $sunrise, dhuhr: $dhuhr, asr: $asr, sunset: $sunset, maghrib: $maghrib, isha: $isha, imsak: $imsak, midnight: $midnight, firstthird: $firstthird, lastthird: $lastthird, dateFor: $dateFor}';
}
}

@ -0,0 +1,15 @@
class RssFeedModel {
String? rssFeed;
RssFeedModel({this.rssFeed});
RssFeedModel.fromJson(Map<String, dynamic> json) {
rssFeed = json['rssFeed'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['rssFeed'] = rssFeed;
return data;
}
}

@ -0,0 +1,378 @@
var testPatientsData = {
"totalItemsCount": null,
"data": {
"callPatients": [
{
"id": 3,
"patientID": 109436,
"mobileNo": null,
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:40:27.693",
"editedOn": "2023-12-27T10:46:32.86",
"queueNo": "IMD A-41",
"callNoStr": "A-41",
"patientEmail": "unknown@unknown.com",
"preferredLang": "1",
"isQueue": true,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": "10.20.10.42",
"voiceLanguage": 1,
"voiceLanguageText": null,
"ticketNoText": "Ticket Number",
"vitalSignText": "VitalSign",
"doctorText": "Doctor",
"procedureText": "Procedure",
"vaccinationText": "Vaccination",
"nebulizationText": "Nebulization",
"callForVitalSignText": "Call For VitalSign",
"callForDoctorText": "Call For Doctor",
"callForProcedureText": "Call For Procedure",
"callForVaccinationText": "Call For Vaccination",
"callForNebulizationText": "Call For Nebulization",
"roomText": "Room",
"queueNoText": "Queue No",
"callForText": "Call For"
},
{
"id": 4,
"patientID": 3120504,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 4,
"patientID": 3120505,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 4,
"patientID": 3120506,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 4,
"patientID": 3120507,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 4,
"patientID": 3120508,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 4,
"patientID": 3120509,
"mobileNo": "0550004569",
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:45:45.15",
"editedOn": "2023-12-27T10:46:48.373",
"queueNo": "IMD A-43",
"callNoStr": "A-43",
"patientEmail": "unknown@unknown.com",
"preferredLang": "2",
"isQueue": false,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": null,
"voiceLanguage": 2,
"voiceLanguageText": null,
"ticketNoText": "رقم التذكرة",
"vitalSignText": "علامة حيوية",
"doctorText": "الطبيب",
"procedureText": "الاجراءات",
"vaccinationText": "المطاعيم",
"nebulizationText": "التنفس",
"callForVitalSignText": "التوجه الى غرفة قياس العلامات الحيوية",
"callForDoctorText": "التوجه الى الطبيب",
"callForProcedureText": "التوجه الى غرفة الإجراءات",
"callForVaccinationText": "التوجه الى غرفة المطاعيم",
"callForNebulizationText": "التوجه الى غرفة التنفس",
"roomText": "غرفة",
"queueNoText": "رقم الانتظار",
"callForText": "التوجه الى"
},
{
"id": 3,
"patientID": 109510,
"mobileNo": null,
"doctorName": "",
"doctorNameN": null,
"patientGender": 1,
"callType": 1,
"roomNo": "1",
"createdOn": "2023-12-27T10:40:27.693",
"editedOn": "2023-12-27T10:46:32.86",
"queueNo": "IMD A-41",
"callNoStr": "A-41",
"patientEmail": "unknown@unknown.com",
"preferredLang": "1",
"isQueue": true,
"isToneReq": true,
"isVoiceReq": true,
"orientationType": 1,
"isTurnOn": true,
"concurrentCallDelaySec": 1,
"crVerifiedIP": null,
"crTypeAckIP": "10.20.10.42",
"voiceLanguage": 1,
"voiceLanguageText": null,
"ticketNoText": "Ticket Number",
"vitalSignText": "VitalSign",
"doctorText": "Doctor",
"procedureText": "Procedure",
"vaccinationText": "Vaccination",
"nebulizationText": "Nebulization",
"callForVitalSignText": "Call For VitalSign",
"callForDoctorText": "Call For Doctor",
"callForProcedureText": "Call For Procedure",
"callForVaccinationText": "Call For Vaccination",
"callForNebulizationText": "Call For Nebulization",
"roomText": "Room",
"queueNoText": "Queue No",
"callForText": "Call For"
},
],
"drCallPatients": [],
"nurseCallPatients": [],
"callConfig": {
"id": 1,
"globalClinicPrefixReq": true,
"clinicPrefixReq": true,
"concurrentCallDelaySec": 1,
"voiceType": 1,
"voiceTypeText": "Male",
"screenLanguage": 1,
"screenLanguageText": "English",
"voiceLanguage": 2,
"voiceLanguageText": "Arabic",
"screenMaxDisplayPatients": 7,
"isNotiReq": false,
"prioritySMS": 2,
"priorityWhatsApp": 3,
"priorityEmail": 1,
"textDirection": 1,
"orientationType": 1,
"ticketNoText": "Ticket Number",
"vitalSignText": "VitalSign",
"doctorText": "Doctor",
"procedureText": "Procedure",
"vaccinationText": "Vaccination",
"nebulizationText": "Nebulization",
"callForVitalSignText": "Call For VitalSign",
"callForDoctorText": "Call For Doctor",
"callForProcedureText": "Call For Procedure",
"callForVaccinationText": "Call For Vaccination",
"callForNebulizationText": "Call For Nebulization",
"roomText": "Room",
"queueNoText": "Queue No",
"callForText": "Call For",
"currentServeText": "Current Serving",
"maxText": "Max",
"minText": "Min",
"nextPrayerText": "Next Prayer",
"fajarText": "Fajar",
"dhuhrText": "Dhuhr",
"asarText": "Asar",
"maghribText": "Maghrib",
"ishaText": "Isha",
"lastPatientServedTimeMin": 5,
"createdBy": 101,
"createdOn": "2023-08-08T00:00:00",
"editedBy": 101,
"editedOn": "2023-12-26T17:30:47.62"
}
},
"messageStatus": 1,
"message": "Success"
};

@ -0,0 +1,87 @@
import 'package:queuing_system/core/config/config.dart';
class WeathersWidgetModel {
int? id;
String? headline;
double? maxTemp;
double? minTemp;
String? iconPhrase;
String? forecastDate;
int? cityID;
String? forecastDay;
String? createDateTime;
double? windSpeed;
String? windDirection;
double? windDegrees;
String? weatherIconPath;
WeathersWidgetModel({
this.id,
this.headline,
this.maxTemp,
this.minTemp,
this.iconPhrase,
this.forecastDate,
this.cityID,
this.forecastDay,
this.createDateTime,
this.windSpeed,
this.windDirection,
this.windDegrees,
this.weatherIconPath,
});
WeathersWidgetModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
headline = json['headline'];
maxTemp = json['maxTemp'];
minTemp = json['minTemp'];
iconPhrase = json['iconPhrase'];
forecastDate = json['forecastDate'];
cityID = json['cityID'];
forecastDay = json['forecastDay'];
createDateTime = json['createDateTime'];
windSpeed = json['windSpeed'];
windDirection = json['windDirection'];
windDegrees = json['windDegrees'];
weatherIconPath = getWeatherIconPath(json['iconPhrase']);
}
String getWeatherIconPath(String iconPhrase) {
if (iconPhrase == "Rain" || iconPhrase == "Showers" || iconPhrase == "ThunderStorms") {
return AppGlobal.rainIcon;
} else if (iconPhrase == "Hot") {
return AppGlobal.hotIcon;
} else if (iconPhrase == "Windy") {
return AppGlobal.windIcon;
} else if (iconPhrase == "Cloudy" || iconPhrase == "Mostly cloudy" || iconPhrase == "Intermittent clouds") {
return AppGlobal.cloudIcon;
} else if (iconPhrase == "Sunny" || iconPhrase == "Mostly sunny" || iconPhrase == "Partly sunny" || iconPhrase == "Hazy sunshine") {
return AppGlobal.sunnyIcon;
} else {
return AppGlobal.weatherIcon;
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['headline'] = headline;
data['maxTemp'] = maxTemp;
data['minTemp'] = minTemp;
data['iconPhrase'] = iconPhrase;
data['forecastDate'] = forecastDate;
data['cityID'] = cityID;
data['forecastDay'] = forecastDay;
data['createDateTime'] = createDateTime;
data['windSpeed'] = windSpeed;
data['windDirection'] = windDirection;
data['windDegrees'] = windDegrees;
return data;
}
@override
String toString() {
return 'WeathersWidgetModel{id: $id, headline: $headline, maxTemp: $maxTemp, minTemp: $minTemp, iconPhrase: $iconPhrase, forecastDate: $forecastDate, cityID: $cityID, forecastDay: $forecastDay, createDateTime: $createDateTime, windSpeed: $windSpeed, windDirection: $windDirection, windDegrees: $windDegrees}';
}
}

@ -0,0 +1,56 @@
class WidgetsConfigModel {
int? waitingAreaID;
String? waitingAreaName;
bool? isWeatherReq;
bool? isPrayerTimeReq;
bool? isRssFeedReq;
int? projectID;
double? projectLatitude;
double? projectLongitude;
int? cityKey;
WidgetsConfigModel({
this.waitingAreaID,
this.waitingAreaName,
this.isWeatherReq,
this.isPrayerTimeReq,
this.isRssFeedReq,
this.projectID,
this.projectLatitude,
this.projectLongitude,
this.cityKey,
});
WidgetsConfigModel.fromJson(Map<String, dynamic> json) {
waitingAreaID = json['waitingAreaID'];
waitingAreaName = json['waitingAreaName'];
// isWeatherReq = true;
// isPrayerTimeReq = true;
// isRssFeedReq = true;
isRssFeedReq = json['isRssFeedReq'];
isWeatherReq = json['isWeatherReq'];
isPrayerTimeReq = json['isPrayerTimeReq'];
projectID = json['projectID'];
projectLatitude = json['projectLatitude'];
projectLongitude = json['projectLongitude'];
cityKey = json['cityKey'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['waitingAreaID'] = waitingAreaID;
data['waitingAreaName'] = waitingAreaName;
data['isWeatherReq'] = isWeatherReq;
data['isPrayerTimeReq'] = isPrayerTimeReq;
data['projectID'] = projectID;
data['projectLatitude'] = projectLatitude;
data['projectLongitude'] = projectLongitude;
data['cityKey'] = cityKey;
return data;
}
@override
String toString() {
return 'WidgetsConfigModel{waitingAreaID: $waitingAreaID, waitingAreaName: $waitingAreaName, isWeatherReq: $isWeatherReq, isPrayerTimeReq: $isPrayerTimeReq, projectLatitude: $projectLatitude,projectLongitude: $projectLongitude, cityKey: $cityKey}';
}
}

@ -0,0 +1,104 @@
import 'package:flutter/material.dart';
import 'package:marquee/marquee.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/utils/Utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class AppFooter extends StatelessWidget {
const AppFooter({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
return Container(
color: Colors.grey.withOpacity(0.1),
height: Utils.getHeight() * 0.95,
width: double.infinity,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const SizedBox(width: 20),
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
onTap: () async {
// await context.read<AppProvider>().callPatientsAPI();
},
child: AppText(
"Powered By",
fontSize: SizeConfig.getWidthMultiplier() * 2.6,
fontFamily: 'Poppins-Medium.ttf',
),
),
Text(appProvider.currentDeviceIp,
style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getWidthMultiplier() * 2.2)),
Row(
children: [
InkWell(
onTap: () {
appProvider.updateCurrentScreenRotation(ScreenOrientationEnum.portraitUp);
},
child: const Icon(Icons.arrow_upward),
),
InkWell(
onTap: () {
appProvider.updateCurrentScreenRotation(ScreenOrientationEnum.landscapeRight);
},
child: const Icon(Icons.arrow_forward),
),
InkWell(
onTap: () {
appProvider.updateCurrentScreenRotation(ScreenOrientationEnum.portraitDown);
},
child: const Icon(Icons.arrow_downward),
),
InkWell(
onTap: () {
appProvider.updateCurrentScreenRotation(ScreenOrientationEnum.landscapeLeft);
},
child: const Icon(Icons.arrow_back),
),
],
),
],
),
const SizedBox(width: 10),
Image.asset(
"assets/images/cloud_logo.png",
height: SizeConfig.getHeightMultiplier() * 4,
),
],
),
Expanded(
child: (appProvider.currentRssFeedModel.rssFeed == null || appProvider.currentRssFeedModel.rssFeed!.isEmpty)
? const SizedBox()
: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Marquee(
text: appProvider.currentRssFeedModel.rssFeed ?? "",
style: TextStyle(fontWeight: FontWeight.w500, fontSize: SizeConfig.getHeightMultiplier() * 2),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: 20.0,
velocity: 100.0,
pauseAfterRound: const Duration(seconds: 1),
startPadding: 10.0,
accelerationDuration: const Duration(seconds: 1),
accelerationCurve: Curves.linear,
decelerationDuration: const Duration(milliseconds: 500),
decelerationCurve: Curves.easeOut,
),
),
)
],
));
});
}
}

@ -1,42 +1,111 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/utils/utils.dart'; import 'package:queuing_system/utils/utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class AppHeader extends StatelessWidget with PreferredSizeWidget { class AppHeader extends StatelessWidget implements PreferredSizeWidget {
@override const AppHeader({Key? key}) : super(key: key);
Widget build(BuildContext context) {
return Container( // Widget getWeatherWidget() {
padding: const EdgeInsets.only( // return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
left: 0, // if (appProvider.currentWeathersWidgetModel.maxTemp == null || appProvider.currentWeathersWidgetModel.minTemp == null || appProvider.currentWeathersWidgetModel.iconPhrase == null) {
right: 5, // return const SizedBox.shrink();
), // }
decoration: BoxDecoration( // return Directionality(
color: AppGlobal.appRedColor, border: const Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), // textDirection: appProvider.patientCallConfigurations.textDirection,
child: Container( // child: Row(
height: 100, // children: [
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 0,), // SvgPicture.asset(
child: Row( // appProvider.currentWeathersWidgetModel.weatherIconPath ?? AppGlobal.weatherIcon,
mainAxisAlignment: MainAxisAlignment.spaceBetween, // height: SizeConfig.getHeightMultiplier() * 2.5,
crossAxisAlignment: CrossAxisAlignment.center, // color: Colors.white,
children: [ // ),
AppText( // const SizedBox(width: 10),
" Current Serving", // Padding(
color: Colors.white, // padding: const EdgeInsets.only(top: 15),
fontFamily: 'Poppins-SemiBold.ttf', // child: AppText(
// "${appProvider.patientCallConfigurations.maxText}: ${appProvider.currentWeathersWidgetModel.maxTemp}°C , ${appProvider.patientCallConfigurations.minText}: ${appProvider.currentWeathersWidgetModel.minTemp}°C",
// color: Colors.white,
// fontSize: SizeConfig.getHeightMultiplier() * 1.3,
// ),
// ),
// ],
// ),
// );
// });
// }
//
// Widget getPrayerWidget() {
// return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
// if (appProvider.nextPrayerToShowWithTime.isEmpty) {
// return const SizedBox.shrink();
// }
// return Directionality(
// textDirection: appProvider.patientCallConfigurations.textDirection,
// // textDirection: appProvider.patientCallConfigurations.textDirection,
// child: Row(
// children: [
// SvgPicture.asset(
// AppGlobal.mosqueIcon,
// height: SizeConfig.getHeightMultiplier() * 2.5,
// color: Colors.white,
// ),
// const SizedBox(width: 10),
// Padding(
// padding: const EdgeInsets.only(top: 15),
// child: AppText(
// "${appProvider.patientCallConfigurations.nextPrayerText}: ${appProvider.nextPrayerToShowWithTime}",
// color: Colors.white,
// fontSize: SizeConfig.getHeightMultiplier() * 1.3,
// ),
// ),
// ],
// ),
// );
// });
// }
@override
Widget build(BuildContext context) {
// return SizedBox();
return Consumer(
builder: (BuildContext context, AppProvider appProvider, Widget? child) {
return Container(
height: 100,
padding: const EdgeInsets.only(left: 20, right: 20),
decoration: BoxDecoration(color: AppGlobal.vitalSignColor),
child: Directionality(
textDirection: appProvider.patientCallConfigurations.textDirection,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () async {
// await appProvider.callPatientsAPI();
},
child: AppText(
appProvider.patientCallConfigurations.currentServeText,
color: Colors.white,
),
),
// getPrayerWidget(),
// getWeatherWidget(),
SvgPicture.asset(
"assets/images/hmglogo.svg",
height: Utils.getHeight() * 0.5,
),
],
), ),
SvgPicture.asset( "assets/images/hmglogo.svg", height: Utils.getHeight() * 0.5,), ),
], );
), },
),
); );
} }
@override @override
Size get preferredSize => Size( Size get preferredSize => Size(double.maxFinite, Utils.getHeight());
double.maxFinite,
Utils.getHeight());
} }

@ -0,0 +1,581 @@
import 'dart:async';
import 'dart:developer';
import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_tts/flutter_tts.dart';
import 'package:intl/intl.dart';
import 'package:just_audio/just_audio.dart';
import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/core/response_models/patient_ticket_model.dart';
import 'package:queuing_system/core/response_models/prayers_widget_model.dart';
import 'package:queuing_system/core/response_models/rss_feed_model.dart';
import 'package:queuing_system/core/response_models/weathers_widget_model.dart';
import 'package:queuing_system/core/response_models/widgets_config_model.dart';
import 'package:queuing_system/main.dart';
import 'package:queuing_system/utils/call_by_voice.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/utils/signalR_utils.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:signalr_core/signalr_core.dart';
bool isVoiceActualCompletedGlobally = false;
class AppProvider extends ChangeNotifier {
AppProvider() {
waitForIPAndCallInitializations();
}
Future<void> waitForIPAndCallInitializations() async {
while (currentDeviceIp == "") {
await getCurrentIP();
if (currentDeviceIp != "") {
await callInitializations();
} else {
await Future.delayed(const Duration(seconds: 2));
}
}
}
Future<void> callInitializations() async {
await startSignalHubConnection();
await getInfoWidgetsDetailsFromServer();
await getLastTimeUpdatedFromCache();
listenNetworkConnectivity();
listenAudioPlayerEvents();
getTheWidgetsConfigurationsEveryMidnight();
initializeFlutterTTS();
// await callPatientsAPI();
}
SignalRHelper signalRHelper = SignalRHelper();
final AudioPlayer audioPlayer = AudioPlayer();
FlutterTts flutterTts = FlutterTts();
CallConfig patientCallConfigurations = CallConfig();
List<PatientTicketModel> patientTickets = [];
List<PatientTicketModel> isQueuePatients = [];
String currentDeviceIp = "";
bool isCallingInProgress = false;
bool isInternetConnectionAvailable = true;
bool isApiCallNeeded = false;
initializeFlutterTTS() async {
flutterTts.setCompletionHandler(() => onVoiceCompleted());
}
Future<void> onVoiceCompleted() async {
logger.i("My Value is in setCompletionHandler: $isVoiceActualCompletedGlobally");
logger.i("isQueuePatients.length in setCompletionHandler: ${isQueuePatients.length}");
if (!isVoiceActualCompletedGlobally) {
return;
}
if (isQueuePatients.isNotEmpty) {
await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(
() async {
PatientTicketModel temp = PatientTicketModel();
if (patientTickets.isNotEmpty && isQueuePatients.length > 1) {
temp = patientTickets.elementAt(0);
patientTickets.removeAt(0);
}
notifyListeners();
if (isQueuePatients.isNotEmpty) {
isQueuePatients.removeAt(0);
}
if (patientTickets.isNotEmpty && isQueuePatients.length > 1) {
patientTickets.add(temp);
}
notifyListeners();
if (isQueuePatients.isNotEmpty) {
await voiceCallPatientTicket(patientTickets.first, "setCompletionHandler");
updatePatientTicket(patientTickets.first);
}
},
);
}
logger.i("here logger.ig: ${isQueuePatients.length}");
if (isQueuePatients.isEmpty) {
isCallingInProgress = false;
}
if (isApiCallNeeded && isQueuePatients.isEmpty) {
logger.i("Setting isCallingInProgress : $isCallingInProgress");
Timer(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec), () async {
await callPatientsAPI();
isApiCallNeeded = false;
});
}
}
updateInternetConnection(bool value) {
isInternetConnectionAvailable = value;
notifyListeners();
}
ScreenOrientationEnum currentScreenRotation = ScreenOrientationEnum.portraitUp;
updateCurrentScreenRotation(ScreenOrientationEnum value) {
currentScreenRotation = value;
notifyListeners();
}
Future<void> getCurrentIP() async {
final ips = await NetworkInterface.list(type: InternetAddressType.IPv4);
for (var interface in ips) {
if (interface.name == "eth0") {
for (var address in interface.addresses) {
currentDeviceIp = address.address;
notifyListeners();
}
}
if (interface.name == "wlan0") {
for (var address in interface.addresses) {
currentDeviceIp = address.address;
notifyListeners();
}
}
}
}
WidgetsConfigModel? currentWidgetsConfigModel;
Future<void> getInfoWidgetsConfigurationsFromServer() async {
log(" errorHellpo:");
WidgetsConfigModel? widgetsConfigModel = await API.getWidgetConfigsFromServer(currentDeviceIp, onFailure: (error) {
logger.i("Api call failed with this error: ${error.toString()}");
});
if (widgetsConfigModel != null) currentWidgetsConfigModel = widgetsConfigModel;
notifyListeners();
}
WeathersWidgetModel currentWeathersWidgetModel = WeathersWidgetModel();
Future<void> getWeatherDetailsFromServer() async {
WeathersWidgetModel? weathersWidgetModel = await API.getWeatherDetailsFromServer(
(currentWidgetsConfigModel!.cityKey ?? "").toString(),
onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}"),
);
if (weathersWidgetModel != null) {
currentWeathersWidgetModel = weathersWidgetModel;
notifyListeners();
}
}
String nextPrayerToShowWithTime = '';
void getNextPrayerToShow() {
final current = DateTime.now();
logger.i("Checking Namaz time Locally at ${current.toString()} and ${current.timeZoneName} ");
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.fajr!));
nextPrayerToShowWithTime = "${patientCallConfigurations.fajrText} at $namazTime";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.dhuhr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.dhuhr!));
nextPrayerToShowWithTime = "${patientCallConfigurations.dhuhrText} at $namazTime";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.asr!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.asr!));
nextPrayerToShowWithTime = "${patientCallConfigurations.asrText} at $namazTime";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.maghrib!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.maghrib!));
nextPrayerToShowWithTime = "${patientCallConfigurations.maghribText} at $namazTime";
notifyListeners();
return;
}
if (DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.isha!).isAfter(current)) {
final namazTime = DateFormat('hh:mm a').format(DateTime.fromMillisecondsSinceEpoch(currentPrayersWidgetModel.isha!));
nextPrayerToShowWithTime = "${patientCallConfigurations.ishaText} at $namazTime";
notifyListeners();
return;
}
}
PrayersWidgetModel currentPrayersWidgetModel = PrayersWidgetModel();
Future<void> getPrayerDetailsFromServer() async {
PrayersWidgetModel? prayersWidgetModel = await API.getPrayerDetailsFromServer(
latitude: currentWidgetsConfigModel!.projectLatitude ?? 0,
longitude: currentWidgetsConfigModel!.projectLongitude ?? 0,
onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}"));
if (prayersWidgetModel != null) {
currentPrayersWidgetModel = prayersWidgetModel;
logger.i("I got this data from Prayers: ${prayersWidgetModel.toString()}");
getNextPrayerToShow();
notifyListeners();
}
}
RssFeedModel currentRssFeedModel = RssFeedModel();
Future<void> getRssFeedDetailsFromServer() async {
RssFeedModel? rssFeedModel = await API.getRssFeedDetailsFromServer(languageId: 0, onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}"));
if (rssFeedModel != null) {
currentRssFeedModel = rssFeedModel;
logger.i("I got this data from RssFeed: ${currentRssFeedModel.rssFeed}");
notifyListeners();
}
}
Future<void> getInfoWidgetsDetailsFromServer() async {
// if (currentWidgetsConfigModel == null) return;
await getInfoWidgetsConfigurationsFromServer().whenComplete(() async {
if (currentWidgetsConfigModel == null) {
return;
}
if (currentWidgetsConfigModel!.isWeatherReq != null && currentWidgetsConfigModel!.isWeatherReq!) {
await getWeatherDetailsFromServer();
}
if (currentWidgetsConfigModel!.isPrayerTimeReq != null && currentWidgetsConfigModel!.isPrayerTimeReq!) {
await getPrayerDetailsFromServer();
}
if (currentWidgetsConfigModel!.isRssFeedReq != null && currentWidgetsConfigModel!.isRssFeedReq!) {
await getRssFeedDetailsFromServer();
}
});
int currentDate = DateTime.now().millisecondsSinceEpoch;
await setLastTimeUpdatedInCache(lasTimeUpdated: currentDate.toString());
}
int counter = 0;
Future<void> getTheWidgetsConfigurationsEveryMidnight() async {
if (currentWidgetsConfigModel == null) return;
if (!(currentWidgetsConfigModel!.isWeatherReq ?? false) && !(currentWidgetsConfigModel!.isPrayerTimeReq ?? false) && !(currentWidgetsConfigModel!.isRssFeedReq ?? false)) {
return;
}
if (!currentWidgetsConfigModel!.isWeatherReq! && !currentWidgetsConfigModel!.isPrayerTimeReq! && !currentWidgetsConfigModel!.isRssFeedReq!) {
return;
}
DateTime current = DateTime.now();
Stream timer = Stream.periodic(const Duration(minutes: 1), (i) {
current = current.add(const Duration(minutes: 1));
return current;
});
timer.listen((data) async {
DateTime dateTime = DateTime.parse(data.toString());
counter++;
logger.i("counterValue: $counter");
if (counter == 60 && currentWidgetsConfigModel!.isRssFeedReq!) {
await getRssFeedDetailsFromServer();
}
if (currentWidgetsConfigModel!.isWeatherReq!) {
if (dateTime.day > currentLastTimeUpdated.day) {
await getWeatherDetailsFromServer();
}
}
if (currentWidgetsConfigModel!.isPrayerTimeReq!) {
if (dateTime.day > currentLastTimeUpdated.day) {
await getPrayerDetailsFromServer();
}
}
if (currentWidgetsConfigModel!.isRssFeedReq!) {
if (dateTime.day > currentLastTimeUpdated.day) {
await getRssFeedDetailsFromServer();
}
}
getNextPrayerToShow();
});
}
Future<void> startSignalHubConnection() async {
if (!signalRHelper.getConnectionState()) {
await getCurrentIP().whenComplete(() => signalRHelper.startSignalRConnection(
currentDeviceIp,
onUpdateAvailable: onPingReceived,
onConnect: onConnect,
onConnecting: onConnecting,
onDisconnect: onDisconnect,
));
}
}
Future<void> callPatientsAPI() async {
logger.i("calling callPatientsAPI");
patientTickets.clear();
API.getCallRequestInfoByClinicInfo(currentDeviceIp,
onSuccess: (waitingCalls, isQueuePatientsCalls, callConfigs) async {
patientCallConfigurations = callConfigs;
if (waitingCalls.length > patientCallConfigurations.screenMaxDisplayPatients) {
patientTickets = waitingCalls.sublist(0, patientCallConfigurations.screenMaxDisplayPatients);
} else {
patientTickets = waitingCalls;
}
if (isQueuePatientsCalls.length > patientCallConfigurations.screenMaxDisplayPatients) {
isQueuePatients = isQueuePatientsCalls.sublist(0, patientCallConfigurations.screenMaxDisplayPatients);
} else {
isQueuePatients = isQueuePatientsCalls;
}
notifyListeners();
if (patientTickets.isNotEmpty) {
updateCurrentScreenRotation(patientTickets.first.screenRotationEnum);
await voiceCallPatientTicket(patientTickets.first, "callPatientsAPI");
updatePatientTicket(patientTickets.first);
}
},
onFailure: (error) => logger.i("Api call failed with this error: ${error.toString()}"));
}
onPingReceived(data) async {
logger.i("A new Ping Received when isQueuePatients: ${isQueuePatients.length}");
logger.i("isCallingInProgress from onPingReceived: $isCallingInProgress");
logger.i("isApiCallNeeded: $isApiCallNeeded");
if (patientTickets.isNotEmpty) {
if (isCallingInProgress) {
isApiCallNeeded = true;
} else {
await callPatientsAPI();
}
} else {
await callPatientsAPI();
}
}
String getCallTypeText(PatientTicketModel ticket) {
final callType = ticket.getCallType();
switch (callType) {
case CallType.vitalSign:
return ticket.callForVitalSignText;
case CallType.doctor:
return ticket.callForDoctorText;
case CallType.procedure:
return ticket.callForProcedureText;
case CallType.vaccination:
return ticket.callForVaccinationText;
case CallType.nebulization:
return ticket.callForNebulizationText;
default:
return ticket.callForVitalSignText;
}
}
CallByVoice? voiceCaller;
PatientTicketModel currentPatient = PatientTicketModel();
// testCalling() async {
// voiceCaller = CallByVoice(
// preVoice: "رقم التذكرة",
// ticketNo: "AMG A-78",
// postVoice: "دعوة للتطعيم",
// lang: "ar",
// flutterTts: flutterTts,
// );
// await voiceCaller!.startCalling(true);
// }
voiceCallPatientTicket(PatientTicketModel patientTicket, String calledFrom) async {
logger.i("voiceCallPatientTicket calledFrom : $calledFrom");
currentPatient = patientTicket;
isCallingInProgress = true;
logger.i("Setting isCallingInProgress : $isCallingInProgress");
logger.i("isVoiceReq: ${patientTicket.isVoiceReq}");
logger.i("voiceCaller: ${voiceCaller == null}");
logger.i("isQueue: ${patientTicket.isQueue}");
logger.i("isToneReq: ${patientTicket.isToneReq}");
if (patientTicket.isToneReq && !patientTicket.isQueue) {
audioPlayer.setAsset("assets/tones/call_tone.mp3");
await audioPlayer.play();
await Future.delayed(const Duration(seconds: 2));
}
if (patientTicket.isVoiceReq && voiceCaller == null && !patientTicket.isQueue) {
logger.i("patientTicket.voiceLanguage: ${patientTicket.voiceLanguage}");
final postVoice = getCallTypeText(patientTicket);
voiceCaller = CallByVoice(
preVoice: patientTicket.ticketNoText,
ticketNo: patientTicket.queueNo.trim().toString(),
postVoice: postVoice,
lang: patientTicket.voiceLanguage == 1 ? "en" : "ar",
flutterTts: flutterTts,
);
await voiceCaller!.startCalling(patientTicket.queueNo.trim().toString() != patientTicket.callNoStr.trim().toString()).whenComplete(() {
voiceCaller = null;
onVoiceCompleted();
logger.i("Completed Calling!! ${isQueuePatients.length}");
});
} else {
isCallingInProgress = false;
logger.i("Setting isCallingInProgress : $isCallingInProgress");
if (isApiCallNeeded) {
Timer(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec), () async {
await callPatientsAPI();
isApiCallNeeded = false;
});
}
}
}
Future<void> listenAudioPlayerEvents() async {
audioPlayer.playerStateStream.listen((playerState) async {
if (playerState.processingState == ProcessingState.completed) {
logger.i("Tone Completed");
if (currentPatient.isVoiceReq) {
isCallingInProgress = true;
return;
}
if (isQueuePatients.isNotEmpty) {
isCallingInProgress = true;
logger.i("isQueuePatients.length 1: ${isQueuePatients.length}");
// for (int i = 0; i < length; i++) {
await Future.delayed(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec)).whenComplete(() async {
PatientTicketModel temp = PatientTicketModel();
if (patientTickets.isNotEmpty && isQueuePatients.length > 1) {
temp = patientTickets.elementAt(0);
patientTickets.removeAt(0);
}
notifyListeners();
if (isQueuePatients.isNotEmpty) {
isQueuePatients.removeAt(0);
}
if (patientTickets.isNotEmpty && isQueuePatients.length > 1) {
patientTickets.add(temp);
}
notifyListeners();
logger.i("isQueuePatients.length 2: ${isQueuePatients.length}");
if (isQueuePatients.isNotEmpty) {
await voiceCallPatientTicket(patientTickets.first, "listenAudioPlayerEvents");
updatePatientTicket(patientTickets.first);
}
});
// }
}
if (isQueuePatients.isEmpty) {
isCallingInProgress = false;
}
if (isApiCallNeeded && isQueuePatients.isEmpty) {
logger.i("Setting isCallingInProgress : $isCallingInProgress");
Timer(Duration(seconds: patientCallConfigurations.concurrentCallDelaySec), () async {
await callPatientsAPI();
isApiCallNeeded = false;
});
}
}
});
}
// updatePatientTickets() {
// if (patientTickets.isNotEmpty) {
// List<Tickets> _ticketsToUpdate = patientTickets.where((t) => t.callUpdated == false).toList();
// API.callUpdateNotIsQueueRecordByIDAsync(currentDeviceIp, ticket: _ticketsToUpdate.first, onSuccess: (ticketsUpdated) {
// logger.i("[${ticketsUpdated.length}] Tickets Updated: $ticketsUpdated");
// }, onFailure: (e) {
// logger.i(" Tickets Update Failed with : ${e.toString()}");
// });
// }
// }
updatePatientTicket(PatientTicketModel patientTicket) {
if (!patientTicket.isQueue) {
API.callUpdateNotIsQueueRecordByIDAsync(currentDeviceIp, ticket: patientTicket, onSuccess: (ticketsUpdated) {
logger.i("[${patientTicket.callNoStr}] Ticket Updated: $ticketsUpdated");
}, onFailure: (e) {
logger.i(" Tickets Update ${patientTicket.callNoStr} Failed with Error : ${e.toString()}");
});
}
}
onConnect() {
logger.i("SignalR: onConnect");
}
onDisconnect(exception) {
logger.i("SignalR: onDisconnect");
signalRHelper.startSignalRConnection(
currentDeviceIp,
onUpdateAvailable: onPingReceived,
onConnect: onConnect,
onConnecting: onConnecting,
onDisconnect: onDisconnect,
);
}
onConnecting() {
logger.i("SignalR: onConnecting");
}
listenNetworkConnectivity() async {
Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> event) async {
switch (event.first) {
case ConnectivityResult.wifi:
case ConnectivityResult.ethernet:
updateInternetConnection(true);
await getCurrentIP();
if (signalRHelper.connection != null) {
if (signalRHelper.connection!.state != HubConnectionState.connected) signalRHelper.connection!.start();
}
break;
case ConnectivityResult.none:
updateInternetConnection(false);
signalRHelper.closeConnection();
break;
case ConnectivityResult.mobile:
break;
case ConnectivityResult.bluetooth:
// TODO: Handle this case.
break;
// TODO: Handle this case.
case ConnectivityResult.vpn:
// TODO: Handle this case.
break;
case ConnectivityResult.other:
// TODO: Handle this case.
break;
}
});
}
//SHARED PREFERENCE HANDLING
DateTime currentLastTimeUpdated = DateTime.now();
Future<String?> getLastTimeUpdatedFromCache() async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
if (prefs.containsKey("lastTimeUpdated")) {
String? lastTimeUpdated = prefs.getString("lastTimeUpdated");
currentLastTimeUpdated = DateTime.fromMillisecondsSinceEpoch(int.parse(lastTimeUpdated!));
return lastTimeUpdated;
} else {
return null;
}
}
Future<void> setLastTimeUpdatedInCache({required String lasTimeUpdated}) async {
final SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString("lastTimeUpdated", lasTimeUpdated);
}
}

@ -1,32 +0,0 @@
import 'package:flutter/material.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/home/que_item/que_item.dart';
class FirstColumn extends StatelessWidget {
final bool have3Patient;
final bool have2Patient;
const FirstColumn({Key key, this.have3Patient = false, this.have2Patient = false}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
const TicketItem(queNo: "OBG-T45", isFirstLine: true, isNurseVisit: true, haveListOfPatient: true,),
SizedBox(
height: SizeConfig.getHeightMultiplier() * 5,),
if(have3Patient ||have2Patient )
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
if(have2Patient || have3Patient)
const TicketItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: false, haveListOfPatient: true,),
if(have3Patient)
const TicketItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: true, haveListOfPatient: true,),
],
),
],
);
}
}

@ -1,195 +1,174 @@
import 'dart:async'; import 'dart:developer';
import 'dart:io';
import 'package:connectivity/connectivity.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:queuing_system/core/api.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/base/app_scaffold_widget.dart'; import 'package:queuing_system/core/base/app_scaffold_widget.dart';
import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_model/patient_call.dart'; import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/footer/app_footer.dart';
import 'package:queuing_system/header/app_header.dart'; import 'package:queuing_system/header/app_header.dart';
import 'package:queuing_system/home/home_screen_components.dart'; import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/home/que_item_list.dart'; import 'package:queuing_system/home/priority_calls_components.dart';
import 'package:queuing_system/utils/call_by_voice.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/utils/signalR_utils.dart';
import 'package:queuing_system/utils/utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
import 'package:signalr_core/signalr_core.dart';
import 'package:text_to_speech/text_to_speech.dart';
import 'first_column.dart';
var DEVICE_IP = "10.20.20.19"; // Testing IP
// var DEVICE_IP = "10.70.249.21"; // (Make sure by Haroon before use it) Production IP
class MyHomePage extends StatefulWidget {
String title = "MyHomePage";
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
SignalRHelper signalRHelper = SignalRHelper();
final _tts = TextToSpeech(); class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
List<Tickets> waitings = []; getWeatherWidget() {
List<Tickets> currents = []; return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
if (appProvider.currentWeathersWidgetModel.maxTemp == null || appProvider.currentWeathersWidgetModel.minTemp == null || appProvider.currentWeathersWidgetModel.iconPhrase == null) {
@override return const SizedBox.shrink();
void dispose() { }
super.dispose(); return Container(
height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? SizeConfig.getHeightMultiplier() * 8 : SizeConfig.getHeightMultiplier() * 5,
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
decoration: AppGlobal.configWidgetDecoration,
child: Directionality(
textDirection: appProvider.patientCallConfigurations.textDirection,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
appProvider.patientCallConfigurations.weatherText,
color: Colors.grey,
fontSize: SizeConfig.getWidthMultiplier() * 1.5,
),
AppText(
// "Max: 40C , Min: 38C",
"${appProvider.patientCallConfigurations.maxText}: ${appProvider.currentWeathersWidgetModel.maxTemp}°C , ${appProvider.patientCallConfigurations.minText}: ${appProvider.currentWeathersWidgetModel.minTemp}°C",
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
fontHeight: 1,
),
],
),
const SizedBox(width: 15),
SvgPicture.asset(
appProvider.currentWeathersWidgetModel.weatherIconPath ?? AppGlobal.weatherIcon,
height: SizeConfig.getHeightMultiplier() * 3,
),
],
),
),
);
});
} }
getPrayerWidget() {
@override return Consumer(builder: (BuildContext context, AppProvider appProvider, Widget? child) {
void initState() { if (appProvider.nextPrayerToShowWithTime.isEmpty) {
listenNetworkConnectivity(); return const SizedBox.shrink();
}
if (!signalRHelper.getConnectionState()) { return Container(
signalRHelper.startSignalRConnection( height: (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? SizeConfig.getHeightMultiplier() * 8 : SizeConfig.getHeightMultiplier() * 5,
DEVICE_IP, padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
onUpdateAvailable: onUpdateAvailable, decoration: AppGlobal.configWidgetDecoration,
onConnect: onConnect, child: Directionality(
onConnecting: onConnecting, textDirection: appProvider.patientCallConfigurations.textDirection,
onDisconnect: onDisconnect child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
appProvider.patientCallConfigurations.nextPrayerText,
color: Colors.grey,
fontSize: SizeConfig.getWidthMultiplier() * 1.5,
),
AppText(
appProvider.nextPrayerToShowWithTime,
fontSize: SizeConfig.getHeightMultiplier() * 1.3,
fontHeight: 1,
),
],
),
const SizedBox(width: 15),
SvgPicture.asset(
AppGlobal.mosqueIcon,
height: SizeConfig.getHeightMultiplier() * 3,
),
],
),
),
); );
}
_tts.setLanguage("en");
_tts.setRate(0.7);
// _tts.getVoiceByLang('en').then((value){
//
// })
_tts.getVoice().then((value){
_tts.setVoice(value[2]);
}); });
}
super.initState(); getBody(AppProvider appProvider, context) {
return Column(
children: [
const SizedBox(height: 12),
Expanded(
flex: 1,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Row(
children: [
getWeatherWidget(),
const SizedBox(width: 35),
getPrayerWidget(),
],
),
)),
const SizedBox(height: 20),
Expanded(
flex: 9,
child: dataContent(appProvider: appProvider, context: context),
),
],
);
}
int getTurnsByOrientation(ScreenOrientationEnum screenOrientationEnum) {
switch (screenOrientationEnum) {
case ScreenOrientationEnum.portraitUp:
return 0;
case ScreenOrientationEnum.portraitDown:
return 2;
case ScreenOrientationEnum.landscapeRight:
return 1;
case ScreenOrientationEnum.landscapeLeft:
return 3;
default:
return 0;
}
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = context.watch<AppProvider>();
return AppScaffold( log(appProvider.currentScreenRotation.toString());
appBar: AppHeader(), // appProvider.isCallingInProgress = false;
body: content(), return RotatedBox(
bottomNavigationBar: Container( // quarterTurns: 3,
color: Colors.grey.withOpacity(0.1), quarterTurns: getTurnsByOrientation(appProvider.currentScreenRotation),
height: Utils.getHeight(), child: AppScaffold(
width: double.infinity, appProvider: appProvider,
child: Row( appBar: const AppHeader(),
crossAxisAlignment: CrossAxisAlignment.center, body: getBody(appProvider, context),
children: [ bottomNavigationBar: const AppFooter(),
const SizedBox(width: 20),
AppText(
"Powered By",
fontSize: SizeConfig.getWidthMultiplier() * 2.6,
fontFamily: 'Poppins-Medium.ttf',
),
const SizedBox(width: 20),
Image.asset(
"assets/images/cloud_logo.png",
height: SizeConfig.getHeightMultiplier() * 4,
),
const SizedBox(width: 20),
],
),
), ),
); );
} }
Widget content(){ Widget dataContent({required AppProvider appProvider, required BuildContext context}) {
// waitings = waitings.sublist(0,3); log("isCallingInProgress from HomeScreen: ${appProvider.isCallingInProgress}");
voiceCall(); // appProvider.voiceCallPatientTicket(appProvider.patientTickets.first);
// appProvider.testCalling();
if(waitings.isEmpty) { if (appProvider.patientTickets.isEmpty) {
// No Patient in Queue // No Patient in Queue
return noPatientInQueue(); return noPatientInQueue(screenOrientationEnum: appProvider.currentScreenRotation);
} else if (appProvider.patientTickets.length > 3) {
}else if(waitings.length > 4){
// Return Content With Side List // Return Content With Side List
return priorityTicketsWithSideList(waitings); return priorityTicketsWithSideList(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations, context: context);
} else {
}else{
// Return Content In Center Aligned // Return Content In Center Aligned
return priorityTickets(waitings); return PriorityTickets(tickets: appProvider.patientTickets, callConfig: appProvider.patientCallConfigurations);
}
}
CallByVoice voiceCaller;
voiceCall() async{
if(waitings.isNotEmpty && voiceCaller == null){
final postVoice = waitings.first.getCallType().audio('en');
voiceCaller = CallByVoice(waitings.first.callNo.toString(), preVoice: 'ticket_number.mp3', postVoice: postVoice, lang: 'en');
await voiceCaller.start();
voiceCaller = null;
} }
} }
onUpdateAvailable(data) async{
API.GetCallRequestInfoByClinincInfo(
DEVICE_IP,
onSuccess: (waitingCalls, currentInClinic){
setState(() {
waitings = waitingCalls;
currents = currentInClinic;
});
print("\n\n");
print("--------------------");
print("Current: $currentInClinic");
print("Waiting: $waitingCalls");
print("--------------------");
print("\n\n");
updateTickets();
}, onFailure: (error){
});
}
updateTickets(){
// List<Tickets> _ticketsToUpdate = waitings.where((t) => t.call_updated == false);
// API.Call_UpdateNotIsQueueRecordByIDAsync(DEVICE_IP, tickets: _ticketsToUpdate, onSuccess: (tickets_updated){
// print("[${tickets_updated.length}] Tickets Updated: $tickets_updated");
// }, onFailure: (e){
//
// });
}
onConnect(){
print("SignalR: onConnect");
}
onDisconnect(exception){
print("SignalR: onDisconnect");
}
onConnecting(){
print("SignalR: onConnecting");
}
listenNetworkConnectivity() async{
Connectivity().onConnectivityChanged.listen((event) {
switch (event) {
case ConnectivityResult.wifi:
signalRHelper.connection.start();
break;
case ConnectivityResult.none:
signalRHelper.closeConnection(context);
break;
}
});
}
} }

@ -1,205 +0,0 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/core/base/app_scaffold_widget.dart';
import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/header/app_header.dart';
import 'package:queuing_system/home/que_item_list.dart';
import 'package:queuing_system/utils/signalR_utils.dart';
import 'package:queuing_system/utils/utils.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
import 'first_column.dart';
var DEVICE_IP = "10.70.249.21";
class MyHomePage extends StatefulWidget {
String title = "MyHomePage";
bool have0Patient = true;
bool have1Patient = false;
bool have2Patient = false;
bool have3Patient = false;
bool haveListOfPatient = false;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
Timer _timer;
int remainingTime = 30;
@override
void dispose() {
_timer.cancel();
super.dispose();
}
startTimer() {
Timer.periodic(const Duration(seconds: 1), (timer) {
if (remainingTime == 0) {
setState(() {
remainingTime = 30;
});
} else {
setState(() {
remainingTime--;
if (remainingTime > 25) {
/// for 0 patinet
widget.have0Patient = true;
widget.have1Patient = false;
widget.have2Patient = false;
widget.have3Patient = false;
widget.haveListOfPatient = false;
} else if (remainingTime > 20) {
/// for 1 patinet
widget.have0Patient = false;
widget.have1Patient = true;
widget.have2Patient = false;
widget.have3Patient = false;
widget.haveListOfPatient = false;
} else if (remainingTime > 15) {
/// for 2 patinet
widget.have0Patient = false;
widget.have1Patient = false;
widget.have2Patient = true;
widget.have3Patient = false;
widget.haveListOfPatient = false;
} else if (remainingTime > 10) {
/// for 3 only patinet
widget.have0Patient = false;
widget.have1Patient = false;
widget.have2Patient = false;
widget.have3Patient = true;
widget.haveListOfPatient = false;
} else {
/// for 3+ only patinet
widget.have0Patient = false;
widget.have1Patient = false;
widget.have2Patient = false;
widget.have3Patient = true;
widget.haveListOfPatient = true;
}
});
}
});
}
@override
void initState() {
startTimer();
// Get Ticket Info
// http://10.200.204.11:2222/Services/Nurses.svc/REST/GetCallRequestInfoByClinincInfo
SignalRHelper signalRHelper = SignalRHelper();
if (!signalRHelper.getConnectionState()) {
signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBar: AppHeader(),
body: Column(
children: [
SizedBox(
height: SizeConfig.getHeightMultiplier() *
(widget.haveListOfPatient
? 2
: widget.have1Patient || widget.have0Patient
? 20
: 10)),
widget.have0Patient
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: AppText("Awaiting Patients Arrival",
fontFamily: 'Poppins-SemiBold.ttf',
fontSize: SizeConfig.getWidthMultiplier() * 9),
),
],
)
: widget.haveListOfPatient
? Row(
children: [
FirstColumn(
have3Patient: widget.have3Patient,
have2Patient: widget.have2Patient,
),
const SizedBox(
width: 40,
),
if (widget.haveListOfPatient)
Container(
width: 10,
height: SizeConfig.getHeightMultiplier() * 40,
color: AppGlobal.appLightGreyColor,
),
if (widget.haveListOfPatient)
const SizedBox(
width: 40,
),
if (widget.haveListOfPatient) const QueItemList()
],
)
: FirstColumn(
have3Patient: widget.have3Patient,
have2Patient: widget.have2Patient,
),
],
),
bottomSheet: Container(
color: Colors.transparent,
height: Utils.getHeight(),
width: double.infinity,
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(top: 30, left: 30),
child: AppText(
"Powered By",
fontSize: SizeConfig.getWidthMultiplier() * 2.6,
fontFamily: 'Poppins-Medium.ttf',
),
),
Padding(
padding: const EdgeInsets.only(top: 40, left: 18),
child: Image.asset(
"assets/images/cloud_logo.png",
height: SizeConfig.getHeightMultiplier() * 6,
),
),
],
),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
onUpdateAvailable(data) async{
API.GetCallRequestInfoByClinincInfo(
DEVICE_IP,
onSuccess: (waitingCalls, currentInClinic){
print("\n\n");
print("--------------------");
print("Current: $currentInClinic");
print("Waiting: $waitingCalls");
print("--------------------");
print("\n\n");
}, onFailure: (error){
});
}
}

@ -1,88 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_model/patient_call.dart';
import 'package:queuing_system/home/priority_calls.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
Widget noPatientInQueue(){
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: AppText("Awaiting Patients Arrival",
fontFamily: 'Poppins-SemiBold.ttf',
fontSize: SizeConfig.getWidthMultiplier() * 9),
),
],
);
}
Widget priorityTickets(List<Tickets> tickets){
return PriorityTickets(tickets);
}
Widget priorityTicketsWithSideList(List<Tickets> tickets){
final priorityTickets = tickets.sublist(0,3);
final otherTickets = tickets.sublist(3,tickets.length);
return Row(
children: [
Expanded(
flex: 3,
child: PriorityTickets(priorityTickets)
),
Container(color: Colors.grey.withOpacity(0.1), width: 10, margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 50)),
Expanded(
flex: 2,
child: ListView.builder(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 50),
itemCount: otherTickets.length,
itemBuilder: (ctx,idx){
final itm = otherTickets[idx];
return ListTile(
contentPadding: const EdgeInsets.all(8),
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 140,
child: AppText(
itm.callNo.toString(),
letterSpacing: -2.32,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 5,
textAlign: TextAlign.end,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
itm.getCallType().icon(SizeConfig.getHeightMultiplier()*2.5),
const SizedBox(width: 10),
AppText(
itm.getCallType().message('en'),
color: itm.getCallType().color(),
letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
)
],
),
);
},
),
)
],
);
}

@ -1,101 +0,0 @@
import 'package:blinking_text/blinking_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_model/patient_call.dart';
import 'package:queuing_system/home/que_item/que_item.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class PriorityTickets extends StatelessWidget {
List<Tickets> tickets;
PriorityTickets(this.tickets, {Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final firstTicket = tickets[0];
final otherTickets = tickets.sublist(1,tickets.length);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
vTicketItem(ticketNo: "${firstTicket.callNo ?? ''}", callType: firstTicket.getCallType(), scale: 1.2, blink: true),
const SizedBox(height: 100),
if(tickets.length > 1)
...[
SizedBox(height: SizeConfig.getHeightMultiplier()*1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: otherTickets.map((ticket) => vTicketItem(ticketNo: "${ticket.callNo ?? ''}", callType: ticket.getCallType(), scale: 0.8)).toList(),
)
]
],
);
}
}
class vTicketItem extends StatelessWidget{
final String ticketNo;
final CallType callType;
final bool blink;
final double scale;
vTicketItem({@required this.ticketNo, @required this.callType, this.scale, this.blink = false});
@override
Widget build(BuildContext context) {
return Transform.scale(
scale: scale,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
BlinkText(
ticketNo,
style: TextStyle(
fontSize: SizeConfig.getWidthMultiplier() * 16,
letterSpacing: -9.32,
height: 0.5,
fontWeight: FontWeight.bold
),
beginColor: Colors.black,
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
// endColor: blink ? AppGlobal.appRedColor : Colors.black,
times: 0,
duration: const Duration(seconds: 1)
),
// AppText(
// ticketNo,
// letterSpacing: -9.32,
// fontSize: SizeConfig.getWidthMultiplier() * 16,
// fontWeight: FontWeight.bold,
// fontHeight: 0.7,
// ),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
callType.icon(SizeConfig.getHeightMultiplier()*2.5),
const SizedBox(width: 10),
AppText(
callType.message('en'),
color: callType.color(),
letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
),
],
),
);
}
}

@ -0,0 +1,360 @@
import 'dart:developer';
import 'package:blinking_text/blinking_text.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
import 'package:queuing_system/core/response_models/patient_ticket_model.dart';
import 'package:queuing_system/home/app_provider.dart';
import 'package:queuing_system/utils/call_type.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class PriorityTickets extends StatelessWidget {
final List<PatientTicketModel> tickets;
final CallConfig callConfig;
const PriorityTickets({required this.tickets, required this.callConfig, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final firstTicket = tickets[0];
final otherTickets = tickets.sublist(1, tickets.length);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 50),
TicketItem(
ticketNo: firstTicket.queueNo ?? '',
callType: firstTicket.getCallType(),
scale: 1.2,
blink: true,
roomNo: firstTicket.roomNo,
isClinicAdded: firstTicket.callNoStr != firstTicket.queueNo,
callConfig: callConfig,
),
const SizedBox(height: 50),
if (tickets.length > 1) ...[
SizedBox(height: SizeConfig.getHeightMultiplier() * 1.8),
Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: otherTickets
.map((ticket) => Padding(
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2),
child: TicketItem(
ticketNo: ticket.queueNo ?? '',
callType: ticket.getCallType(),
scale: 0.8,
roomNo: ticket.roomNo,
isClinicAdded: ticket.callNoStr != ticket.queueNo,
callConfig: callConfig,
),
))
.toList(),
)
]
],
);
}
}
class TicketItem extends StatelessWidget {
final String ticketNo;
final String roomNo;
final CallType callType;
final bool blink;
final double scale;
final bool isClinicAdded;
final CallConfig callConfig;
const TicketItem({
Key? key,
required this.isClinicAdded,
required this.ticketNo,
required this.roomNo,
required this.callType,
required this.callConfig,
required this.scale,
this.blink = false,
}) : super(key: key);
String getFormattedTicket(String ticketNo, bool isClinicAdded) {
if (isClinicAdded) {
var formattedString = ticketNo.split(" ");
return formattedString[0] + " " + formattedString[1];
}
return ticketNo;
}
@override
Widget build(BuildContext context) {
return Transform.scale(
scale: scale,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
BlinkText(getFormattedTicket(ticketNo, isClinicAdded),
style: TextStyle(
fontSize: SizeConfig.getWidthMultiplier() * 10,
letterSpacing: -1,
height: 0.5,
fontWeight: FontWeight.bold,
),
beginColor: Colors.black,
endColor: blink ? Colors.black.withOpacity(0.1) : Colors.black,
// endColor: blink ? AppGlobal.appRedColor : Colors.black,
times: 0,
duration: const Duration(seconds: 1)),
const SizedBox(height: 13),
Directionality(
textDirection: callConfig.textDirection,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.only(bottom: callType == CallType.vitalSign ? 0 : 8),
child: callType.icon(SizeConfig.getHeightMultiplier() * 3),
),
const SizedBox(width: 13),
AppText(
callType.message(callConfig),
color: callType.color(),
letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600,
fontHeight: 1,
),
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
),
AppText(
callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: $roomNo" : " $roomNo : ${callConfig.roomText}",
color: callType.color(),
letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
fontWeight: FontWeight.w600,
fontHeight: 1,
),
],
),
),
],
),
);
}
}
Widget noPatientInQueue({required ScreenOrientationEnum screenOrientationEnum}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: AppText(
"Awaiting Patients Arrival",
fontFamily: 'Poppins-SemiBold.ttf',
fontSize: (screenOrientationEnum == ScreenOrientationEnum.portraitDown || screenOrientationEnum == ScreenOrientationEnum.portraitUp) ? SizeConfig.getWidthMultiplier() * 9 : SizeConfig.getWidthMultiplier() * 7,
),
),
],
);
}
Widget qamarsBirthdayWidget() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText("Happy Birthday", fontFamily: 'Poppins-SemiBold.ttf', fontSize: SizeConfig.getWidthMultiplier() * 15),
Center(
child: AppText("Syed Qamar 🎉", fontFamily: 'Poppins-SemiBold.ttf', fontSize: SizeConfig.getWidthMultiplier() * 11),
),
],
);
}
Widget priorityTicketsWithSideList({required List<PatientTicketModel> tickets, required CallConfig callConfig, required BuildContext context}) {
final priorityTickets = tickets.sublist(0, 3);
final otherTickets = tickets.sublist(3, tickets.length);
final AppProvider appProvider = context.watch<AppProvider>();
log("appProvider.currentScreenRotation: ${appProvider.currentScreenRotation}");
final List<Widget> children = [
Expanded(flex: 7, child: PriorityTickets(callConfig: callConfig, tickets: priorityTickets)),
Container(color: Colors.grey.withOpacity(0.1), width: 10, margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 50)),
Expanded(
flex: 6,
child: ListView(
children: [
Padding(
padding: EdgeInsets.fromLTRB(10, SizeConfig.getHeightMultiplier() * 3.3, 10, 10),
child: Directionality(
textDirection: callConfig.textDirection,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
callConfig.queueNoText,
letterSpacing: -2,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
callConfig.callForText,
letterSpacing: -2,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
callConfig.roomText,
letterSpacing: -2,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
textAlign: TextAlign.center,
),
],
),
),
],
),
),
),
ListView.builder(
shrinkWrap: true,
itemCount: otherTickets.length,
itemBuilder: (ctx, idx) {
final itm = otherTickets[idx];
return Padding(
padding: const EdgeInsets.all(8),
child: Directionality(
textDirection: callConfig.textDirection,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
itm.queueNo.toString(),
letterSpacing: -1,
fontHeight: 0.5,
fontWeight: FontWeight.bold,
fontSize: SizeConfig.getWidthMultiplier() * 3.5,
textAlign: TextAlign.center,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
Expanded(
flex: 5,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: SizedBox(
width: SizeConfig.getWidthMultiplier() * 3.5,
child: itm.getCallType().icon(SizeConfig.getHeightMultiplier() * 2.5),
),
),
const SizedBox(width: 15),
AppText(
itm.getCallType().message(callConfig, isListView: true),
color: itm.getCallType().color(),
letterSpacing: -1,
fontSize: SizeConfig.getWidthMultiplier() * 3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
),
),
Container(
color: Colors.grey.withOpacity(0.5),
width: 5,
height: SizeConfig.getHeightMultiplier() * 2,
margin: const EdgeInsets.symmetric(horizontal: 15),
),
Expanded(
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
itm.roomNo,
// callConfig.textDirection == TextDirection.ltr ? "${callConfig.roomText}: ${itm.roomNo}" : " ${itm.roomNo} ${callConfig.roomText}: ",
color: itm.getCallType().color(),
letterSpacing: -1.5,
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
fontWeight: FontWeight.w600,
fontHeight: 0.5,
),
],
),
)
],
),
),
);
},
),
],
),
)
];
return (appProvider.currentScreenRotation == ScreenOrientationEnum.portraitUp || appProvider.currentScreenRotation == ScreenOrientationEnum.portraitDown) ? Row(children: children) : Column(children: children);
}

@ -1,88 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/home/que_item/que_item_widget.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
class TicketItem extends StatelessWidget {
const TicketItem({
Key key,
this.isFirstLine = false,
this.isSecondLine = false,
this.isInListLine = false,
this.queNo,
this.isNurseVisit = false,
this.idDoctorVisit = false, this.haveListOfPatient
}) : super(key: key);
final bool isFirstLine;
final bool isSecondLine;
final bool isInListLine;
final bool isNurseVisit;
final bool idDoctorVisit;
final String queNo;
final bool haveListOfPatient;
@override
Widget build(BuildContext context) {
return haveListOfPatient?
Padding(
padding: const EdgeInsets.all(45.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
QueItemWidget(
isFirstLine: isFirstLine,
isNurseVisit: isNurseVisit,
isSecondLine: isSecondLine,
queNo: queNo,
),
],
),
)
:Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.only(right: 20.0, left: 20.0),
child: AppText(
queNo,
fontSize: SizeConfig.getWidthMultiplier() *
(isFirstLine
? 13
: isSecondLine
? 8.5
: 4.7),
letterSpacing: -3.26,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
),
),
const SizedBox(width: 30,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SvgPicture.asset(
isNurseVisit
? "assets/images/nurseicon.svg"
: "assets/images/doctoricon.svg", height:SizeConfig.getHeightMultiplier()*2.5 ,),
const SizedBox(width: 4,),
AppText(
isNurseVisit ? " Please Visit Nurse" : " Please Visit Doctor",
color: AppGlobal.appGreyColor,
fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine
? 3.3
: isSecondLine
? 3.3
: 3.3),
letterSpacing: -1.6,
fontFamily: 'Poppins-Medium.ttf',
),
],
)
],
);
}
}

@ -1,67 +0,0 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
///TODO Roaa we have dublicated code between this and the que item widget we need to make it customize
class QueItemWidget extends StatelessWidget {
const QueItemWidget({
Key key,
this.isFirstLine = false,
this.isSecondLine = false,
this.queNo,
this.isNurseVisit = false,
}) : super(key: key);
final bool isFirstLine;
final bool isSecondLine;
final bool isNurseVisit;
final String queNo;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
AppText(
queNo,
fontSize: SizeConfig.getWidthMultiplier() *
(isFirstLine
? 14
: isSecondLine
? 8.5
: 5.5),
letterSpacing: -13.72,
fontWeight: FontWeight.bold,
// fontFamily: 'Poppins-Bold.ttf',
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
isNurseVisit
? "assets/images/nurseicon.svg"
: "assets/images/doctoricon.svg", height:SizeConfig.getHeightMultiplier()*2.5 ,),
const SizedBox(width: 25,),
AppText(
isNurseVisit ? "Please Visit Nurse" : "Please Visit Doctor",
color: isNurseVisit
? AppGlobal.appGreenColor
: AppGlobal.appRedColor,
fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine
? 3.3
: isSecondLine
? 3.3
: 3.3),
letterSpacing: -3.25,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins-Medium.ttf',
),
],
),
],
);
}
}

@ -1,27 +0,0 @@
import 'package:flutter/material.dart';
import 'package:queuing_system/core/config/size_config.dart';
import 'package:queuing_system/home/que_item/que_item.dart';
class QueItemList extends StatelessWidget {
const QueItemList({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: SizeConfig.getHeightMultiplier() *2.3,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: false, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: false, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,),
const TicketItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: false, haveListOfPatient: false,),
],),
);
}
}

@ -1,16 +1,38 @@
import 'dart:developer';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logger/logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'core/base/project_view_model.dart'; import 'package:queuing_system/core/api.dart';
import 'package:queuing_system/home/app_provider.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
import 'core/config/size_config.dart'; import 'core/config/size_config.dart';
import 'home/home_screen.dart'; import 'home/home_screen.dart';
// import 'home/home_screen_bkp.dart';
Logger logger = Logger(
level: Level.debug,
printer: PrettyPrinter(
printEmojis: false,
colors: true,
printTime: false,
));
void main() { void main() {
//TODO: WE HAVE TO UPDATE THIS BEFORE GOING LIVE.
HttpOverrides.global = MyHttpOverrides();
WidgetsFlutterBinding.ensureInitialized();
WakelockPlus.enable();
runApp(const MyApp()); runApp(const MyApp());
} }
//test commit
//TODO: WE NEED TO IMPLEMENT THE AVAILABILITY MONITORING OF THE SCREENS LIKE IF THEY ARE TURNED ON OR NOT!!
class MyApp extends StatelessWidget { class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key); const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application. // This widget is the root of your application.
@override @override
@ -19,31 +41,27 @@ class MyApp extends StatelessWidget {
builder: (context, constraints) { builder: (context, constraints) {
return OrientationBuilder(builder: (context, orientation) { return OrientationBuilder(builder: (context, orientation) {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<AppProvider>(create: (context) => AppProvider()),
ChangeNotifierProvider<ProjectViewModel>( ],
create: (context) => ProjectViewModel(), child: MaterialApp(
), showSemanticsDebugger: false,
], title: 'Doctors App',
child: Consumer<ProjectViewModel>( theme: ThemeData(
builder: (context, projectProvider, child) => MaterialApp( primaryColor: Colors.grey,
showSemanticsDebugger: false, fontFamily: 'Poppins',
title: 'Doctors App', dividerColor: Colors.grey[350],
theme: ThemeData( colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.grey).copyWith(background: const Color.fromRGBO(255, 255, 255, 1)),
primarySwatch: Colors.grey, ),
primaryColor: Colors.grey, home: MyHomePage(),
fontFamily: 'Poppins', debugShowCheckedModeBanner: false,
dividerColor: Colors.grey[350], ));
backgroundColor: const Color.fromRGBO(255, 255, 255, 1),
),
home:MyHomePage() ,
debugShowCheckedModeBanner: false,
)),
);
}); });
}, },
); );
} }
} }

@ -1,48 +1,80 @@
import 'package:flutter/cupertino.dart'; import 'dart:developer';
import 'package:just_audio/just_audio.dart';
import 'package:queuing_system/utils/call_type.dart';
class CallByVoice{ import 'package:flutter_tts/flutter_tts.dart';
import 'package:queuing_system/home/app_provider.dart';
class CallByVoice {
final String lang; final String lang;
final String preVoice; final String preVoice;
final String ticketNo; final String ticketNo;
final String postVoice; final String postVoice;
final FlutterTts flutterTts;
CallByVoice(this.ticketNo, {this.lang = 'en', @required this.preVoice, @required this.postVoice}); CallByVoice({this.lang = 'en', required this.ticketNo, required this.preVoice, required this.postVoice, required this.flutterTts});
final _player = AudioPlayer(); double volume = 1.0;
start() async{ double pitch = 0.6;
double rate = 0.2;
// Create Pre Voice Players Future<void> startCalling(bool isClinicNameAdded) async {
if(preVoice != null && preVoice.isNotEmpty) { log("lang: $lang");
await _player.setAsset('assets/voice_$lang/$preVoice'); log("preVoice: $preVoice");
await _player.play(); log("postVoice: $postVoice");
} log("ticketNo: $ticketNo");
log("isClinicNameAdded: $isClinicNameAdded");
// Create Ticket Number Voice Players String clinicName = "";
final characters = ticketNo.characters.toList(); String patientAlpha = "";
for(int i = 0; i< characters.length; i++){ String patientNumeric = "";
final no = characters[i];
if(no.isNotEmpty){
await Future.delayed(const Duration(milliseconds: 200));
await _player.stop(); if (isClinicNameAdded) {
await _player.setAsset('assets/voice_$lang/$no.mp3'); var clinic = ticketNo.split(" ");
await _player.play(); clinicName = clinic[0];
var queueNoArray = clinic[1].split("-");
if (queueNoArray.length > 2) {
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
patientNumeric = queueNoArray[2];
} else {
patientAlpha = queueNoArray[0];
patientNumeric = queueNoArray[1];
}
} else {
var queueNoArray = ticketNo.split("-");
if (queueNoArray.length > 2) {
patientAlpha = "${queueNoArray[0]} .. ${queueNoArray[1]}";
patientNumeric = queueNoArray[2];
} else {
patientAlpha = queueNoArray[0];
patientNumeric = queueNoArray[1];
} }
} }
// Create Pre Voice Players
if (postVoice != null && postVoice.isNotEmpty) {
log('lang $lang');
flutterTts.setSpeechRate(0.45);
if (lang != "ar") {
await flutterTts.setLanguage(lang);
flutterTts.setPitch(0.9);
flutterTts.setVolume(1.0);
isVoiceActualCompletedGlobally = true;
await flutterTts.awaitSpeakCompletion(true);
await flutterTts.speak(preVoice + " .. " + clinicName + " .. " + patientAlpha + " .. " + patientNumeric + " .. " + postVoice);
return;
}
flutterTts.setPitch(1.1);
flutterTts.setVolume(1.0);
await flutterTts.setLanguage(lang);
isVoiceActualCompletedGlobally = false;
await flutterTts.awaitSpeakCompletion(true);
// Create Post Voice Players // await flutterTts.speak(preVoice + " .. " + clinicName + " .. " + patientAlpha + " .. " + patientNumeric + " .. " + postVoice);
if(postVoice != null && postVoice.isNotEmpty) { await flutterTts.speak(preVoice + " .. ");
await Future.delayed(const Duration(milliseconds: 1000)); await flutterTts.setLanguage("en");
await flutterTts.speak(clinicName + " .. " + patientAlpha + " .. " + patientNumeric + " .. ");
await _player.stop(); await flutterTts.setLanguage(lang);
await _player.setAsset('assets/voice_$lang/$postVoice'); isVoiceActualCompletedGlobally = true;
await _player.play(); await flutterTts.speak(postVoice);
} }
_player.dispose();
} }
} }

@ -1,60 +1,74 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/core/response_models/call_config_model.dart';
enum CallType{ enum CallType { vitalSign, doctor, procedure, vaccination, nebulization, none }
RECEPTION,
NURSE,
DOCTOR,
NONE,
}
extension xCallType on CallType{
Color color(){ extension XCallType on CallType {
if(this == CallType.RECEPTION) { Color color() {
return AppGlobal.appRedColor; if (this == CallType.vitalSign) {
}else if(this == CallType.NURSE) { return AppGlobal.vitalSignColor;
return AppGlobal.appGreenColor; } else if (this == CallType.doctor) {
}else if(this == CallType.DOCTOR) { return AppGlobal.doctorColor;
return AppGlobal.appRedColor ; } else if (this == CallType.procedure) {
}else{ return AppGlobal.procedureColor;
} else if (this == CallType.vaccination) {
return AppGlobal.vaccinationColor;
} else if (this == CallType.nebulization) {
return AppGlobal.nebulizationColor;
} else {
return Colors.black54; return Colors.black54;
} }
} }
SvgPicture icon(double height,){ String message(CallConfig callConfig, {bool isListView = false}) {
if(this == CallType.RECEPTION) { switch (this) {
return SvgPicture.asset("assets/images/doctoricon.svg", height: height, color: color()); case CallType.vitalSign:
}else if(this == CallType.NURSE) { return isListView ? callConfig.callTypeVitalSignText : callConfig.vitalSignText;
return SvgPicture.asset("assets/images/nurseicon.svg", height: height, color: color()); case CallType.doctor:
}else if(this == CallType.DOCTOR) { return isListView ? callConfig.callTypeDoctorText : callConfig.doctorText;
return SvgPicture.asset("assets/images/doctoricon.svg", height: height, color: color()); case CallType.procedure:
return isListView ? callConfig.callTypeProcedureText : callConfig.procedureText;
case CallType.vaccination:
return isListView ? callConfig.callTypeVaccinationText : callConfig.vaccinationText;
case CallType.nebulization:
return isListView ? callConfig.callTypeNebulizationText : callConfig.nebulizationText;
case CallType.none:
return isListView ? callConfig.callTypeVitalSignText : callConfig.vitalSignText;
default:
return callConfig.callTypeVitalSignText;
} }
return SvgPicture.asset("assets/images/wait.svg", height: height, color: color());;
} }
String message(String lang){ SvgPicture icon(double height) {
if(this == CallType.RECEPTION) { if (this == CallType.vitalSign) {
return "Please visit reception"; return SvgPicture.asset(AppGlobal.vitalSignIcon, height: height, color: color());
}else if(this == CallType.NURSE) { } else if (this == CallType.doctor) {
return "Please visit nurse"; return SvgPicture.asset(AppGlobal.doctorIcon, height: height, color: color());
}else if(this == CallType.DOCTOR) { } else if (this == CallType.procedure) {
return "Please visit doctor"; return SvgPicture.asset(AppGlobal.procedureIcon, height: height, color: color());
} else if (this == CallType.vaccination) {
return SvgPicture.asset(AppGlobal.vaccinationIcon, height: height, color: color());
} else if (this == CallType.nebulization) {
return SvgPicture.asset(AppGlobal.nebulizationIcon, height: height, color: color());
} }
return "Please wait . . ."; return SvgPicture.asset("assets/images/wait.svg", height: height, color: color());
} }
String audio(String lang){ String audio(String lang) {
if(this == CallType.RECEPTION) { if (this == CallType.vitalSign) {
return "visit_doctor.mp3";
}else if(this == CallType.NURSE) {
return "visit_nurse.mp3"; return "visit_nurse.mp3";
}else if(this == CallType.DOCTOR) { } else if (this == CallType.doctor) {
return "visit_doctor.mp3";
} else if (this == CallType.procedure) {
return "visit_doctor.mp3";
} else if (this == CallType.vaccination) {
return "visit_doctor.mp3";
} else if (this == CallType.nebulization) {
return "visit_doctor.mp3"; return "visit_doctor.mp3";
} }
return ""; return "";
} }
} }

@ -1,7 +1,9 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:http/io_client.dart'; import 'package:http/io_client.dart';
import 'package:queuing_system/core/config/config.dart';
import 'package:queuing_system/main.dart';
import 'package:signalr_core/signalr_core.dart'; import 'package:signalr_core/signalr_core.dart';
/* /*
@ -15,66 +17,71 @@ https://vcallapi.hmg.com/patientcalling.html?IPAddress=10.10.14.20&Clinic=4&Proj
--------------------------------------- ---------------------------------------
*/ */
class SignalRHelper{ class SignalRHelper {
String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub"; // String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub";
// String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub";
String hubBaseURL = "$BASE_URL/PatientCallingHub";
// String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub?IPAddress=10.10.14.20"; // String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub?IPAddress=10.10.14.20";
// "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273"; // "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273";
String msg ="Awaiting Patients Arrival"; HubConnection? connection;
HubConnection connection;
startSignalRConnection(
startSignalRConnection(String deviceIp, {@required Function(dynamic) onUpdateAvailable, @required VoidCallback onConnect, @required Function(dynamic) onDisconnect, @required VoidCallback onConnecting}) async { String deviceIp, {
required Function(dynamic) onUpdateAvailable,
// Hardcoded IP For Testing required VoidCallback onConnect,
deviceIp = "10.10.14.11"; required Function(dynamic) onDisconnect,
required VoidCallback onConnecting,
final url = hubBaseURL+"?IPAddress=$deviceIp"; }) async {
logger.i("Connecting Signal R with: $deviceIp");
final url = "$hubBaseURL?IPAddress=$deviceIp";
// final url = hubBaseURL;
connection = HubConnectionBuilder() connection = HubConnectionBuilder()
.withUrl( .withUrl(
url, url,
HttpConnectionOptions( HttpConnectionOptions(
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
transport: HttpTransportType.webSockets,
logging: (level, message) => { //TODO: IT MUST BE WEB SOCKETS
print(message) transport: HttpTransportType.longPolling,
}, logging: (level, message) => log(message),
)) ))
.withAutomaticReconnect()
.build(); .build();
connection.onclose(onDisconnect); connection!.serverTimeoutInMilliseconds = 120000;
connection.onreconnecting((exception) => onConnecting()); connection!.onclose(onDisconnect);
connection.onreconnected((connectionId) => onConnect()); connection!.onreconnecting((exception) => onConnecting());
connection!.onreconnected((connectionId) => onConnect());
connection!.onreconnected((connectionId) => onConnect());
connection.on('addChatMessage', (message) { connection!.on('addChatMessage', (message) => onUpdateAvailable(message));
onUpdateAvailable(message);
});
await connection.start(); await connection!.start();
}
}
void sendMessage(List<dynamic> args) async { void sendMessage(List<dynamic> args) async {
await connection.invoke('SendMessage', args: args); //['Bob', 'Says hi!'] await connection!.invoke('SendMessage', args: args); //['Bob', 'Says hi!']
} }
bool getConnectionState() { bool getConnectionState() {
if(connection == null ) return false; if (connection == null) return false;
if (connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting) return true; logger.i("connectionState: ${connection!.state}");
if (connection.state == HubConnectionState.disconnected || connection.state == HubConnectionState.disconnecting) return false; if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) return true;
if (connection!.state == HubConnectionState.disconnected || connection!.state == HubConnectionState.disconnecting) return false;
return false;
} }
closeConnection() async {
closeConnection(BuildContext context) async { if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) {
if(connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting) await connection!.stop();
{
await connection.stop();
} }
} }
startConnection(BuildContext context) async { // startConnection(BuildContext context) async {
if(connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting) // if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) {
{ // connection!.off('addChatMessage');
connection.off('addChatMessage'); // await connection!.start();
await connection.start(); // }
} // }
} }
}

@ -1,30 +1,12 @@
import 'package:connectivity/connectivity.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:queuing_system/core/base/locater.dart';
import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/core/config/size_config.dart';
import 'package:flutter/cupertino.dart'; import 'package:queuing_system/main.dart';
import 'package:flutter/material.dart';
class Utils { class Utils {
static getHeight() {
return SizeConfig.getHeightMultiplier() * 7;
static TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor);
static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity());
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true;
} else {
return false;
}
} }
static generateContactAdminMsg([err = null]) { static generateContactAdminMsg([err = null]) {
//TODO: Add translation //TODO: Add translation
String localMsg = 'Something wrong happened, please contact the admin'; String localMsg = 'Something wrong happened, please contact the admin';
@ -34,150 +16,159 @@ class Utils {
return localMsg; return localMsg;
} }
static Future<bool> checkConnection() async {
List<ConnectivityResult> connectivityResult = await (Connectivity().checkConnectivity());
int indexEthernet = connectivityResult.indexWhere((element) => element == ConnectivityResult.ethernet);
static getCardBoxDecoration() { if (indexEthernet != -1) {
return BoxDecoration( return true;
borderRadius: BorderRadius.circular(10),
color: Colors.white,
shape: BoxShape.rectangle,
boxShadow: [
BoxShadow(
color: Color(0xFF0000000D),
spreadRadius: 10,
blurRadius: 27,
offset: Offset(0, -3), // changes position of shadow
),
],
);
}
navigateToUpdatePage(String message, String androidLink, iosLink) {
// locator<NavigationService>().pushAndRemoveUntil(
// FadePage(
// page: UpdatePage(
// message: message,
// androidLink: androidLink,
// iosLink: iosLink,
// ),
// ),
// );
// Navigator.pushAndRemoveUntil(
// AppGlobal.CONTEX,
// FadePage(
// page: UpdatePage(
// message: message,
// androidLink: androidLink,
// iosLink: iosLink,
// ),
// ),
// (r) => false);
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: dropDownColor != null ? dropDownColor : Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,
)),
);
}
/// hides the keyboard if its already open
static hideKeyboard(BuildContext context) {
FocusScope.of(context).unfocus();
}
static String capitalize(str) {
if (str != "") {
return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}";
} else {
return str;
} }
}
static bool isTextHtml(String text) {
var htmlRegex = RegExp("<(“[^”]*”|'[^]*|[^'”>])*>");
return htmlRegex.hasMatch(text);
}
static String timeFrom({Duration duration}) {
String twoDigits(int n) => n.toString().padLeft(2, "0");
String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
return "$twoDigitMinutes:$twoDigitSeconds";
}
int indexWifi = connectivityResult.indexWhere((element) => element == ConnectivityResult.wifi);
if (indexWifi != -1) {
static String convertToTitleCase(String text) { return true;
if (text == null) {
return null;
}
if (text.length <= 1) {
return text.toUpperCase();
} }
// Split string into multiple words return false;
final List<String> words = text.split(' ');
// Capitalize first letter of each words
final capitalizedWords = words.map((word) {
if (word.trim().isNotEmpty) {
final String firstLetter = word.trim().substring(0, 1).toUpperCase();
final String remainingLetters = word.trim().substring(1).toLowerCase();
return '$firstLetter$remainingLetters';
}
return '';
});
// Join/Merge all words back to one String
return capitalizedWords.join(' ');
}
static getHeight() {
return SizeConfig.getHeightMultiplier()*7;
} }
// static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor);
//
//
//
// static getCardBoxDecoration() {
// return BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// color: Colors.white,
// shape: BoxShape.rectangle,
// boxShadow: [
// BoxShadow(
// color: Color(0xFF0000000D),
// spreadRadius: 10,
// blurRadius: 27,
// offset: Offset(0, -3), // changes position of shadow
// ),
// ],
// );
// }
//
// navigateToUpdatePage(String message, String androidLink, iosLink) {
// // locator<NavigationService>().pushAndRemoveUntil(
// // FadePage(
// // page: UpdatePage(
// // message: message,
// // androidLink: androidLink,
// // iosLink: iosLink,
// // ),
// // ),
// // );
//
// // Navigator.pushAndRemoveUntil(
// // AppGlobal.CONTEX,
// // FadePage(
// // page: UpdatePage(
// // message: message,
// // androidLink: androidLink,
// // iosLink: iosLink,
// // ),
// // ),
// // (r) => false);
// }
//
// static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) {
// return InputDecoration(
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
// borderRadius: BorderRadius.circular(8),
// ),
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
// borderRadius: BorderRadius.circular(8),
// ),
// disabledBorder: OutlineInputBorder(
// borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
// borderRadius: BorderRadius.circular(8),
// ),
// hintText: selectedText != null ? selectedText : hintText,
// suffixIcon: isDropDown
// ? suffixIcon != null
// ? suffixIcon
// : Icon(
// Icons.arrow_drop_down,
// color: dropDownColor != null ? dropDownColor : Colors.black,
// )
// : null,
// hintStyle: TextStyle(
// fontSize: 14,
// color: Colors.grey.shade600,
// ),
// );
// }
//
// static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) {
// return BoxDecoration(
// color: containerColor,
// shape: BoxShape.rectangle,
// borderRadius: BorderRadius.all(Radius.circular(8)),
// border: Border.fromBorderSide(BorderSide(
// color: borderColor,
// width: borderWidth == -1 ? 2.0 : borderWidth,
// )),
// );
// }
//
// /// hides the keyboard if its already open
// static hideKeyboard(BuildContext context) {
// FocusScope.of(context).unfocus();
// }
//
// static String capitalize(str) {
// if (str != "") {
// return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}";
// } else {
// return str;
// }
// }
//
// static bool isTextHtml(String text) {
// var htmlRegex = RegExp("<(“[^”]*”|'[^]*|[^'”>])*>");
// return htmlRegex.hasMatch(text);
// }
//
// static String timeFrom({Duration duration}) {
// String twoDigits(int n) => n.toString().padLeft(2, "0");
// String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
// String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
// return "$twoDigitMinutes:$twoDigitSeconds";
// }
//
// static String convertToTitleCase(String text) {
// if (text == null) {
// return null;
// }
//
// if (text.length <= 1) {
// return text.toUpperCase();
// }
//
// // Split string into multiple words
// final List<String> words = text.split(' ');
//
// // Capitalize first letter of each words
// final capitalizedWords = words.map((word) {
// if (word.trim().isNotEmpty) {
// final String firstLetter = word.trim().substring(0, 1).toUpperCase();
// final String remainingLetters = word.trim().substring(1).toLowerCase();
//
// return '$firstLetter$remainingLetters';
// }
// return '';
// });
//
// // Join/Merge all words back to one String
// return capitalizedWords.join(' ');
// }
//
} }

@ -1,33 +1,32 @@
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
// import 'package:queuing_system/widget/loader/gif_loader_container.dart';
import 'loader/gif_loader_container.dart'; //
// class AppLoaderWidget extends StatefulWidget {
class AppLoaderWidget extends StatefulWidget { // AppLoaderWidget({Key? key, this.title, this.containerColor}) : super(key: key);
AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); //
// final String title;
final String title; // final Color containerColor;
final Color containerColor; //
// @override
@override // _AppLoaderWidgetState createState() => _AppLoaderWidgetState();
_AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); // }
} //
// class _AppLoaderWidgetState extends State<AppLoaderWidget> {
class _AppLoaderWidgetState extends State<AppLoaderWidget> { // @override
@override // Widget build(BuildContext context) {
Widget build(BuildContext context) { // return SizedBox(
return Container( // height: MediaQuery.of(context).size.height,
height: MediaQuery.of(context).size.height, // child: Stack(
child: Stack( // children: [
children: [ // Container(
Container( // color: widget.containerColor ?? Colors.grey.withOpacity(0.6),
color: widget.containerColor ?? Colors.grey.withOpacity(0.6), // ),
), // Container(
Container( // child: GifLoaderContainer(),
child: GifLoaderContainer(), // margin: EdgeInsets.only(
margin: EdgeInsets.only( // bottom: MediaQuery.of(context).size.height * 0.09))
bottom: MediaQuery.of(context).size.height * 0.09)) // ],
], // ),
), // );
); // }
} // }
}

@ -1,38 +1,39 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/core/config/size_config.dart';
class AppText extends StatefulWidget { class AppText extends StatefulWidget {
final String text; final String text;
final String variant; final String? variant;
final Color color; final Color color;
final FontWeight fontWeight; final FontWeight? fontWeight;
final double fontSize; final double? fontSize;
final double fontHeight; final double? fontHeight;
final String fontFamily; final String fontFamily;
final int maxLength; final int maxLength;
final bool italic; final bool italic;
final double margin; final double? margin;
final double marginTop; final double marginTop;
final double marginRight; final double marginRight;
final double marginBottom; final double marginBottom;
final double marginLeft; final double marginLeft;
final double letterSpacing; final double? letterSpacing;
final TextAlign textAlign; final TextAlign? textAlign;
final bool bold; final bool? bold;
final bool regular; final bool? regular;
final bool medium; final bool? medium;
final int maxLines; final int? maxLines;
final bool readMore; final bool readMore;
final String style; final String? style;
final bool allowExpand; final bool allowExpand;
final bool visibility; final bool visibility;
final TextOverflow textOverflow; final TextOverflow? textOverflow;
final TextDecoration textDecoration; final TextDecoration? textDecoration;
final bool isCopyable; final bool isCopyable;
final TextDirection textDirection;
AppText( const AppText(
this.text, { this.text, {
Key? key,
this.color = Colors.black, this.color = Colors.black,
this.fontWeight, this.fontWeight,
this.variant, this.variant,
@ -59,7 +60,8 @@ class AppText extends StatefulWidget {
this.textDecoration, this.textDecoration,
this.letterSpacing, this.letterSpacing,
this.isCopyable = false, this.isCopyable = false,
}); this.textDirection = TextDirection.ltr,
}) : super(key: key);
@override @override
_AppTextState createState() => _AppTextState(); _AppTextState createState() => _AppTextState();
@ -72,9 +74,9 @@ class _AppTextState extends State<AppText> {
@override @override
void didUpdateWidget(covariant AppText oldWidget) { void didUpdateWidget(covariant AppText oldWidget) {
setState(() { setState(() {
if (widget.style == "overline") if (widget.style == "overline") {
text = widget.text.toUpperCase(); text = widget.text.toUpperCase();
else { } else {
text = widget.text; text = widget.text;
} }
}); });
@ -83,10 +85,9 @@ class _AppTextState extends State<AppText> {
@override @override
void initState() { void initState() {
hidden = widget.readMore; if (widget.style == "overline") {
if (widget.style == "overline")
text = widget.text.toUpperCase(); text = widget.text.toUpperCase();
else { } else {
text = widget.text; text = widget.text;
} }
super.initState(); super.initState();
@ -96,168 +97,67 @@ class _AppTextState extends State<AppText> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
child: Container( child: Container(
margin: widget.margin != null margin: widget.margin != null ? EdgeInsets.all(widget.margin!) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
? EdgeInsets.all(widget.margin)
: EdgeInsets.only(
top: widget.marginTop,
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( Text(
children: [ text,
_textWidget(), textDirection: widget.textDirection,
if (widget.readMore && text.length > widget.maxLength && hidden) textAlign: widget.textAlign,
Positioned( overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
bottom: 0, maxLines: widget.maxLines,
left: 0, style: widget.style != null
right: 0, ? _getFontStyle()?.copyWith(
child: Container( fontStyle: widget.italic ? FontStyle.italic : null,
decoration: BoxDecoration( color: widget.color,
gradient: LinearGradient( fontFamily: 'Poppins',
colors: [ fontWeight: widget.fontWeight ?? _getFontWeight(),
Theme.of(context).backgroundColor, height: widget.fontHeight,
Theme.of(context).backgroundColor.withOpacity(0), )
], : TextStyle(
begin: Alignment.bottomCenter, fontStyle: widget.italic ? FontStyle.italic : null,
end: Alignment.topCenter)), color: widget.color ?? Colors.black,
height: 30, fontSize: widget.fontSize ?? _getFontSize(),
), letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
) fontWeight: widget.fontWeight ?? _getFontWeight(),
], fontFamily: 'Poppins',
), decoration: widget.textDecoration,
if (widget.allowExpand && height: widget.fontHeight),
widget.readMore && )
text.length > widget.maxLength)
Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell(
onTap: () {
setState(() {
hidden = !hidden;
});
},
child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith(
color: Colors.white,
fontWeight: FontWeight.w800,
fontFamily: "Poppins",
)),
),
),
], ],
), ),
), ),
); );
} }
Widget _textWidget() { TextStyle? _getFontStyle() {
if (widget.isCopyable) {
return Theme(
data: ThemeData(
textSelectionColor: Colors.lightBlueAccent,
),
child: Container(
child: SelectableText(
!hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign,
// overflow: widget.maxLines != null
// ? ((widget.maxLines > 1)
// ? TextOverflow.fade
// : TextOverflow.ellipsis)
// : null,
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color:
widget.color != null ? widget.color : Color(0xff000000),
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration,
height: widget.fontHeight),
),
),
);
} else {
return Text(
!hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign,
overflow: widget.maxLines != null
? ((widget.maxLines > 1)
? TextOverflow.fade
: TextOverflow.ellipsis)
: null,
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color,
fontWeight: widget.fontWeight ?? _getFontWeight(),
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration,
height: widget.fontHeight),
);
}
}
TextStyle _getFontStyle() {
switch (widget.style) { switch (widget.style) {
case "headline2": case "headline2":
return Theme.of(context).textTheme.headline2; return Theme.of(context).textTheme.displayMedium;
case "headline3": case "headline3":
return Theme.of(context).textTheme.headline3; return Theme.of(context).textTheme.displaySmall;
case "headline4": case "headline4":
return Theme.of(context).textTheme.headline4; return Theme.of(context).textTheme.headlineMedium;
case "headline5": case "headline5":
return Theme.of(context).textTheme.headline5; return Theme.of(context).textTheme.headlineSmall;
case "headline6": case "headline6":
return Theme.of(context).textTheme.headline6; return Theme.of(context).textTheme.titleLarge;
case "bodyText2": case "bodyText2":
return Theme.of(context).textTheme.bodyText2; return Theme.of(context).textTheme.bodyMedium;
case "bodyText_15": case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); return Theme.of(context).textTheme.bodyMedium?.copyWith(fontSize: 15.0);
case "bodyText1": case "bodyText1":
return Theme.of(context).textTheme.bodyText1; return Theme.of(context).textTheme.bodyLarge;
case "caption": case "caption":
return Theme.of(context).textTheme.caption; return Theme.of(context).textTheme.bodySmall;
case "overline": case "overline":
return Theme.of(context).textTheme.overline; return Theme.of(context).textTheme.labelSmall;
case "button": case "button":
return Theme.of(context).textTheme.button; return Theme.of(context).textTheme.labelLarge;
default: default:
return TextStyle(); return const TextStyle();
} }
} }
@ -294,11 +194,11 @@ class _AppTextState extends State<AppText> {
case "date": case "date":
return 24.0; return 24.0;
default: default:
return SizeConfig.textMultiplier * 2.8; return SizeConfig.textMultiplier! * 2.8;
} }
} }
FontWeight _getFontWeight() { FontWeight? _getFontWeight() {
if (widget.bold ?? false) { if (widget.bold ?? false) {
return FontWeight.w900; return FontWeight.w900;
} else if (widget.regular ?? false) { } else if (widget.regular ?? false) {

@ -1,43 +1,36 @@
import 'package:flutter/material.dart'; // import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; // import 'package:flutter_svg/flutter_svg.dart';
import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; // import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
//
// class ErrorMessage extends StatelessWidget {
class ErrorMessage extends StatelessWidget { // const ErrorMessage({Key? key, this.error = ''}) : super(key: key);
const ErrorMessage({ //
Key key, // final String error;
@required this.error, //
}) : super(key: key); // @override
// Widget build(BuildContext context) {
final String error; // return SingleChildScrollView(
// child: Center(
@override // child: Column(
Widget build(BuildContext context) { // crossAxisAlignment: CrossAxisAlignment.center,
return SingleChildScrollView( // children: [
child: Center( // const SizedBox(height: 100),
child: Column( // SvgPicture.asset('assets/images/svgs/no data.svg'),
crossAxisAlignment: CrossAxisAlignment.center, // Center(
children: [ // child: Center(
SizedBox( // child: Padding(
height: 100, // padding: const EdgeInsets.only(top: 12, bottom: 12, right: 20, left: 30),
), // child: Center(
SvgPicture.asset('assets/images/svgs/no data.svg'), // child: AppText(
Center( // error ?? '',
child: Center( // textAlign: TextAlign.center,
child: Padding( // )),
padding: const EdgeInsets.only( // ),
top: 12, bottom: 12, right: 20, left: 30), // ),
child: Center( // )
child: AppText( // ],
error ?? '', // ),
textAlign: TextAlign.center, // ),
)), // );
), // }
), // }
)
],
),
),
);
}
}

@ -1,43 +1,43 @@
import 'package:flutter/cupertino.dart'; // import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart'; // import 'package:flutter_gifimage/flutter_gifimage.dart';
//
class GifLoaderContainer extends StatefulWidget { // class GifLoaderContainer extends StatefulWidget {
@override // @override
_GifLoaderContainerState createState() => _GifLoaderContainerState(); // _GifLoaderContainerState createState() => _GifLoaderContainerState();
} // }
//
class _GifLoaderContainerState extends State<GifLoaderContainer> // class _GifLoaderContainerState extends State<GifLoaderContainer>
with TickerProviderStateMixin { // with TickerProviderStateMixin {
GifController controller1; // GifController controller1;
//
@override // @override
void initState() { // void initState() {
controller1 = GifController(vsync: this); // controller1 = GifController(vsync: this);
//
WidgetsBinding.instance.addPostFrameCallback((_) { // WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat( // controller1.repeat(
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); // min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
}); // });
super.initState(); // super.initState();
} // }
//
@override // @override
void dispose() { // void dispose() {
controller1.dispose(); // controller1.dispose();
super.dispose(); // super.dispose();
} // }
//
@override // @override
Widget build(BuildContext context) { // Widget build(BuildContext context) {
return Center( // return Center(
//progress-loading.gif // //progress-loading.gif
child: Container( // child: Container(
// margin: EdgeInsets.only(bottom: 40), // // margin: EdgeInsets.only(bottom: 40),
child: GifImage( // child: GifImage(
controller: controller1, // controller: controller1,
image: AssetImage( // image: AssetImage(
"assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), // "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
), // ),
)); // ));
} // }
} // }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save