import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/providers/livecare_provider.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/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import '../../config/size_config.dart'; import '../../config/size_config.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import '../../routes.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class LiveCarePandingListScreen extends StatefulWidget { // In the constructor, require a item id. LiveCarePandingListScreen({Key key}) : super(key: key); @override _LiveCarePandingListState createState() => _LiveCarePandingListState(); } class _LiveCarePandingListState extends State { var _data = []; Helpers helpers = new Helpers(); LiveCareProvider _liveCareProvider; @override void didChangeDependencies() { super.didChangeDependencies(); _liveCareProvider = Provider.of(context); if (_data.isEmpty) pendingList(); } @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).livecare, body: Container( child: ListView(scrollDirection: Axis.vertical, // physics: const AlwaysScrollableScrollPhysics(), children: [ RoundedContainer( child: !_liveCareProvider.isFinished ? Container( height: SizeConfig.screenHeight, width: SizeConfig.screenWidth, child: DrAppCircularProgressIndeicator()) : _liveCareProvider.hasError ? Center( child: Text( _liveCareProvider.errorMsg, style: TextStyle( color: Theme.of(context).errorColor), ), ) : Column( children: _data.map((item) { return Container( decoration: myBoxDecoration(), child: InkWell( child: CardWithBgWidgetNew( //CardWithBgWidget( widget: Column( children: [ Container( // decoration: myBoxDecoration(), child: Row( children: [ Column( children: [ Container( decoration: BoxDecoration( gradient: LinearGradient( begin: Alignment( -1, -1), end: Alignment( 1, 1), colors: [ Colors.grey[ 100], Colors.grey[ 200], ]), boxShadow: [ BoxShadow( color: Color .fromRGBO( 0, 0, 0, 0.08), offset: Offset( 0.0, 5.0), blurRadius: 16.0) ], borderRadius: BorderRadius.all( Radius.circular( 50.0)), ), width: 80, height: 80, child: Icon( item["Gender"] == "1" ? DoctorApp.male : DoctorApp .femaleicon, size: 80, )), ], ), SizedBox( width: 20, ), Column( crossAxisAlignment: CrossAxisAlignment .start, children: [ AppText( item["PatientName"], fontSize: 2.0 * SizeConfig .textMultiplier, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), SizedBox( height: 8, ), AppText( TranslationBase.of( context) .fileNo + item["PatientID"] .toString(), fontSize: 2.0 * SizeConfig .textMultiplier, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), // SizedBox( // height: 8, // ), AppText( TranslationBase.of( context) .age + ' ' + item["Age"] .toString(), fontSize: 2.0 * SizeConfig .textMultiplier, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), SizedBox( height: 8, ), ], ), SizedBox( width: 80, ), // Divider(color: Colors.grey Expanded( flex: 3, child: IconButton( icon: Icon( Icons.video_call, size: 40, ), color: Colors .green, //Colors.black, onPressed: () => { sharedPref.setObj( LIVE_CARE_PATIENT, item), Navigator.of(context) .pushNamed( VIDEO_CALL) }, ), ) ], ), ), // Divider(color: Colors.grey) ], ), ), onTap: () {}, ), ); }).toList(), )) ]), )); } Future pendingList() async { _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; } myBoxDecoration() { return BoxDecoration( border: Border( bottom: BorderSide( // <--- top side color: Colors.grey, width: 1.0, ), ), ); } }