12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- import 'package:eitc_erm_dental_flutter/funcs.dart';
- import 'package:eitc_erm_dental_flutter/widget/main_button.dart';
- import 'package:flutter/gestures.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- ///APP启动提示弹窗
- class AppStartAgreementDialog extends StatelessWidget {
- const AppStartAgreementDialog({super.key});
- @override
- Widget build(BuildContext context) {
- return PopScope(
- canPop: false,
- child: Dialog(
- shape:
- RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.r)),
- child: Padding(
- padding: EdgeInsets.all(20.r),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(
- getS().permissionDescDialogTitle,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.titleMedium,
- ),
- SizedBox(
- height: 20.h,
- ),
- Text(getS().permissionDescDialogContent(appName)),
- SizedBox(
- height: 10.h,
- ),
- Text.rich(
- softWrap: true,
- TextSpan(text: "${getS().read} ", children: [
- _getClickTextSpan(context, getS().userAgreementBookTitle,
- () => gotoUserAgreement(context, checkWifi: false)),
- TextSpan(text: "、"),
- _getClickTextSpan(context, getS().privacyPolicyBookTitle,
- () => gotoPrivacyPolicy(context, checkWifi: false)),
- TextSpan(text: "、"),
- _getClickTextSpan(
- context,
- getS().permissionDescriptionBookTitle,
- () => gotoPermissionDesc(context, checkWifi: false)),
- ])),
- SizedBox(
- height: 15.h,
- ),
- Row(
- children: [
- Expanded(
- child: MainButton(
- text: getS().exitApp,
- onPressed: () => Navigator.of(context).pop(false),
- buttonPadding: EdgeInsets.zero,
- isOutlined: true,
- )),
- SizedBox(
- width: 10.w,
- ),
- Expanded(
- child: MainButton(
- text: getS().agreeContinue,
- buttonPadding: EdgeInsets.zero,
- onPressed: () => Navigator.of(context).pop(true)))
- ],
- )
- ],
- ),
- ),
- ));
- }
- TextSpan _getClickTextSpan(
- BuildContext context, String text, GestureTapCallback onTap) {
- return TextSpan(
- text: text,
- style: TextStyle(color: Theme.of(context).colorScheme.primary),
- recognizer: TapGestureRecognizer()..onTap = onTap);
- }
- }
|