app_start_agreement_dialog.dart 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import 'package:eitc_erm_dental_flutter/funcs.dart';
  2. import 'package:eitc_erm_dental_flutter/widget/main_button.dart';
  3. import 'package:flutter/gestures.dart';
  4. import 'package:flutter/material.dart';
  5. import 'package:flutter_screenutil/flutter_screenutil.dart';
  6. ///APP启动提示弹窗
  7. class AppStartAgreementDialog extends StatelessWidget {
  8. const AppStartAgreementDialog({super.key});
  9. @override
  10. Widget build(BuildContext context) {
  11. return PopScope(
  12. canPop: false,
  13. child: Dialog(
  14. shape:
  15. RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.r)),
  16. child: Padding(
  17. padding: EdgeInsets.all(20.r),
  18. child: Column(
  19. mainAxisSize: MainAxisSize.min,
  20. children: [
  21. Text(
  22. getS().permissionDescDialogTitle,
  23. textAlign: TextAlign.center,
  24. style: Theme.of(context).textTheme.titleMedium,
  25. ),
  26. SizedBox(
  27. height: 20.h,
  28. ),
  29. Text(getS().permissionDescDialogContent(appName)),
  30. SizedBox(
  31. height: 10.h,
  32. ),
  33. Text.rich(
  34. softWrap: true,
  35. TextSpan(text: "${getS().read} ", children: [
  36. _getClickTextSpan(context, getS().userAgreementBookTitle,
  37. () => gotoUserAgreement(context, checkWifi: false)),
  38. TextSpan(text: "、"),
  39. _getClickTextSpan(context, getS().privacyPolicyBookTitle,
  40. () => gotoPrivacyPolicy(context, checkWifi: false)),
  41. TextSpan(text: "、"),
  42. _getClickTextSpan(
  43. context,
  44. getS().permissionDescriptionBookTitle,
  45. () => gotoPermissionDesc(context, checkWifi: false)),
  46. ])),
  47. SizedBox(
  48. height: 15.h,
  49. ),
  50. Row(
  51. children: [
  52. Expanded(
  53. child: MainButton(
  54. text: getS().exitApp,
  55. onPressed: () => Navigator.of(context).pop(false),
  56. buttonPadding: EdgeInsets.zero,
  57. isOutlined: true,
  58. )),
  59. SizedBox(
  60. width: 10.w,
  61. ),
  62. Expanded(
  63. child: MainButton(
  64. text: getS().agreeContinue,
  65. buttonPadding: EdgeInsets.zero,
  66. onPressed: () => Navigator.of(context).pop(true)))
  67. ],
  68. )
  69. ],
  70. ),
  71. ),
  72. ));
  73. }
  74. TextSpan _getClickTextSpan(
  75. BuildContext context, String text, GestureTapCallback onTap) {
  76. return TextSpan(
  77. text: text,
  78. style: TextStyle(color: Theme.of(context).colorScheme.primary),
  79. recognizer: TapGestureRecognizer()..onTap = onTap);
  80. }
  81. }