| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
- import 'package:keyboard/resource/string.gen.dart';
- import '../data/consts/web_url.dart';
- import '../resource/assets.gen.dart';
- import '../resource/colors.gen.dart';
- import '../utils/styles.dart';
- import '../widget/click_text_span.dart';
- // 会员协议弹窗
- class MemberAgreementDialog {
- static const String tag = 'MemberAgreementDialog';
- static void show({Function? btnCancel, Function? btnConfirm}) {
- SmartDialog.show(
- tag: tag,
- backType: SmartBackType.block,
- clickMaskDismiss: true,
- maskColor: ColorName.black70,
- builder: (_) {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Container(
- margin: EdgeInsets.symmetric(horizontal: 31.w),
- decoration: ShapeDecoration(
- color: Colors.white,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(20.r),
- ),
- ),
- child: Stack(
- children: [
- Container(
- padding: EdgeInsets.symmetric(
- horizontal: 16.w,
- vertical: 24.h,
- ),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text(
- StringName.memberAgreementDialogTitle,
- style: Styles.getTextStyleBlack204W500(16.sp),
- ),
- SizedBox(height: 16.h),
- Text.rich(
- TextSpan(
- children: [
- TextSpan(
- text: StringName.memberAgreementDialogDesc,
- style: TextStyle(
- color: Colors.black.withAlpha(153),
- fontSize: 14.sp,
- fontWeight: FontWeight.w400,
- ),
- ),
- ClickTextSpan(
- fontSize: 14.sp,
- text: StringName.textSpanPrivacyPolicy,
- url: WebUrl.privacyPolicy,
- ),
- ClickTextSpan(
- fontSize: 14.sp,
- text:
- StringName.textSpanServiceTerms,
- url: WebUrl.serviceAgreement,
- ),
- TextSpan(
- text: StringName.textSpanAnd,
- style: TextStyle(
- color: Colors.black.withAlpha(153),
- fontSize: 14.sp,
- fontWeight: FontWeight.w400,
- ),
- ),
- ClickTextSpan( fontSize: 14.sp,text: StringName.textSpanMembershipAgreement, url: WebUrl.memberServiceAgreement),
- TextSpan(
- text: "。",
- style: TextStyle(
- color: Colors.black.withAlpha(153),
- fontSize: 14.sp,
- fontWeight: FontWeight.w400,
- ),
- ),
- ],
- ),
- ),
- SizedBox(height: 20.h),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- GestureDetector(
- onTap: () {
- if (btnCancel != null) {
- btnCancel();
- }
- SmartDialog.dismiss();
- },
- child: Container(
- height: 40.h,
- width: 128.w,
- alignment: Alignment.center,
- decoration: ShapeDecoration(
- color: const Color(0xFFF5F4F9),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(50.r),
- ),
- ),
- child: Text(
- StringName.memberAgreementDialogCancel,
- style: Styles.getTextStyleBlack204W500(16.sp),
- ),
- ),
- ),
- GestureDetector(
- onTap: () {
- if (btnConfirm != null) {
- btnConfirm();
- }
- SmartDialog.dismiss(tag: tag);
- },
- child: Container(
- height: 40.h,
- width: 128.r,
- alignment: Alignment.center,
- decoration: Styles.getActivateButtonDecoration(
- 22.r,
- ),
- child: Text(
- StringName.memberAgreementDialogConfirm,
- style: Styles.getTextStyleWhiteW500(16.sp),
- ),
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- Positioned(
- right: 14.w,
- top: 14.h,
- child: GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- },
- child: Assets.images.iconCustomDialogClose.image(
- width: 24.w,
- height: 24.h,
- ),
- ),
- ),
- ],
- ),
- ),
- ],
- );
- },
- );
- }
- }
|