| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- import 'package:clean/data/consts/constants.dart';
- import 'package:clean/module/browser/browser_view.dart';
- import 'package:clean/resource/assets.gen.dart';
- import 'package:clean/resource/colors.gen.dart';
- import 'package:flutter/Material.dart';
- import 'package:flutter/gestures.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
- import 'package:lottie/lottie.dart';
- void privacyDialog({required Function onAgree, required Function onDisagree}) {
- const tag = 'privacyDialog';
- SmartDialog.show(
- tag: tag,
- backType: SmartBackType.block,
- clickMaskDismiss: false,
- maskColor: ColorName.black,
- builder: (_) {
- return Container(
- height: double.infinity,
- width: double.infinity,
- child: Stack(
- children: [
- SafeArea(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- GestureDetector(
- onTap: () {
- onDisagree();
- SmartDialog.dismiss(tag: tag);
- },
- child: Container(
- margin: EdgeInsets.only(left: 16.w),
- width: 28.w,
- height: 28.w,
- decoration: ShapeDecoration(
- color: Color(0xFF2A3E55),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(86.r),
- ),
- image: DecorationImage(
- image: Assets.images.iconPrivateClose.provider(),
- ),
- ),
- )),
- SizedBox(
- height: 45.h,
- ),
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- SizedBox(
- width: 245.w,
- child: Text(
- 'Clean up your iphone and free up storage',
- textAlign: TextAlign.center,
- style: TextStyle(
- color: Colors.white,
- fontSize: 24.sp,
- fontWeight: FontWeight.w500,
- height: 1.25.h,
- ),
- ),
- ),
- SizedBox(
- child: Lottie.asset(
- Assets.anim.animPrivacy,
- height: 412.h,
- repeat: true,
- ),
- ),
- SizedBox(
- height: 8,
- ),
- Text(
- 'CleanPro values your privacy. By starting, you agree to ',
- style: TextStyle(
- color: Colors.white.withValues(alpha: 0.8),
- fontSize: 12.sp,
- fontWeight: FontWeight.w400,
- height: 1.50.h,
- ),
- ),
- Text.rich(
- TextSpan(
- children: [
- TextSpan(
- text: 'our ',
- style: TextStyle(
- color: Colors.white.withValues(alpha: 0.8),
- fontSize: 12.sp,
- fontWeight: FontWeight.w400,
- height: 2.50.h,
- ),
- ),
- buildLinkText(
- 'Privacy Policy', Constants.privacyPolicy),
- TextSpan(
- text: ' and ',
- style: TextStyle(
- color: Colors.white.withValues(alpha: 0.8),
- fontSize: 12.sp,
- fontWeight: FontWeight.w400,
- height: 2.50.h,
- ),
- ),
- buildLinkText('Terms of Service',
- Constants.userAgreement),
- TextSpan(
- text: '.',
- style: TextStyle(
- color: Colors.white,
- fontSize: 12.sp,
- fontWeight: FontWeight.w400,
- height: 2.50.h,
- ),
- ),
- ],
- ),
- ),
- Spacer(),
- GestureDetector(
- onTap: () {
- onAgree();
- SmartDialog.dismiss(tag: tag);
- },
- child: Container(
- width: 316.w,
- height: 48.h,
- decoration: ShapeDecoration(
- color: Color(0xFF0279FB),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(24.r),
- ),
- ),
- child: Center(
- child: Text(
- 'Start',
- style: TextStyle(
- color: Colors.white,
- fontSize: 16.sp,
- fontWeight: FontWeight.w500,
- ),
- ),
- ),
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- IgnorePointer(
- child: Assets.images.bgPhotoSelectedPreviewFinish.image(
- width: 360.w,
- ),
- ),
- ],
- ),
- );
- });
- }
- TextSpan buildLinkText(String text, String url) {
- return TextSpan(
- text: text,
- style: TextStyle(
- color: Colors.white,
- decoration: TextDecoration.underline,
- decorationColor: Colors.white,
- fontSize: 12.sp,
- fontWeight: FontWeight.w400,
- height: 2.50.h,
- ),
- // 链接文字样式
- recognizer: TapGestureRecognizer()
- ..onTap = () {
- BrowserPage.start(url);
- },
- );
- }
|