Merge branch 'dev_faiz'
commit
c275818ff4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="54.029" height="58" viewBox="0 0 54.029 58">
|
||||
<g id="doctor_2_" data-name="Doctor (2)" transform="translate(-4.985 -3)">
|
||||
<path id="Path_57" data-name="Path 57" d="M49.73,40,47,39.43c1.51,3,.89,5.33,1,7.71a4,4,0,1,1-2,0c-.2-2.18.71-5.24-1.72-8.24l-6.36-1.23a13.83,13.83,0,0,1-11.84,0L19.72,38.9A7.68,7.68,0,0,0,18,43.77v.33a5.21,5.21,0,0,1,4.11,4.16l.95,5.2a3,3,0,0,1-.65,2.46c-1.19,1.44-2.83,1-3.41,1.08V55c.6-.07,1.42.21,1.87-.36a1,1,0,0,0,.22-.82l-.95-5.2a3.19,3.19,0,0,0-6.28,0l-.95,5.2a1,1,0,0,0,1,1.18H15v2H13.9a3.006,3.006,0,0,1-2.96-3.54l1-5.2A5.21,5.21,0,0,1,16,44.1v-.33a9.61,9.61,0,0,1,1-4.34L14.27,40A9.05,9.05,0,0,0,7.1,47.32L5,59.83A1,1,0,0,0,6,61H27.42a1,1,0,0,0,1-1.16l-3-18.57,5.83,4.32a1,1,0,0,0,1.18,0l6.24-4.42-3,18.65a1,1,0,0,0,1,1.16H58a1,1,0,0,0,1-1.17L56.9,47.32A9.05,9.05,0,0,0,49.73,40Z" fill="#ec1c2b"/>
|
||||
<path id="Path_58" data-name="Path 58" d="M39.77,34.13A11.94,11.94,0,0,0,44,25.9,5,5,0,0,0,46,17c.34-1.32,1.76-7.65-1.32-10.73-2.3-2.27-5.8-1.78-7.3-1.42C36.66,4.09,35.1,3,32,3,27.65,3,20.38,3,18.11,7.55c-1.79,3.57-1,8.35-.7,10a5,5,0,0,0,2.64,8.36,11.94,11.94,0,0,0,4.18,8.23,9.74,9.74,0,0,0-7.2,5.3l2.69-.53A7.73,7.73,0,0,1,25.77,36h1.45a12,12,0,0,0,9.56,0h1.45a7.73,7.73,0,0,1,6.05,2.9l2.69.52A9.77,9.77,0,0,0,39.77,34.13ZM44,18.35l.25-.08A3,3,0,0,1,44,23.82ZM20,23.82a3,3,0,0,1-1-5.07l1-.34ZM32,35A10,10,0,0,1,22,25V20a41.82,41.82,0,0,0,8.24-1,11.86,11.86,0,0,0,5.47-3.11c1.56,2.55,4.81,3.78,6.29,4.23V25A10,10,0,0,1,32,35Z" fill="#ec1c2b"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="39.381" height="52.784" viewBox="0 0 39.381 52.784">
|
||||
<g id="Nurse" transform="translate(-5.723 -2.226)">
|
||||
<path id="Path_59" data-name="Path 59" d="M45.087,45.928V27.887a19.741,19.741,0,0,0-6.162-14.293L40.6,9.762a1.916,1.916,0,0,0-.529-2.24,25.573,25.573,0,0,0-15.1-5.3,23.107,23.107,0,0,0-14.425,5.26A1.914,1.914,0,0,0,9.918,9.64l1.566,4.4A19.736,19.736,0,0,0,5.746,27.889V45.93S4.893,54.321,13.537,55c0,0,5.061.341,7.6-4.018A13.249,13.249,0,0,1,12.018,38.44l-.084-5.787a1.917,1.917,0,0,1,.416-3.811c6,.657,10.4-.165,12.745-2.366a5.938,5.938,0,0,0,1.878-4.354,1.943,1.943,0,0,1,2.037-1.83,1.881,1.881,0,0,1,1.788,1.83c0,.029.218,3.652,2.562,5.651a6.749,6.749,0,0,0,5.285,1.3,1.912,1.912,0,0,1,2.108,1.7,1.949,1.949,0,0,1-2.23,2.137l.031,5.513a13.242,13.242,0,0,1-8.9,12.5c2.577,4.606,7.927,4.055,7.927,4.055,8.24-1.1,7.511-9.048,7.511-9.048ZM31.294,11.995a.869.869,0,0,1-.87.868H27.564v2.832a.87.87,0,0,1-.868.87h-2.56a.87.87,0,0,1-.868-.87V12.863H20.407a.869.869,0,0,1-.87-.868V9.475a.871.871,0,0,1,.87-.87h2.861V5.779a.869.869,0,0,1,.868-.87H26.7a.869.869,0,0,1,.868.87V8.6h2.861a.871.871,0,0,1,.87.87Z" transform="translate(0 0)" fill="#1f8d24"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 297 297" style="enable-background:new 0 0 297 297;" xml:space="preserve">
|
||||
<path d="M251.01,277.015h-17.683l-0.002-31.559c0-31.639-17.358-60.726-48.876-81.901c-3.988-2.682-6.466-8.45-6.466-15.055
|
||||
s2.478-12.373,6.464-15.053c31.52-21.178,48.878-50.264,48.88-81.904V19.985h17.683c5.518,0,9.992-4.475,9.992-9.993
|
||||
c0-5.518-4.475-9.992-9.992-9.992H45.99c-5.518,0-9.992,4.475-9.992,9.992c0,5.519,4.475,9.993,9.992,9.993h17.683v31.558
|
||||
c0,31.642,17.357,60.729,48.875,81.903c3.989,2.681,6.467,8.448,6.467,15.054c0,6.605-2.478,12.373-6.466,15.053
|
||||
c-31.519,21.176-48.876,50.263-48.876,81.903v31.559H45.99c-5.518,0-9.992,4.475-9.992,9.993c0,5.519,4.475,9.992,9.992,9.992
|
||||
h205.02c5.518,0,9.992-4.474,9.992-9.992C261.002,281.489,256.527,277.015,251.01,277.015z M138.508,110.362
|
||||
c0-5.518,4.474-9.993,9.992-9.993s9.992,4.475,9.992,9.993v17.664c0,5.519-4.474,9.992-9.992,9.992s-9.992-4.474-9.992-9.992
|
||||
V110.362z M141.433,173.956c1.858-1.857,4.436-2.927,7.064-2.927c2.628,0,5.206,1.069,7.064,2.927
|
||||
c1.868,1.859,2.928,4.438,2.928,7.065s-1.06,5.206-2.928,7.064c-1.858,1.858-4.436,2.928-7.064,2.928
|
||||
c-2.628,0-5.206-1.069-7.064-2.928c-1.859-1.858-2.928-4.437-2.928-7.064S139.573,175.816,141.433,173.956z M86.94,277.112
|
||||
c8.152-30.906,50.161-64.536,55.405-68.635c3.614-2.826,8.692-2.828,12.309,0c5.244,4.1,47.252,37.729,55.404,68.635H86.94z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 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.
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.
@ -1,29 +1,47 @@
|
||||
PODS:
|
||||
- audio_session (0.0.1):
|
||||
- Flutter
|
||||
- connectivity (0.0.1):
|
||||
- Flutter
|
||||
- Reachability
|
||||
- Flutter (1.0.0)
|
||||
- just_audio (0.0.1):
|
||||
- Flutter
|
||||
- path_provider_ios (0.0.1):
|
||||
- Flutter
|
||||
- Reachability (3.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||
- connectivity (from `.symlinks/plugins/connectivity/ios`)
|
||||
- Flutter (from `Flutter`)
|
||||
- just_audio (from `.symlinks/plugins/just_audio/ios`)
|
||||
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Reachability
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
audio_session:
|
||||
:path: ".symlinks/plugins/audio_session/ios"
|
||||
connectivity:
|
||||
:path: ".symlinks/plugins/connectivity/ios"
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
just_audio:
|
||||
:path: ".symlinks/plugins/just_audio/ios"
|
||||
path_provider_ios:
|
||||
:path: ".symlinks/plugins/path_provider_ios/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
|
||||
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
|
||||
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
|
||||
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
|
||||
|
||||
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
|
||||
PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
|
||||
|
||||
COCOAPODS: 1.11.2
|
||||
COCOAPODS: 1.11.3
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
import 'dart:developer';
|
||||
|
||||
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 = "/GetCallRequestInfoByClinincInfo";
|
||||
const _call_UpdateNotIsQueueRecordByIDAsync = "/Call_UpdateNotIsQueueRecordByID";
|
||||
|
||||
class API {
|
||||
static getCallRequestInfoByClinicInfo(String deviceIp, {@required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async {
|
||||
final body = {"IPAdress": deviceIp};
|
||||
BaseAppClient.post(_getCallRequestInfoByClinicInfo,
|
||||
body: body,
|
||||
onSuccess: (response, status) {
|
||||
if (status == 200) {
|
||||
var calledByNurse = (response["CalledByNurse"] as List).map((j) => Tickets.fromJson(j)).toList();
|
||||
log("calledByNurse Length: ${calledByNurse.length}");
|
||||
|
||||
final patients = (response["ClinicCurrentPatient"] as List).map((j) => Tickets.fromJson(j)).toList();
|
||||
log("patients Length: ${patients.length}");
|
||||
calledByNurse.addAll(patients);
|
||||
|
||||
|
||||
// calledByNurse.sort((a, b) => a.callNo.compareTo(b.callNo));
|
||||
|
||||
onSuccess(calledByNurse.reversed.toList());
|
||||
} else {
|
||||
onFailure(response);
|
||||
}
|
||||
},
|
||||
onFailure: (error, status) => onFailure(error));
|
||||
}
|
||||
|
||||
static callUpdateNotIsQueueRecordByIDAsync(String deviceIp, {@required Tickets ticket, @required Function(List<Tickets>) onSuccess, @required Function(dynamic) onFailure}) async {
|
||||
if (ticket.id == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Tickets> _ticketsUpdated = [];
|
||||
|
||||
// for (var ticket in tickets) {
|
||||
final body = {"CallID": ticket.id};
|
||||
await BaseAppClient.post(_call_UpdateNotIsQueueRecordByIDAsync,
|
||||
body: body,
|
||||
onSuccess: (response, status) {
|
||||
if (status == 200) {
|
||||
ticket.callUpdated = true;
|
||||
_ticketsUpdated.add(ticket);
|
||||
}
|
||||
},
|
||||
onFailure: (error, status) => onFailure(error));
|
||||
// }
|
||||
|
||||
if (_ticketsUpdated.isNotEmpty) {
|
||||
onSuccess(_ticketsUpdated);
|
||||
} else {
|
||||
onFailure(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
enum FontType {
|
||||
Poppins_Bold,
|
||||
poppins_Medium,
|
||||
poppins_Regular,
|
||||
poppins_SemiBold,
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
import 'dart:math';
|
||||
|
||||
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.callNoStr,
|
||||
this.queueNo,
|
||||
});
|
||||
|
||||
int getRandomNum() {
|
||||
return Random().nextInt(1);
|
||||
}
|
||||
|
||||
Tickets.fromJson(dynamic json) {
|
||||
id = json['ID'];
|
||||
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'];
|
||||
callNoStr = json['CallNoStr'] ?? json['CallNo'].toString();
|
||||
isAcknowledged = getRandomNum();
|
||||
}
|
||||
|
||||
int id;
|
||||
int callNo;
|
||||
String roomNo;
|
||||
int callType;
|
||||
String createdON;
|
||||
String doctorName;
|
||||
String doctorNameN;
|
||||
String editedON;
|
||||
String mobileNo;
|
||||
int patientGender;
|
||||
int patientID;
|
||||
String queueNo;
|
||||
String callNoStr;
|
||||
bool callUpdated = false;
|
||||
int isAcknowledged;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final map = <String, dynamic>{};
|
||||
map['ID'] = id;
|
||||
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['CallNoStr'] = callNoStr;
|
||||
map['QueueNo'] = queueNo;
|
||||
return map;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return (callNoStr).toString();
|
||||
}
|
||||
|
||||
CallType getCallType() {
|
||||
if (callType == 0) return CallType.RECEPTION;
|
||||
if (callType == 1) return CallType.NURSE;
|
||||
if (callType == 2) return CallType.DOCTOR;
|
||||
return CallType.NONE;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
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,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:queuing_system/core/config/config.dart';
|
||||
import 'package:queuing_system/utils/utils.dart';
|
||||
import 'package:queuing_system/widget/data_display/app_texts_widget.dart';
|
||||
|
||||
class AppHeader extends StatelessWidget with PreferredSizeWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 0,
|
||||
right: 5,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppGlobal.appRedColor, border: const Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
|
||||
child: Container(
|
||||
height: 100,
|
||||
padding: const EdgeInsets.only(left: 20, right: 20, bottom: 0,),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
AppText(
|
||||
" Current Serving",
|
||||
color: Colors.white,
|
||||
fontFamily: 'Poppins-SemiBold.ttf',
|
||||
|
||||
),
|
||||
SvgPicture.asset( "assets/images/hmglogo.svg", height: Utils.getHeight() * 0.5,),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size(
|
||||
double.maxFinite,
|
||||
Utils.getHeight());
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
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,34 +1,254 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:connectivity/connectivity.dart';
|
||||
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/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/header/app_header.dart';
|
||||
import 'package:queuing_system/home/home_screen_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';
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
var DEVICE_IP = "10.10.15.11"; // Testing IP
|
||||
// var DEVICE_IP = "10.10.14.11"; // Testing IP
|
||||
// var DEVICE_IP = "10.10.15.11";
|
||||
|
||||
// var DEVICE_IP = "10.70.249.21"; // (Make sure by Haroon before use it) Production IP
|
||||
|
||||
String title ="MyHomePage";
|
||||
class MyHomePage extends StatefulWidget {
|
||||
String title = "MyHomePage";
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
SignalRHelper signalRHelper = SignalRHelper();
|
||||
|
||||
List<Tickets> waitings = [];
|
||||
List<Tickets> currents = [];
|
||||
|
||||
bool isLoading = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
listenNetworkConnectivity();
|
||||
|
||||
if (!signalRHelper.getConnectionState()) {
|
||||
signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
TextEditingController controller = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SignalRHelper signalRHelper= SignalRHelper();
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
signalRHelper.msg,
|
||||
appBar: AppHeader(),
|
||||
body: content(),
|
||||
bottomNavigationBar: Container(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
height: Utils.getHeight(),
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const SizedBox(width: 60),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
)),
|
||||
const SizedBox(width: 30),
|
||||
isLoading
|
||||
? const CircularProgressIndicator()
|
||||
: ElevatedButton(
|
||||
onPressed: onUpdateIPPressed,
|
||||
child: const Text(
|
||||
"Update IP",
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appRedColor),
|
||||
),
|
||||
const SizedBox(width: 30),
|
||||
Text("IP: $DEVICE_IP", style: const TextStyle(fontWeight: FontWeight.w600)),
|
||||
const SizedBox(width: 20),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
onUpdateIPPressed() async {
|
||||
if (controller.text.isNotEmpty) {
|
||||
isLoading = true;
|
||||
setState(() {});
|
||||
DEVICE_IP = controller.text;
|
||||
|
||||
await signalRHelper.connection.stop();
|
||||
if (!signalRHelper.getConnectionState()) {
|
||||
await signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
|
||||
}
|
||||
|
||||
controller.clear();
|
||||
waitings.clear();
|
||||
isLoading = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
Widget content() {
|
||||
// waitings = waitings.sublist(0,3);
|
||||
voiceCall();
|
||||
|
||||
if (waitings.isEmpty) {
|
||||
// No Patient in Queue
|
||||
return noPatientInQueue();
|
||||
} else if (waitings.length > 4) {
|
||||
// Return Content With Side List
|
||||
return priorityTicketsWithSideList(waitings);
|
||||
} else {
|
||||
// Return Content In Center Aligned
|
||||
return priorityTickets(waitings);
|
||||
}
|
||||
}
|
||||
|
||||
String getCallTypeText(Tickets ticket) {
|
||||
final callType = ticket.getCallType();
|
||||
switch (callType) {
|
||||
case CallType.RECEPTION:
|
||||
return "Please Visit Doctor";
|
||||
break;
|
||||
case CallType.NURSE:
|
||||
return "Please Visit Nurse";
|
||||
break;
|
||||
case CallType.DOCTOR:
|
||||
return "Please Visit Doctor";
|
||||
break;
|
||||
case CallType.NONE:
|
||||
return "";
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
CallByVoice voiceCaller;
|
||||
|
||||
voiceCall() async {
|
||||
var j = {
|
||||
"ID": 4182,
|
||||
"PatientID": 123123,
|
||||
"MobileNo": "05***6794",
|
||||
"DoctorName": "Shakiera",
|
||||
"DoctorNameN": "Shakeria",
|
||||
"PatientGender": 1,
|
||||
"CallNo": 123,
|
||||
"callType": 1,
|
||||
"RoomNo": "10",
|
||||
"CreatedOn": "/Date(1673771382130+0300)/",
|
||||
"EditedOn": "/Date(1673771384500+0300)/",
|
||||
"CallNoStr": "A-5",
|
||||
"QueueNo": null
|
||||
};
|
||||
waitings = [Tickets.fromJson(j)];
|
||||
|
||||
if (waitings.isNotEmpty && voiceCaller == null) {
|
||||
final postVoice = getCallTypeText(waitings.first);
|
||||
voiceCaller = CallByVoice(waitings.first.callNoStr.toString(), preVoice: "Ticket Number", postVoice: postVoice, lang: 'en');
|
||||
await voiceCaller.startCalling();
|
||||
voiceCaller = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onUpdateAvailable(data) async {
|
||||
waitings.clear();
|
||||
API.getCallRequestInfoByClinicInfo(DEVICE_IP, onSuccess: (waitingCalls) {
|
||||
setState(() {
|
||||
waitings = waitingCalls;
|
||||
// currents = currentInClinic;
|
||||
});
|
||||
|
||||
log("\n\n");
|
||||
log("--------------------");
|
||||
log("waiting: $waitings");
|
||||
log("--------------------");
|
||||
log("\n\n");
|
||||
|
||||
updateTickets();
|
||||
}, onFailure: (error) {});
|
||||
}
|
||||
|
||||
updateTickets() {
|
||||
if (waitings != null && waitings.isNotEmpty) {
|
||||
List<Tickets> _ticketsToUpdate = waitings.where((t) => t.callUpdated == false).toList();
|
||||
API.callUpdateNotIsQueueRecordByIDAsync(DEVICE_IP, ticket: _ticketsToUpdate.first, onSuccess: (tickets_updated) {
|
||||
log("[${tickets_updated.length}] Tickets Updated: $tickets_updated");
|
||||
}, onFailure: (e) {
|
||||
log("API UPDate Tickets Failed with : ${e.toString()}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onConnect() {
|
||||
log("SignalR: onConnect");
|
||||
}
|
||||
|
||||
onDisconnect(exception) {
|
||||
log("SignalR: onDisconnect");
|
||||
// signalRHelper.startSignalRConnection(DEVICE_IP, onUpdateAvailable: onUpdateAvailable, onConnect: onConnect, onConnecting: onConnecting, onDisconnect: onDisconnect);
|
||||
}
|
||||
|
||||
onConnecting() {
|
||||
log("SignalR: onConnecting");
|
||||
}
|
||||
|
||||
listenNetworkConnectivity() async {
|
||||
Connectivity().onConnectivityChanged.listen((event) {
|
||||
switch (event) {
|
||||
case ConnectivityResult.wifi:
|
||||
signalRHelper.connection.start();
|
||||
break;
|
||||
case ConnectivityResult.none:
|
||||
signalRHelper.closeConnection(context);
|
||||
break;
|
||||
case ConnectivityResult.mobile:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,205 @@
|
||||
// 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){
|
||||
//
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
@ -0,0 +1,98 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.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: 2, child: PriorityTickets(priorityTickets)),
|
||||
Container(color: Colors.grey.withOpacity(0.1), width: 10, margin: const EdgeInsets.symmetric(horizontal: 10, 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 Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: SizeConfig.getWidthMultiplier() * 13,
|
||||
child: AppText(
|
||||
itm.callNoStr.toString(),
|
||||
letterSpacing: -2.32,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: SizeConfig.getWidthMultiplier() * 4.5,
|
||||
textAlign: TextAlign.end,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: SizeConfig.getWidthMultiplier() * 3.3,
|
||||
child: itm.getCallType().icon(SizeConfig.getHeightMultiplier() * 2.5),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: SizeConfig.getWidthMultiplier() * 29,
|
||||
child: AppText(
|
||||
itm.getCallType().message('en'),
|
||||
color: itm.getCallType().color(),
|
||||
letterSpacing: -1.5,
|
||||
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontHeight: 0.5,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
width: 6,
|
||||
height: SizeConfig.getHeightMultiplier() * 3,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
AppText(
|
||||
"Room: ${itm.roomNo}",
|
||||
color: itm.getCallType().color(),
|
||||
letterSpacing: -1.5,
|
||||
fontSize: SizeConfig.getWidthMultiplier() * 3.3,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontHeight: 0.5,
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
import 'package:blinking_text/blinking_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:queuing_system/core/config/size_config.dart';
|
||||
import 'package:queuing_system/core/response_model/patient_call.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: [
|
||||
const SizedBox(height: 20),
|
||||
vTicketItem(
|
||||
ticketNo: firstTicket.callNoStr ?? '',
|
||||
callType: firstTicket.getCallType(),
|
||||
scale: 1,
|
||||
blink: true,
|
||||
roomNo: firstTicket.roomNo,
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
if (tickets.length > 1) ...[
|
||||
SizedBox(height: SizeConfig.getHeightMultiplier() * 1.5),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: otherTickets
|
||||
.map((ticket) => Padding(
|
||||
padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2),
|
||||
child: vTicketItem(
|
||||
ticketNo: ticket.callNoStr ?? '',
|
||||
callType: ticket.getCallType(),
|
||||
scale: 0.7,
|
||||
roomNo: ticket.roomNo,
|
||||
),
|
||||
))
|
||||
.toList(),
|
||||
)
|
||||
]
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class vTicketItem extends StatelessWidget {
|
||||
final String ticketNo;
|
||||
final String roomNo;
|
||||
final CallType callType;
|
||||
final bool blink;
|
||||
final double scale;
|
||||
|
||||
const vTicketItem({@required this.ticketNo, @required this.roomNo, @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() * 10, 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,
|
||||
// ),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
callType.icon(SizeConfig.getHeightMultiplier() * 3),
|
||||
const SizedBox(width: 10),
|
||||
AppText(
|
||||
callType.message('en'),
|
||||
color: callType.color(),
|
||||
letterSpacing: -1.5,
|
||||
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontHeight: 0.5,
|
||||
),
|
||||
Container(
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
width: 6,
|
||||
height: SizeConfig.getHeightMultiplier() * 3,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
AppText(
|
||||
"Room: $roomNo",
|
||||
color: callType.color(),
|
||||
letterSpacing: -1.5,
|
||||
fontSize: SizeConfig.getWidthMultiplier() * 3.8,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontHeight: 0.5,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
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',
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
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',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
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,),
|
||||
|
||||
],),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_tts/flutter_tts.dart';
|
||||
|
||||
class CallByVoice {
|
||||
final String lang;
|
||||
final String preVoice;
|
||||
final String ticketNo;
|
||||
final String postVoice;
|
||||
|
||||
CallByVoice(this.ticketNo, {this.lang = 'en', @required this.preVoice, @required this.postVoice});
|
||||
|
||||
final FlutterTts textToSpeech = FlutterTts();
|
||||
|
||||
double volume = 1.0;
|
||||
double pitch = 0.9;
|
||||
double rate = 0.5;
|
||||
|
||||
Future<dynamic> _getLanguages() async => await textToSpeech.getLanguages;
|
||||
|
||||
startCalling() async {
|
||||
log("languages: ${await _getLanguages()}");
|
||||
log("no: $ticketNo");
|
||||
textToSpeech.setLanguage("en-US");
|
||||
var splitText = ticketNo.split("-");
|
||||
// Create Pre Voice Players
|
||||
if (preVoice != null && preVoice.isNotEmpty) {
|
||||
textToSpeech.setSpeechRate(rate);
|
||||
textToSpeech.setPitch(pitch);
|
||||
textToSpeech.setVolume(volume);
|
||||
await textToSpeech.speak(preVoice + " .. " + splitText[0] + " .. " + splitText[1] + " .. " + postVoice);
|
||||
}
|
||||
|
||||
// // Create Ticket Number Voice Players
|
||||
// final characters = ticketNo.characters.toList();
|
||||
// for (int i = 0; i < characters.length; i++) {
|
||||
// final no = characters[i];
|
||||
// if (no.isNotEmpty && no != "-" && no != "_" && no != " ") {
|
||||
//
|
||||
// await _player.stop();
|
||||
// await _player.setAsset('assets/voice_$lang/${no.toUpperCase()}.mp3');
|
||||
// await _player.play();
|
||||
// }
|
||||
// }
|
||||
|
||||
// Create Post Voice Players
|
||||
// if (postVoice != null && postVoice.isNotEmpty) {
|
||||
// await Future.delayed(const Duration(milliseconds: 1000));
|
||||
//
|
||||
// await _player.stop();
|
||||
// await _player.setAsset('assets/voice_$lang/$postVoice');
|
||||
// await _player.play();
|
||||
// }
|
||||
}
|
||||
|
||||
// stop() async {
|
||||
// await _player.stop();
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:queuing_system/core/config/config.dart';
|
||||
|
||||
enum CallType{
|
||||
RECEPTION,
|
||||
NURSE,
|
||||
DOCTOR,
|
||||
NONE,
|
||||
}
|
||||
|
||||
extension xCallType on CallType{
|
||||
|
||||
Color color(){
|
||||
if(this == CallType.RECEPTION) {
|
||||
return AppGlobal.appRedColor;
|
||||
}else if(this == CallType.NURSE) {
|
||||
return AppGlobal.appGreenColor;
|
||||
}else if(this == CallType.DOCTOR) {
|
||||
return AppGlobal.appRedColor ;
|
||||
}else{
|
||||
return Colors.black54;
|
||||
}
|
||||
}
|
||||
|
||||
SvgPicture icon(double height,){
|
||||
if(this == CallType.RECEPTION) {
|
||||
return SvgPicture.asset("assets/images/doctoricon.svg", height: height, color: color());
|
||||
}else if(this == CallType.NURSE) {
|
||||
return SvgPicture.asset("assets/images/nurseicon.svg", height: height, color: color());
|
||||
}else if(this == CallType.DOCTOR) {
|
||||
return SvgPicture.asset("assets/images/doctoricon.svg", height: height, color: color());
|
||||
}
|
||||
return SvgPicture.asset("assets/images/wait.svg", height: height, color: color());;
|
||||
}
|
||||
|
||||
String message(String lang){
|
||||
if(this == CallType.RECEPTION) {
|
||||
return "Please visit reception";
|
||||
}else if(this == CallType.NURSE) {
|
||||
return "Please visit nurse";
|
||||
}else if(this == CallType.DOCTOR) {
|
||||
return "Please visit doctor";
|
||||
}
|
||||
return "Please wait . . .";
|
||||
}
|
||||
|
||||
String audio(String lang){
|
||||
if(this == CallType.RECEPTION) {
|
||||
return "visit_doctor.mp3";
|
||||
}else if(this == CallType.NURSE) {
|
||||
return "visit_nurse.mp3";
|
||||
}else if(this == CallType.DOCTOR) {
|
||||
return "visit_doctor.mp3";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@ -1,29 +1,81 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:http/io_client.dart';
|
||||
import 'package:signalr_core/signalr_core.dart';
|
||||
|
||||
class SignalRHelper{
|
||||
/*
|
||||
https://vcallapi.hmg.com/patientcalling.html?IPAddress=10.10.14.20&Clinic=4&Project=15
|
||||
|
||||
---------------------------------------
|
||||
IP, Clinic, Project Mapping to SignalR
|
||||
---------------------------------------
|
||||
(SignalR: 10.10.14.11) <<<< [IP=10.10.14.20 | Clinic=4 | Project=15]
|
||||
(SignalR: 10.70.249.21) <<<< [IP=10.10.14.20 | Clinic=3 | Project=16]
|
||||
---------------------------------------
|
||||
*/
|
||||
|
||||
String hubBaseURL ="";
|
||||
String msg ="Elham";
|
||||
class SignalRHelper{
|
||||
String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub";
|
||||
// String hubBaseURL = "https://vcallapi.hmg.com/PatientCallingHub?IPAddress=10.10.14.20";
|
||||
// "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273";
|
||||
String msg ="Awaiting Patients Arrival";
|
||||
HubConnection connection;
|
||||
SignalRHelper(){
|
||||
|
||||
startSignalRConnection(String deviceIp, {@required Function(dynamic) onUpdateAvailable, @required VoidCallback onConnect, @required Function(dynamic) onDisconnect, @required VoidCallback onConnecting}) async {
|
||||
|
||||
// Hardcoded IP For Testing
|
||||
// deviceIp = "10.10.14.11";
|
||||
print("Connecting Signal R with: $deviceIp");
|
||||
|
||||
final url = hubBaseURL+"?IPAddress=$deviceIp";
|
||||
connection = HubConnectionBuilder()
|
||||
.withUrl(
|
||||
hubBaseURL,
|
||||
url,
|
||||
HttpConnectionOptions(
|
||||
logging: (level, message) {
|
||||
msg = message;
|
||||
print("$message");
|
||||
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
|
||||
transport: HttpTransportType.webSockets,
|
||||
logging: (level, message) => {
|
||||
print(message)
|
||||
},
|
||||
)
|
||||
).build();
|
||||
))
|
||||
.build();
|
||||
|
||||
connection.onclose(onDisconnect);
|
||||
connection.onreconnecting((exception) => onConnecting());
|
||||
connection.onreconnected((connectionId) => onConnect());
|
||||
|
||||
connection.on('addChatMessage', (message) {
|
||||
onUpdateAvailable(message);
|
||||
});
|
||||
|
||||
await connection.start();
|
||||
|
||||
}
|
||||
|
||||
void sendMessage(List<dynamic> args) async {
|
||||
await connection.invoke('SendMessage', args: args); //['Bob', 'Says hi!']
|
||||
}
|
||||
|
||||
bool getConnectionState() {
|
||||
if(connection == null ) return false;
|
||||
if (connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting) return true;
|
||||
if (connection.state == HubConnectionState.disconnected || connection.state == HubConnectionState.disconnecting) return false;
|
||||
}
|
||||
|
||||
|
||||
closeConnection(BuildContext context) async {
|
||||
if(connection.state == HubConnectionState.connected)
|
||||
if(connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting)
|
||||
{
|
||||
await connection.stop();
|
||||
}
|
||||
}
|
||||
|
||||
startConnection(BuildContext context) async {
|
||||
if(connection.state == HubConnectionState.connected || connection.state == HubConnectionState.connecting)
|
||||
{
|
||||
connection.off('addChatMessage');
|
||||
await connection.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue