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.
HMG_Patient_App_New/lib/app_closed_page.dart

105 lines
3.8 KiB
Dart

import 'dart:io';
import 'package:clarity_flutter/clarity_flutter.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:freerasp/freerasp.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/services/security_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'generated/locale_keys.g.dart';
import 'widgets/buttons/custom_button.dart';
class AppClosedPage extends StatefulWidget {
const AppClosedPage({super.key});
@override
State<AppClosedPage> createState() => _AppClosedPageState();
}
class _AppClosedPageState extends State<AppClosedPage> {
@override
void initState() {
// Clarity.setCurrentScreenName('Unsafe Device Page');
Talsec.instance.detachListener();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.whiteColor,
body: SafeArea(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Logo
Utils.buildImgWithAssets(icon: AppAssets.hmgLogo, width: MediaQuery.of(context).size.width * 0.7, height: 90.h, fit: BoxFit.contain),
SizedBox(height: 32.h),
Text(
LocaleKeys.importantNotice.tr(context: context),
style: TextStyle(
fontSize: 28.f,
fontWeight: FontWeight.bold,
color: AppColors.textColor,
),
textAlign: TextAlign.center,
),
SizedBox(height: 16.h),
// Description
Text(
LocaleKeys.appDecommissionedText.tr(context: context),
style: TextStyle(
fontSize: 14.f,
color: Colors.black87,
),
textAlign: TextAlign.center,
),
SizedBox(height: 24.h),
Text(
LocaleKeys.appDecommissionedSubText.tr(context: context),
style: TextStyle(fontSize: 14.f, color: AppColors.textColorLight, fontStyle: FontStyle.italic),
textAlign: TextAlign.center,
),
SizedBox(height: 48.h),
CustomButton(
text: LocaleKeys.downloadApp.tr(context: context),
onPressed: () {
if (Platform.isAndroid) {
Utils.openWebView(
url: "https://play.google.com/store/apps/details?id=com.ejada.hmg",
);
}
if (Platform.isIOS) {
Utils.openWebView(
url: "https://itunes.apple.com/app/id733503978",
);
}
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
fontWeight: FontWeight.w600,
borderRadius: 12.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
// height: isTablet || isFoldable ? 46.h : 40.h,
height: 56.h,
iconColor: AppColors.primaryRedColor,
),
],
),
),
),
);
}
}