Merge branch 'dev_v3.13.6_PenguinIn' of http://34.17.75.184/Haroon6138/diplomatic-quarter into dev_v3.13.6_PenguinIn

clinicbyhospital
taha.alam 1 year ago
commit 1ee19ac696

@ -297,15 +297,16 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
child: ServicesView(
new HmgServices(23, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/InPatient.svg", false),
23,
true, projectViewModel)),
true,
projectViewModel)),
),
),
Expanded(
flex: 4,
child: AspectRatio(
aspectRatio: 1.0,
child: ServicesView(
new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2, true, projectViewModel)),
child: ServicesView(new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2,
true, projectViewModel)),
),
],
),
@ -342,7 +343,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return ServicesView(hmgServices[index], index, true, projectViewModel);
return ServicesView(hmgServices[index], index, true, projectViewModel, isLocked: hmgServices[index].action == 2 ? !projectViewModel.havePrivilege(107) : false);
},
),
),
@ -490,8 +491,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
flex: 1,
child: InkWell(
onTap: () {
if (projectViewModel.havePrivilege(100))
widget.onPharmacyClick!();
if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick!();
},
child: Stack(children: [
Container(

@ -4,6 +4,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -37,8 +38,10 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/penguin_method_channel.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
@ -57,8 +60,9 @@ class ServicesView extends StatelessWidget {
late LocationUtils locationUtils;
bool isHomePage;
late ProjectViewModel projectViewModel;
bool isLocked;
ServicesView(this.hmgServices, this.index, this.isHomePage, this.projectViewModel);
ServicesView(this.hmgServices, this.index, this.isHomePage, this.projectViewModel, {this.isLocked = false});
@override
Widget build(BuildContext context) {
@ -164,13 +168,48 @@ class ServicesView extends StatelessWidget {
],
),
),
isLocked
? Container(
width: double.infinity,
height: double.infinity,
decoration: containerRadiusWithGradientServices(20, lightColor: Colors.grey.withOpacity(0.6), darkColor: Colors.grey.withOpacity(0.6)),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
: Container()
],
),
),
);
}
initPenguinSDK() async {
openNavigationProjectSelection(BuildContext context) {
int _selectedHospitalIndex = 0;
List<HospitalsModel> projectsListLocal = [];
Utils.navigationProjectsList.forEach((v) {
projectsListLocal.add(new HospitalsModel.fromJson(v));
});
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < projectsListLocal.length; i++) RadioSelectionDialogModel(projectsListLocal[i].name! + ' ${projectsListLocal[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog(
context: context,
builder: (cxt) => RadioSelectionDialog(
buttonText: TranslationBase.of(context).confirm,
listData: list,
selectedIndex: _selectedHospitalIndex,
isScrollable: true,
onValueSelected: (index) {
_selectedHospitalIndex = index;
initPenguinSDK(projectsListLocal[index].iD);
},
),
);
}
initPenguinSDK(int projectID) async {
final bool permited = await AppPermission.askPenguinPermissions();
if (!permited) {
Map<Permission, PermissionStatus> statuses = await [
@ -182,7 +221,7 @@ class ServicesView extends StatelessWidget {
].request().whenComplete(() {
PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", "1231755");
});
}
} //
}
handleHomePageServices(HmgServices hmgServices, BuildContext context) {
@ -192,7 +231,8 @@ class ServicesView extends StatelessWidget {
} else if (hmgServices.action == 1) {
openLiveCare(context);
} else if (hmgServices.action == 2) {
initPenguinSDK();
// initPenguinSDK();
if (!isLocked) openNavigationProjectSelection(context);
// Navigator.push(context, FadePage(page: ErOptions(isAppbar: true)));
// locator<GAnalytics>().hmgServices.logServiceName('emergency service');
} else if (hmgServices.action == 3) {

@ -9,13 +9,15 @@ class PenguinMethodChannel {
await _channel.invokeMethod('launchPenguin', {
"storyboardName": storyboardName,
"baseURL": "https://hmg.nav.penguinin.com",
"dataURL": "https://hmg.nav.penguinin.com",
"positionURL": "https://hmg.nav.penguinin.com",
// "dataURL": "https://hmg.nav.penguinin.com",
// "positionURL": "https://hmg.nav.penguinin.com",
"dataURL": "https://hmg-v33.local.penguinin.com",
"positionURL": "https://hmg-v33.local.penguinin.com",
"dataServiceName": "api",
"positionServiceName": "pe",
"clientID": "HMG",
"username": username,
"isSimulationModeEnabled": false,
"clientID": "PIF",
"username": "Test",
"isSimulationModeEnabled": true,
"isShowUserName": false,
"isUpdateUserLocationSmoothly": true,
"isEnableReportIssue": true,

@ -65,6 +65,30 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
class Utils {
// static ProgressDialog pr;
static var navigationProjectsList = [
{
"Desciption": "Sahafa Hospital",
"DesciptionN": null,
"ID": 130,
"LegalName": "Sahafa Hospital",
"LegalNameN": "مستشفى الصحافة",
"Name": "Sahafa Hospital",
"NameN": null,
"PhoneNumber": "+966115222222",
"SetupID": "013311",
"DistanceInKilometers": 0,
"HasVida3": false,
"IsActive": true,
"IsHmg": true,
"IsVidaPlus": false,
"Latitude": "24.8113774",
"Longitude": "46.6239813",
"MainProjectID": 130,
"ProjectOutSA": false,
"UsingInDoctorApp": false
}
];
///show custom Error Toast
/// [message] to show for user
static showErrorToast([String? message]) {
@ -908,7 +932,7 @@ class Utils {
return projectDetailListModel;
}
//static String generateSignature() {}
//static String generateSignature() {}
}
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) {

Loading…
Cancel
Save