Contact us
parent
de5633d58b
commit
24693f2992
@ -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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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;
|
||||
}
|
||||
}
|
@ -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<GetPatientICProjectsModel> LivechatModelList=List();
|
||||
|
||||
|
||||
Map<String, dynamic> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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<LiveChatService>();
|
||||
|
||||
List<GetPatientICProjectsModel> 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart';
|
||||
import 'package:diplomaticquarterapp/pages/feedback/status_feedback_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<LiveChatPage> 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: <Widget>[
|
||||
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: <Widget>[
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
controller: _tabController,
|
||||
children: <Widget>[
|
||||
HospitalsLiveChatPage(),//SendFeedbackPage(),
|
||||
PhamaciesLiveChatPage()
|
||||
//StatusFeedbackPage()
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -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<PhamaciesLiveChatPage> {
|
||||
int tappedIndex;
|
||||
String chat;
|
||||
|
||||
@override
|
||||
void initState()
|
||||
{
|
||||
super.initState();
|
||||
tappedIndex=-1;
|
||||
chat="";
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<LiveChatViewModel>(
|
||||
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);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue