diff --git a/lib/config/config.dart b/lib/config/config.dart index 0c554090..90c37129 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -64,7 +64,9 @@ const GET_FINDUS_REQUEST= 'Services/Lists.svc/REST/Get_HMG_Locations'; - +///LiveChat +const GET_LIVECHAT_REQUEST= + 'Services/Patients.svc/REST/GetPatientICProjects'; ///Reports diff --git a/lib/core/model/contactus/get_patientI_cprojects.dart b/lib/core/model/contactus/get_patientI_cprojects.dart new file mode 100644 index 00000000..e9a6b712 --- /dev/null +++ b/lib/core/model/contactus/get_patientI_cprojects.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; + +class GetPatientICProjectsModel { + int id; + String projectName; + String projectNameN; + String value; + dynamic languageId; + DateTime createdOn; + String createdBy; + dynamic editedOn; + dynamic editedBy; + bool isActive; + + GetPatientICProjectsModel( + {this.id, + this.projectName, + this.projectNameN, + this.value, + this.languageId, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy, + this.isActive}); + + GetPatientICProjectsModel.fromJson(Map json) { + id = json['id']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + value = json['Value']; + languageId = json['LanguageId']; + createdOn = DateUtil.convertStringToDate(json['CreatedOn']); + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['Value'] = this.value; + data['LanguageId'] = this.languageId; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['IsActive'] = this.isActive; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/contactus/finadus_service.dart b/lib/core/service/contactus/finadus_service.dart index dae46666..4086def9 100644 --- a/lib/core/service/contactus/finadus_service.dart +++ b/lib/core/service/contactus/finadus_service.dart @@ -4,8 +4,7 @@ import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart import '../base_service.dart'; class FindusService extends BaseService { - //List AmModelList = List(); - //Map body = Map(); + List FindusModelList = List(); List FindusHospitalModelList = List(); diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart new file mode 100644 index 00000000..ae8fabc9 --- /dev/null +++ b/lib/core/service/contactus/livechat_service.dart @@ -0,0 +1,39 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import '../base_service.dart'; + +class LiveChatService extends BaseService{ + + + + + List LivechatModelList=List(); + + + Map body = Map(); + + + + Future getAllLiveChatOrders() async { + hasError = false; + body['List_PatientICProjects'] =false; + await baseAppClient.post(GET_LIVECHAT_REQUEST, + onSuccess: (dynamic response, int statusCode) { + LivechatModelList.clear(); + + + response['List_PatientICProjects'].forEach((vital) { + + LivechatModelList.add(GetPatientICProjectsModel.fromJson(vital)); + + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + +} \ No newline at end of file diff --git a/lib/core/viewModels/contactus/livechat_view_model.dart b/lib/core/viewModels/contactus/livechat_view_model.dart new file mode 100644 index 00000000..8df4e801 --- /dev/null +++ b/lib/core/viewModels/contactus/livechat_view_model.dart @@ -0,0 +1,33 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/contactus/get_patientI_cprojects.dart'; +import 'package:diplomaticquarterapp/core/service/contactus/livechat_service.dart'; +import '../base_view_model.dart'; +import '../../../locator.dart'; + + +class LiveChatViewModel extends BaseViewModel{ + + + + LiveChatService _liveChatService =locator(); + + List get LiveChatModelList=> + + _liveChatService.LivechatModelList; + + + getLiveChatRequestOrders() async { + setState(ViewState.Busy); + + await _liveChatService.getAllLiveChatOrders(); + + if (_liveChatService.hasError) { + error = _liveChatService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 6ef9589a..072370b7 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -5,6 +5,7 @@ import 'package:get_it/get_it.dart'; import 'core/service/appointment_rate_service.dart'; import 'core/service/contactus/finadus_service.dart'; +import 'core/service/contactus/livechat_service.dart'; import 'core/service/dashboard_service.dart'; import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; @@ -21,6 +22,7 @@ import 'core/service/medical/reports_monthly_service.dart'; import 'core/service/medical/vital_sign_service.dart'; import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/contactus/findus_view_model.dart'; +import 'core/viewModels/contactus/livechat_view_model.dart'; import 'core/viewModels/er/am_request_view_model.dart'; import 'core/viewModels/er/near_hospital_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; @@ -73,6 +75,7 @@ void setupLocator() { locator.registerLazySingleton(() => PatientSickLeaveService()); locator.registerLazySingleton(() => MyBalanceService()); locator.registerLazySingleton(() => FindusService()); + locator.registerLazySingleton(() => LiveChatService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -96,5 +99,6 @@ void setupLocator() { locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); locator.registerFactory(() => FindusViewModel()); + locator.registerFactory(() => LiveChatViewModel()); } diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart new file mode 100644 index 00000000..66ad31ee --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -0,0 +1,169 @@ +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class HospitalsLiveChatPage extends StatefulWidget { + @override + _HospitalsLiveChatPageState createState() => _HospitalsLiveChatPageState(); +} + +class _HospitalsLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() { + super.initState(); + tappedIndex = -1; + chat = ""; + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLiveChatRequestOrders(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Column( + children: [ + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + height: 200, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/dashboard_top_bg.png'), + fit: BoxFit.cover), + ), + child: Texts( + 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', + color: Colors.white, + textAlign: TextAlign.center, + ), + ), + /////////// + ...List.generate( + model.LiveChatModelList.length, + (index) => Container( + margin: + EdgeInsets.only(left: 20, right: 20, bottom: 20), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: tappedIndex == index + ? Colors.red + : Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + setState(() { + tappedIndex = index; + chat = + "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceAround, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Texts( + '${model.LiveChatModelList[index].projectName}', + color: + tappedIndex == index + ? Colors.white + : Colors.black, + textAlign: + TextAlign.center, + ))), //model.cOCItemList[index].cOCTitl + Expanded( + flex: 1, + child: Row( + children: [ + IconButton( + icon: Icon( + Icons + .arrow_forward_rounded, + color: + tappedIndex == index + ? Colors.white + : Colors.black, + ), + tooltip: '', + onPressed: () { + setState(() {}); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + )), + SizedBox( + height: 100, + ), + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'ٍStart', + loading: model.state == ViewState.BusyLocal, + onTap: () { + print("chat=" + chat); + launch(chat); + }, + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart new file mode 100644 index 00000000..154a03cd --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -0,0 +1,117 @@ +import 'dart:ui'; + +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'hospitalsLivechat_page.dart'; + +class LiveChatPage extends StatefulWidget { + @override + _LiveChatPageState createState() => _LiveChatPageState(); +} + +class _LiveChatPageState extends State with SingleTickerProviderStateMixin{ + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Locations', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Stack( + children: [ + Positioned( + bottom: 1, + left: 0, + right: 0, + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + color: Theme.of(context) + .scaffoldBackgroundColor + .withOpacity(0.8), + height: 70.0, + ), + ), + ), + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 0.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.7), + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: true, + controller: _tabController, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.label, + indicatorColor: Colors.red[800], + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Hospitals '), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: Texts(' Pharmacies '), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsLiveChatPage(),//SendFeedbackPage(), + PhamaciesLiveChatPage() + //StatusFeedbackPage() + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart new file mode 100644 index 00000000..c56123c9 --- /dev/null +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -0,0 +1,90 @@ +import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'package:url_launcher/url_launcher.dart'; + +class PhamaciesLiveChatPage extends StatefulWidget { + @override + _PhamaciesLiveChatPageState createState() => _PhamaciesLiveChatPageState(); +} + +class _PhamaciesLiveChatPageState extends State { + int tappedIndex; + String chat; + + @override + void initState() + { + super.initState(); + tappedIndex=-1; + chat=""; + } + + @override + + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLiveChatRequestOrders(), + builder: (_, model, widget) => AppScaffold( + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15,right: 15), + child: Column( + children: [ + SizedBox(height: 20,), + Container( + width: double.infinity, + height: 200, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + ''), + fit: BoxFit.cover), + ), + child: Texts('You can now talk directly to the pharmacist by chat or request a call back',color: Colors.black,textAlign: TextAlign.center,), + + ), + /////////// + + SizedBox(height: 100,), + + + ], + + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.13, + width: double.infinity, + padding: EdgeInsets.all(8.0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.1, + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: 'ٍStart', + loading: model.state == ViewState.BusyLocal, + onTap: () { + print("chat="+chat); + chat="http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + launch(chat); + }, + ), + ), + ), + ), + + ), + ); + + } +} diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 9b1e2f5f..315fe553 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; class HospitalsPage extends StatefulWidget { @@ -32,55 +33,76 @@ class _HospitalsPageState extends State { borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white, ), - // margin: EdgeInsets.all(4), + child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // SizedBox(height: 8,), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.center, children: [ - Container( - width: 70, - height: 70, - // margin: EdgeInsets.only(right: 15), - child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), - Container(child: Texts('${model.FindusHospitalModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl - IconButton( - icon: Icon(Icons.person_pin_circle_outlined), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName); - // _volume += 10; - }); + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(model.FindusHospitalModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(model.FindusHospitalModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), + buttonCancelText:Text('cancel') , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, + + ) ); }, + child: Container( + width: 70, + height: 70, + child: Image.network(model.FindusHospitalModelList[index].projectImageURL.toString())), ), - IconButton( - icon: Icon(Icons.phone), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); - }); - }, + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only(left: 5,right: 5), + child: Texts('${model.FindusHospitalModelList[index].locationName}',textAlign: TextAlign.center,))),//model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates(double.parse(model.FindusHospitalModelList[index].latitude),double.parse(model.FindusHospitalModelList[index].longitude),model.FindusHospitalModelList[index].locationName); + // _volume += 10; + }); + }, + ), + IconButton( + icon: Icon(Icons.phone,color: Colors.red,), + tooltip: 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + ], + ), ), - // Texts( - // 'Number :${model.FindusHospitalModelList[index].locationName}', - // variant: 'overline', - // ), + + ], ), ), @@ -93,9 +115,63 @@ class _HospitalsPageState extends State { ), ), )), - + SizedBox(height: 8,), Container(width: double.infinity, - height: 45,color: Colors.red,), + height: 100,color: Colors.white, + child: Row( + mainAxisSize:MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + + children: [ + + IconButton( + icon: new Image.asset('assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + + launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset('assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + + launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, + ), + ], + ), + ), ], ), ), diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index 68e3c8bc..f127f842 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -8,6 +7,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; class PharmaciesPage extends StatefulWidget { @override @@ -18,116 +19,218 @@ class _PharmaciesPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getFindUsRequestOrders(),//model.getCOC(), + onModelReady: (model) => model.getFindUsRequestOrders(), //model.getCOC(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, - body: Container( - margin: EdgeInsets.only(top: 8.0,left: 8.0,right: 8.0 ), - padding: EdgeInsets.all(15.0), - child: ListView.builder( - itemCount: model.FindusPharmaciesModelList.length,//model.cOCItemList.length, - itemBuilder: (context, index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - // margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // SizedBox(height: 8,), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.FindusPharmaciesModelList.length, + (index) => Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - GestureDetector( - onTap: (){ - showDialog( - context: context,builder: (_) => AssetGiffyDialog( - title: Text(model.FindusPharmaciesModelList[index].locationName, - style: TextStyle( - fontSize: 22.0, fontWeight: FontWeight.w600), - ),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), - - // buttonOkText:Text("LOCATION"), - // buttonOkColor: Colors.grey, - buttonCancelText:Text('cancel') , - buttonCancelColor: Colors.grey, - // onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, - // onCancelButtonPressed:(), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + InkWell( + onTap:(){ + showDialog( + context: context,builder: (_) => AssetGiffyDialog( + title: Text(model.FindusPharmaciesModelList[index].locationName, + style: TextStyle( + fontSize: 22.0, fontWeight: FontWeight.w600), + ),image:Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString(), fit: BoxFit.cover,), + buttonCancelText:Text('cancel') , + // buttonCancelText:Text(model.user.projectID) , + buttonCancelColor: Colors.grey, + onlyCancelButton: true, - - - - ) ); - }, - child: Container( - width: 70, - height: 70, - // margin: EdgeInsets.only(right: 15), - child: Image.network(model.FindusPharmaciesModelList[index].projectImageURL.toString())), - ), - Container(child: Texts('${model.FindusPharmaciesModelList[index].locationName}')),//model.cOCItemList[index].cOCTitl - IconButton( - icon: Icon(Icons.person_pin_circle_outlined), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - }); - }, + ) ); + }, + child: Container( + width: 70, + height: 70, + child: Image.network(model + .FindusPharmaciesModelList[ + index] + .projectImageURL + .toString())), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.only( + left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${model.FindusPharmaciesModelList[index].locationName}', + textAlign: TextAlign.start, + ), + SizedBox(height: 4,), + Texts( + '${model.FindusPharmaciesModelList[index].cityName}', + textAlign: TextAlign.center, + ), + ], + ), + ), + ), + //model.cOCItemList[index].cOCTitl + Expanded( + flex: 2, + child: Row( + children: [ + IconButton( + icon: Icon( + Icons + .person_pin_circle_outlined, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + MapsLauncher.launchCoordinates( + double.parse(model + .FindusPharmaciesModelList[ + index] + .latitude), + double.parse(model + .FindusPharmaciesModelList[ + index] + .longitude), + model + .FindusPharmaciesModelList[ + index] + .locationName); + // _volume += 10; + }); + }, + ), + IconButton( + icon: Icon( + Icons.phone, + color: Colors.red, + ), + tooltip: + 'Increase volume by 10', + onPressed: () { + setState(() { + // _volume += 10; + launch("tel://" + + model + .FindusPharmaciesModelList[ + index] + .phoneNumber); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ], ), - IconButton( - icon: Icon(Icons.phone), - tooltip: 'Increase volume by 10', - onPressed: () { - setState(() { - // _volume += 10; - }); - }, - ), - // Texts( - // 'Number :${model.FindusHospitalModelList[index].locationName}', - // variant: 'overline', - // ), + + Divider( + height: 4.5, + color: Colors.grey[500], + ) ], ), ), - // Expanded( - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Texts('${model.FindusHospitalModelList[index].locationName}'), - // Texts( - // '${model.FindusHospitalModelList[index].locationName}', - // variant: 'overline', - // ), - // ], - // ), - // ), - ], + )), + SizedBox( + height: 8, + ), + Container( + width: double.infinity, + height: 100, + color: Colors.white, + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/youtube.png'), + iconSize: 70, + tooltip: 'Youtube', + onPressed: () { + setState(() { + // _volume += 10; + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/linkedin.png'), + tooltip: 'LinkedIn', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/twitter.png'), + tooltip: 'Twitter', + iconSize: 70, + onPressed: () { + setState(() { + launch("https://twitter.com/HMG"); + }); + }, + ), + IconButton( + icon: new Image.asset( + 'assets/images/new-design/facebook.png'), + tooltip: 'facebook', + iconSize: 70, + onPressed: () { + setState(() { + launch( + "https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); + }); + }, ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider(height: 4.5,color: Colors.grey[500],) ], ), ), - )), + ], + ), + ), ), ), ); } } - diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index 658414e0..9ad74aff 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -56,16 +57,14 @@ class CardCommonContact extends StatelessWidget { } Future navigateToSearch(context, type) async { -//===Switch case=== + if (type == 0) { Navigator.push(context, FadePage(page: FindUsPage())); } else if (type == 1) { Navigator.push(context, FadePage(page: FeedbackHomePage())); } else if (type == 2) { - // Navigator.push( - // context, - // FadePage( - // page: FeedbackHomePage())); + //LiveChatPage + Navigator.push(context, FadePage(page: LiveChatPage())); } }