Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!143
merge-requests/144/merge
Mohammad Aljammal 6 years ago
commit 9dc1c27334

@ -1,24 +1,24 @@
class LiveCarePendingListResponse { class LiveCarePendingListResponse {
Null acceptedBy; dynamic acceptedBy;
Null acceptedOn; dynamic acceptedOn;
int age; int age;
Null appointmentNo; dynamic appointmentNo;
String arrivalTime; String arrivalTime;
String arrivalTimeD; String arrivalTimeD;
int callStatus; int callStatus;
String clientRequestID; String clientRequestID;
String clinicName; String clinicName;
Null consoltationEnd; dynamic consoltationEnd;
Null consultationNotes; dynamic consultationNotes;
Null createdOn; dynamic createdOn;
String dateOfBirth; String dateOfBirth;
String deviceToken; String deviceToken;
String deviceType; String deviceType;
Null doctorName; dynamic doctorName;
String editOn; String editOn;
String gender; String gender;
bool isFollowUP; bool isFollowUP;
Null isFromVida; dynamic isFromVida;
int isLoginB; int isLoginB;
bool isOutKSA; bool isOutKSA;
int isRejected; int isRejected;
@ -26,16 +26,16 @@ class LiveCarePendingListResponse {
double latitude; double latitude;
double longitude; double longitude;
String mobileNumber; String mobileNumber;
Null openSession; dynamic openSession;
Null openTokenID; dynamic openTokenID;
String patientID; String patientID;
String patientName; String patientName;
int patientStatus; int patientStatus;
String preferredLanguage; String preferredLanguage;
int projectID; int projectID;
int scoring; double scoring;
int serviceID; int serviceID;
Null tokenID; dynamic tokenID;
int vCID; int vCID;
String voipToken; String voipToken;

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart'; import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart';
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -12,7 +13,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
class LiveCareProvider with ChangeNotifier { class LiveCareProvider with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
var liveCarePendingList = []; List<LiveCarePendingListResponse> liveCarePendingList = [];
var inCallResponse = {}; var inCallResponse = {};
bool isFinished = true; bool isFinished = true;
bool hasError = false; bool hasError = false;
@ -25,7 +26,7 @@ class LiveCareProvider with ChangeNotifier {
var profile = await sharedPref.getObj(DOCTOR_PROFILE); var profile = await sharedPref.getObj(DOCTOR_PROFILE);
_pendingRequestModel.projectID = await sharedPref.getInt(PROJECT_ID); _pendingRequestModel.projectID = await sharedPref.getInt(PROJECT_ID);
_pendingRequestModel.doctorID = profile['DoctorID']; _pendingRequestModel.doctorID = profile['DoctorID'];
_pendingRequestModel.sErServiceID = "1,3"; _pendingRequestModel.sErServiceID = "1,3,7";
_pendingRequestModel.sourceID = 1; _pendingRequestModel.sourceID = 1;
_pendingRequestModel.patientData = PatientData(isOutKSA: false); _pendingRequestModel.patientData = PatientData(isOutKSA: false);
resetDefaultValues(); resetDefaultValues();
@ -33,7 +34,10 @@ class LiveCareProvider with ChangeNotifier {
await BaseAppClient.post(GET_LIVECARE_PENDINGLIST, await BaseAppClient.post(GET_LIVECARE_PENDINGLIST,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
isFinished = true; isFinished = true;
liveCarePendingList = response["List_PendingPatientList"]; liveCarePendingList = [];
response['List_PendingPatientList'].forEach((v) {
liveCarePendingList.add(new LiveCarePendingListResponse.fromJson(v));
});
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
isFinished = true; isFinished = true;
throw error; throw error;

@ -1,6 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/livecare_provider.dart'; import 'package:doctor_app_flutter/providers/livecare_provider.dart';
import 'package:doctor_app_flutter/util/VideoChannel.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -30,14 +29,18 @@ class LiveCarePandingListScreen extends StatefulWidget {
} }
class _LiveCarePandingListState extends State<LiveCarePandingListScreen> { class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
var _data = []; List<LiveCarePendingListResponse> _data = [];
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
bool _isInit = true;
LiveCareProvider _liveCareProvider; LiveCareProvider _liveCareProvider;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
_liveCareProvider = Provider.of<LiveCareProvider>(context); if (_isInit) {
if (_data.isEmpty) pendingList(); _liveCareProvider = Provider.of<LiveCareProvider>(context);
pendingList();
}
_isInit = false;
} }
@override @override
@ -64,7 +67,8 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
), ),
) )
: Column( : Column(
children: _data.map<Widget>((item) { children: _liveCareProvider.liveCarePendingList
.map<Widget>((item) {
return Container( return Container(
decoration: myBoxDecoration(), decoration: myBoxDecoration(),
child: InkWell( child: InkWell(
@ -76,124 +80,121 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
// decoration: myBoxDecoration(), // decoration: myBoxDecoration(),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Column( Expanded(
children: <Widget>[ flex: 4,
Container( child: Row(
decoration: children: <Widget>[
BoxDecoration( Column(
gradient: children: <Widget>[
LinearGradient( Container(
begin: decoration:
Alignment( BoxDecoration(
-1, gradient: LinearGradient(
-1), begin: Alignment(
end: -1,
Alignment( -1),
1, end: Alignment(
1), 1, 1),
colors: [ colors: [
Colors.grey[ Colors.grey[
100], 100],
Colors.grey[ Colors.grey[
200], 200],
]), ]),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color color: Color.fromRGBO(
.fromRGBO( 0,
0, 0,
0, 0,
0, 0.08),
0.08), offset: Offset(
offset: 0.0,
Offset( 5.0),
0.0, blurRadius:
5.0), 16.0)
blurRadius: ],
16.0) borderRadius:
], BorderRadius.all(
borderRadius: Radius.circular(
BorderRadius.all( 50.0)),
Radius.circular( ),
50.0)), width: 80,
), height: 80,
width: 80, child: Icon(
height: 80, item.gender ==
child: Icon( "1"
item["Gender"] == ? DoctorApp
"1" .male
? DoctorApp.male : DoctorApp
: DoctorApp .femaleicon,
.femaleicon, size: 80,
size: 80, )),
)), ],
], ),
), SizedBox(
SizedBox( width: 20,
width: 20, ),
), Column(
Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment
CrossAxisAlignment .start,
.start, children: <Widget>[
children: <Widget>[ AppText(
AppText( item.patientName,
item["PatientName"], fontSize: 2.0 *
fontSize: 2.0 * SizeConfig
SizeConfig .textMultiplier,
.textMultiplier, fontWeight:
fontWeight: FontWeight
FontWeight.bold, .bold,
backGroundcolor: backGroundcolor:
Colors.white, Colors.white,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
AppText( AppText(
TranslationBase.of( TranslationBase.of(
context) context)
.fileNo + .fileNo +
item["PatientID"] item.patientID
.toString(), .toString(),
fontSize: 2.0 * fontSize: 2.0 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
fontWeight: fontWeight:
FontWeight.bold, FontWeight
backGroundcolor: .bold,
Colors.white, backGroundcolor:
), Colors.white,
),
// SizedBox( AppText(
// height: 8, TranslationBase.of(
// ), context)
AppText( .age +
TranslationBase.of( ' ' +
context) item.age
.age + .toString(),
' ' + fontSize: 2.0 *
item["Age"] SizeConfig
.toString(), .textMultiplier,
fontSize: 2.0 * fontWeight:
SizeConfig FontWeight
.textMultiplier, .bold,
fontWeight: backGroundcolor:
FontWeight.bold, Colors.white,
backGroundcolor: ),
Colors.white, SizedBox(
), height: 8,
SizedBox( ),
height: 8, ],
), ),
], ],
), ),
SizedBox(
width: 80,
), ),
// Divider(color: Colors.grey
Expanded( Expanded(
flex: 3, flex: 1,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.video_call, Icons.video_call,
@ -202,8 +203,7 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
color: Colors color: Colors
.green, //Colors.black, .green, //Colors.black,
onPressed: () => { onPressed: () => {
_isInit = true,
sharedPref.setObj( sharedPref.setObj(
LIVE_CARE_PATIENT, LIVE_CARE_PATIENT,
item), item),
@ -220,15 +220,7 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
], ],
), ),
), ),
onTap: () { onTap: () {},
sharedPref.setObj(
LIVE_CARE_PATIENT,
item);
Navigator.of(context)
.pushNamed(
VIDEO_CALL);
},
), ),
); );
}).toList(), }).toList(),
@ -241,51 +233,6 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
_liveCareProvider.getpendingList().then((result) { _liveCareProvider.getpendingList().then((result) {
this.setState(() { this.setState(() {
_data = _liveCareProvider.liveCarePendingList; _data = _liveCareProvider.liveCarePendingList;
// _data = [
// {
// "AcceptedBy": null,
// "AcceptedOn": null,
// "Age": 33,
// "AppointmentNo": null,
// "ArrivalTime": "2020-06-14 09:34",
// "ArrivalTimeD": "/Date(1592116471237+0300)/",
// "CallStatus": 1,
// "ClientRequestID": "2344670985-1231755-1584378710",
// "ClinicName": "ER Clinic",
// "ConsoltationEnd": null,
// "ConsultationNotes": null,
// "CreatedOn": null,
// "DateOfBirth": "1987-01-04",
// "DeviceToken":
// "fbxt2XpseU_DpO8Msqa1V6:APA91bHUxsfKpAewTt0DzGg_mSTN0T7KIQM92VpubUTobgTm0-DGcJMgcc3DmERbEiWbyTup3zGttU3_9RBaRBxZUKj9ju5wnTGSrIelEE-qxOK30YnIaDhbhs8fJixACbyzgr72HU8Y",
// "DeviceType": "iOS",
// "DoctorName": null,
// "EditOn": "/Date(1592116471237+0300)/",
// "Gender": "1",
// "IsFollowUP": false,
// "IsFromVida": null,
// "IsLoginB": 0,
// "IsOutKSA": false,
// "IsRejected": 0,
// "Language": "AR",
// "Latitude": 24.708879,
// "Longitude": 46.665827,
// "MobileNumber": "0537503378",
// "OpenSession": null,
// "OpenTokenID": null,
// "PatientID": "1231755",
// "PatientName": "TAMER FANASHEH",
// "PatientStatus": 1,
// "PreferredLanguage": "Ar",
// "ProjectID": 0,
// "Scoring": 0.00,
// "ServiceID": 1,
// "TokenID": null,
// "VC_ID": 2240,
// "VoipToken":
// "8dcc17e2365d4f3c4afadc6b5d625a88407398ee517f0e9beda7f663007e88b9"
// }
// ];
}); });
}); });
return true; return true;

@ -22,7 +22,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
String _timmer = ''; String _timmer = '';
LiveCareProvider _liveCareProvider; LiveCareProvider _liveCareProvider;
bool _isInit = true; bool _isInit = true;
var _tokenData; var _tokenData;
var patientData = {}; var patientData = {};
String image_url = 'https://hmgwebservices.com/Images/MobileImages/DUBAI/'; String image_url = 'https://hmgwebservices.com/Images/MobileImages/DUBAI/';
//bool _isOutOfStuck = false; //bool _isOutOfStuck = false;
@ -41,11 +41,11 @@ class _VideoCallPageState extends State<VideoCallPage> {
_tokenData = tokenData; _tokenData = tokenData;
/* opentok functionalites need to be written */ /* opentok functionalites need to be written */
VideoChannel.openVideoCallScreen(kApiKey: '46209962', VideoChannel.openVideoCallScreen(
kApiKey: '46209962',
kSessionId: _tokenData["OpenSessionID"], kSessionId: _tokenData["OpenSessionID"],
kToken: _tokenData["OpenTokenID"], kToken: _tokenData["OpenTokenID"],
); );
} }
String getTimerTime(int start) { String getTimerTime(int start) {
@ -74,12 +74,6 @@ class _VideoCallPageState extends State<VideoCallPage> {
{helpers.showErrorToast(error), Navigator.of(context).pop()}); {helpers.showErrorToast(error), Navigator.of(context).pop()});
} }
// @override
// void initState() {
// super.initState();
// }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -90,8 +84,8 @@ class _VideoCallPageState extends State<VideoCallPage> {
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 1.09, height: MediaQuery.of(context).size.height,
// width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
@ -105,7 +99,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
height: 10.0, height: 10.0,
), ),
Text( Text(
'Calling', 'Dailing...',
style: TextStyle( style: TextStyle(
color: Colors.deepPurpleAccent, color: Colors.deepPurpleAccent,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
@ -146,58 +140,25 @@ class _VideoCallPageState extends State<VideoCallPage> {
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.02, height: MediaQuery.of(context).size.height * .2,
), ),
Row( Container(
mainAxisSize: MainAxisSize.max, width: 70.0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, height: 70.0,
crossAxisAlignment: CrossAxisAlignment.center, child: FloatingActionButton(
children: <Widget>[
FunctionalButton(
title: 'Speaker',
icon: Icons.phone_in_talk,
onPressed: () { onPressed: () {
Navigator.of(context).pop();
print(_tokenData["OpenSessionID"]);
print(_tokenData["OpenTokenID"]);
VideoChannel.openVideoCallScreen(kApiKey: '46209962',
kSessionId: _tokenData["OpenSessionID"],
kToken: _tokenData["OpenTokenID"],
);
}, },
), elevation: 30.0,
FunctionalButton( shape: CircleBorder(side: BorderSide(color: Colors.red)),
title: 'Flip', mini: false,
icon: Icons.flip_to_back, child: Icon(
onPressed: () {}, Icons.call_end,
), color: Colors.red,
FunctionalButton( size: 35,
title: 'Mute', ),
icon: Icons.mic_off, backgroundColor: Colors.red[100],
onPressed: () {}, ))
),
],
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.1,
),
FloatingActionButton(
onPressed: () {
Navigator.of(context).pop();
},
elevation: 20.0,
shape: CircleBorder(side: BorderSide(color: Colors.red)),
mini: false,
child: Icon(
Icons.call_end,
color: Colors.red,
),
backgroundColor: Colors.red[100],
)
], ],
), ),
), ),

Loading…
Cancel
Save