overflow issue and model mapped

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

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

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:doctor_app_flutter/client/base_app_client.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_pending_res_list.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/helpers.dart';
@ -12,7 +13,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
class LiveCareProvider with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
var liveCarePendingList = [];
List<LiveCarePendingListResponse> liveCarePendingList = [];
var inCallResponse = {};
bool isFinished = true;
bool hasError = false;
@ -33,7 +34,10 @@ class LiveCareProvider with ChangeNotifier {
await BaseAppClient.post(GET_LIVECARE_PENDINGLIST,
onSuccess: (response, statusCode) async {
isFinished = true;
liveCarePendingList = response["List_PendingPatientList"];
liveCarePendingList = [];
response['List_PendingPatientList'].forEach((v) {
liveCarePendingList.add(new LiveCarePendingListResponse.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
isFinished = true;
throw error;

@ -29,14 +29,18 @@ class LiveCarePandingListScreen extends StatefulWidget {
}
class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
var _data = [];
List<LiveCarePendingListResponse> _data = [];
Helpers helpers = new Helpers();
bool _isInit = true;
LiveCareProvider _liveCareProvider;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
_liveCareProvider = Provider.of<LiveCareProvider>(context);
if (_data.isEmpty) pendingList();
pendingList();
}
_isInit = false;
}
@override
@ -63,7 +67,8 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
),
)
: Column(
children: _data.map<Widget>((item) {
children: _liveCareProvider.liveCarePendingList
.map<Widget>((item) {
return Container(
decoration: myBoxDecoration(),
child: InkWell(
@ -73,6 +78,10 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
children: <Widget>[
Container(
// decoration: myBoxDecoration(),
child: Row(
children: <Widget>[
Expanded(
flex: 4,
child: Row(
children: <Widget>[
Column(
@ -80,16 +89,12 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
Container(
decoration:
BoxDecoration(
gradient:
LinearGradient(
begin:
Alignment(
gradient: LinearGradient(
begin: Alignment(
-1,
-1),
end:
Alignment(
1,
1),
end: Alignment(
1, 1),
colors: [
Colors.grey[
100],
@ -98,14 +103,12 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
]),
boxShadow: [
BoxShadow(
color: Color
.fromRGBO(
color: Color.fromRGBO(
0,
0,
0,
0.08),
offset:
Offset(
offset: Offset(
0.0,
5.0),
blurRadius:
@ -119,9 +122,10 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
width: 80,
height: 80,
child: Icon(
item["Gender"] ==
item.gender ==
"1"
? DoctorApp.male
? DoctorApp
.male
: DoctorApp
.femaleicon,
size: 80,
@ -137,12 +141,13 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
.start,
children: <Widget>[
AppText(
item["PatientName"],
item.patientName,
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
FontWeight
.bold,
backGroundcolor:
Colors.white,
),
@ -153,13 +158,14 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
TranslationBase.of(
context)
.fileNo +
item["PatientID"]
item.patientID
.toString(),
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
FontWeight
.bold,
backGroundcolor:
Colors.white,
),
@ -172,13 +178,14 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
context)
.age +
' ' +
item["Age"]
item.age
.toString(),
fontSize: 2.0 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
FontWeight
.bold,
backGroundcolor:
Colors.white,
),
@ -187,12 +194,11 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
),
],
),
SizedBox(
width: 80,
],
),
),
// Divider(color: Colors.grey
Expanded(
flex: 3,
flex: 1,
child: IconButton(
icon: Icon(
Icons.video_call,
@ -230,51 +236,6 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
_liveCareProvider.getpendingList().then((result) {
this.setState(() {
_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;

Loading…
Cancel
Save