overflow issue and model mapped

merge-requests/143/head
Sultan Khan 4 years ago
parent dd3154a498
commit 3b0aff2efa

@ -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;
@ -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;

@ -29,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
@ -63,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(
@ -75,124 +80,125 @@ 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( // SizedBox(
// height: 8, // height: 8,
// ), // ),
AppText( AppText(
TranslationBase.of( TranslationBase.of(
context) context)
.age + .age +
' ' + ' ' +
item["Age"] item.age
.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( ),
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,
@ -230,51 +236,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;

Loading…
Cancel
Save