virtual tour.

pull/104/head
Sultan khan 2 months ago
parent 2532b494f7
commit 9e0336687c

@ -8,6 +8,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:crypto/crypto.dart' as crypto;
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:google_api_availability/google_api_availability.dart';
@ -29,6 +30,7 @@ import 'package:hmg_patient_app_new/widgets/loading_dialog.dart';
import 'package:lottie/lottie.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:url_launcher/url_launcher.dart';
class Utils {
static AppState appState = getIt.get<AppState>();
@ -865,4 +867,8 @@ class Utils {
}
return isHavePrivilege;
}
static void openWebView({ required String url}) {
Uri uri = Uri.parse(url);
launchUrl(uri, mode: LaunchMode.inAppBrowserView);
}
}

@ -5,21 +5,26 @@ class HmgServicesComponentModel {
String title;
String subTitle;
String icon;
Color? iconColor;
bool isLogin;
bool isLocked;
Color bgColor;
Color textColor;
String route;
String? route;
Function? onTap;
HmgServicesComponentModel(
this.action,
this.title,
this.subTitle,
this.icon,
this.isLogin, {
this.isLocked = false,
this.bgColor = Colors.white,
this.textColor = Colors.black,
this.route = '',
this.iconColor = Colors.white,
this.route,
this.onTap
});
}

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/hmg_services_component_model.dart';
import 'package:hmg_patient_app_new/presentation/hmg_services/services_view.dart';
@ -22,7 +23,7 @@ class ServicesPage extends StatelessWidget {
route: AppRoutes.eReferralPage,
),
HmgServicesComponentModel(
12,
5,
"Comprehensive Checkup".needTranslation,
"".needTranslation,
AppAssets.comprehensiveCheckup,
@ -32,7 +33,7 @@ class ServicesPage extends StatelessWidget {
route: AppRoutes.comprehensiveCheckupPage,
),
HmgServicesComponentModel(
12,
3,
"Home Health Care".needTranslation,
"".needTranslation,
AppAssets.emergency_services_icon,
@ -41,6 +42,21 @@ class ServicesPage extends StatelessWidget {
textColor: AppColors.blackColor,
route: AppRoutes.homeHealthCarePage,
),
HmgServicesComponentModel(
11,
"Virtual Tour".needTranslation,
"".needTranslation,
AppAssets.my_address,
true,
bgColor: Colors.orange,
textColor: AppColors.blackColor,
route: null,
onTap:(){
Utils.openWebView(
url: 'https://hmgwebservices.com/vt_mobile/html/index.html',
);
},
)
];
@override
@ -49,7 +65,7 @@ class ServicesPage extends StatelessWidget {
title: "Explore Services".needTranslation,
isLeading: Navigator.canPop(context),
child: Padding(
padding: EdgeInsets.all(24.h),
padding: EdgeInsets.symmetric(horizontal: 24.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -60,9 +76,9 @@ class ServicesPage extends StatelessWidget {
child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, // 4 icons per row
crossAxisSpacing: 16.w,
mainAxisSpacing: 24.h,
childAspectRatio: 0.75,
crossAxisSpacing: 24.w,
mainAxisSpacing: 0.h,
childAspectRatio: 0.85,
),
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,

@ -11,13 +11,19 @@ class ServiceGridViewItem extends StatelessWidget {
final int index;
final bool isHomePage;
final bool isLocked;
const ServiceGridViewItem(this.hmgServiceComponentModel, this.index, this.isHomePage, {super.key, this.isLocked = false});
final Function? onTap;
const ServiceGridViewItem(this.hmgServiceComponentModel, this.index, this.isHomePage, {super.key, this.isLocked = false, this.onTap});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () => getIt.get<NavigationService>().pushPageRoute(hmgServiceComponentModel.route),
onTap: () {
hmgServiceComponentModel.route != null
? getIt.get<NavigationService>().pushPageRoute(hmgServiceComponentModel.route!)
: hmgServiceComponentModel.onTap != null
? hmgServiceComponentModel.onTap!()
: null;
},
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
@ -33,6 +39,7 @@ class ServiceGridViewItem extends StatelessWidget {
),
child: Utils.buildSvgWithAssets(
icon: hmgServiceComponentModel.icon,
iconColor: hmgServiceComponentModel.iconColor,
height: 21.h,
width: 21.w,
fit: BoxFit.none,

@ -33,7 +33,7 @@ class _LandingNavigationState extends State<LandingNavigation> {
appState.isAuthenticated ? MedicalFilePage() : /* need add feedback page */ FeedbackPage(),
BookAppointmentPage(),
const ToDoPage(),
appState.isAuthenticated ? /* need add news page */ ServicesPage() : const LandingPage(),
ServicesPage(),
],
),
bottomNavigationBar: BottomNavigation(

Loading…
Cancel
Save