Made the IP Address Dynamic

dev_faiz
FaizHashmiCS22 2 years ago
parent 64e9d48d82
commit 61261d9412

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

@ -4,8 +4,8 @@ import 'package:flutter/cupertino.dart';
import 'package:queuing_system/core/base/base_app_client.dart';
import 'package:queuing_system/core/response_model/patient_call.dart';
const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfoByClinincInfoNew";
const _call_UpdateNotIsQueueRecordByIDAsync = "/Call_UpdateNotIsQueueRecordByIDNew";
const _getCallRequestInfoByClinicInfo = "/GetCallRequestInfoByIP";
const _call_UpdateNotIsQueueRecordByIDAsync = "/UpdateCallRequestQueue";
class API {
static getCallRequestInfoByClinicInfo(String deviceIp, {@required Function(List<Tickets>, List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async {
@ -14,11 +14,10 @@ class API {
body: body,
onSuccess: (response, status) {
if (status == 200) {
var calledByNurse = (response["CalledByNurseNew"] as List).map((j) => Tickets.fromJson(j)).toList();
final patients = (response["ClinicCurrentPatientNew"] as List).map((j) => Tickets.fromJson(j)).toList();
var calledByNurse = (response["NurseCallPatients"] as List).map((j) => Tickets.fromJson(j)).toList();
final patients = (response["DrCallPatients"] as List).map((j) => Tickets.fromJson(j)).toList();
calledByNurse.addAll(patients);
log("CalledByNurseNew: ${calledByNurse.toString()} ");
log("NurseCallPatients: ${calledByNurse.toString()} ");
log("patients: ${patients.toString()} ");
var isQueuePatients = calledByNurse.where((element) => element.isQueue == false).toList();

@ -184,6 +184,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
get_ip_address:
dependency: "direct main"
description:
name: get_ip_address
sha256: "50265edb9b1c917a29c741f3173c0dca34d8e0fc2984aed87c58f0269bf93f29"
url: "https://pub.dev"
source: hosted
version: "0.0.5"
get_it:
dependency: "direct main"
description:

@ -41,6 +41,7 @@ dependencies:
blinking_text: ^1.0.2
just_audio: ^0.9.31
flutter_tts: ^3.6.3
get_ip_address: ^0.0.5
#signalr core
signalr_core: ^1.1.1

Loading…
Cancel
Save