app_start_agreement_dialog.dart 3.1 KB

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