ソースを参照

1.壁纸添加placeholder
2.添加隐私政策弹窗

云天逵 1 年間 前
コミット
a37e4c14d8

BIN
assets/anim/anim_privacy.zip


+ 179 - 0
lib/dialog/privacy_dialog.dart

@@ -0,0 +1,179 @@
+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() {
+  const tag = 'privacyDialog';
+  SmartDialog.show(
+      tag: tag,
+      backType: SmartBackType.normal,
+      clickMaskDismiss: false,
+      maskColor: ColorName.black,
+      builder: (_) {
+        return Container(
+          height: double.infinity,
+          width: double.infinity,
+          child: Stack(
+            children: [
+              SafeArea(
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  children: [
+                    Container(
+                      margin: EdgeInsets.only(left: 16.w, top: 16.h),
+                      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,
+                    ),
+                    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.w,
+                          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,
+                                ),
+                              ),
+                            ],
+                          ),
+                        ),
+                        SizedBox(
+                          height: 8.h,
+                        ),
+                        GestureDetector(
+                            onTap: () {
+
+                            },
+                            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,
+                  height: 335.h,
+                ),
+              ),
+            ],
+          ),
+        );
+      });
+}
+
+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);
+      },
+  );
+}

+ 7 - 0
lib/module/wallpaper/wallpaper_view.dart

@@ -89,6 +89,13 @@ class WallPaperPage extends BasePage<WallPaperController> {
                                         child: CachedNetworkImage(
                                           width: 156.w,
                                           height: 277.w,
+
+                                          placeholder: (context, url) =>
+                                              Assets.images.iconHomeNoPhoto
+                                                  .image(
+                                                width: 156.w,
+                                                height: 156 .w,
+                                          ),
                                           imageUrl: controller
                                                   .wallpapersList[index]
                                                   .thumbUrl ??