You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart

91 lines
3.1 KiB
Dart

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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:provider/provider.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) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LiveChatViewModel>(
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
child: Column(
children: [
SizedBox(
height: 20,
),
Container(
width: double.infinity,
height: 200,
child: Texts(
TranslationBase.of(context).instructionsPharmacies,
color: Colors.black,
textAlign: TextAlign.center,
),
),
///////////
SizedBox(
height: 100,
),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.11,
width: double.infinity,
padding: EdgeInsets.all(8.0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.7,
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: TranslationBase.of(context).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=${projectViewModel.isArabic? 1:2}";
launch(chat);
},
),
),
),
),
),
);
}
}