Ver código fonte

add vip banner to store feature card

Destiny 8 meses atrás
pai
commit
db524e6475
1 arquivos alterados com 71 adições e 43 exclusões
  1. 71 43
      lib/module/store/discount/func_page_view.dart

+ 71 - 43
lib/module/store/discount/func_page_view.dart

@@ -1,5 +1,5 @@
 import 'dart:async';
-
+import '../../../resource/assets.gen.dart';
 import 'package:clean/utils/expand.dart';
 import 'package:flutter/Material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -136,60 +136,88 @@ class _InfinitePreviewPageViewState extends State<InfinitePreviewPageView> {
 class PreviewItem extends StatelessWidget {
   final String title;
   final Image icon;
-  final VoidCallback? onTap;
 
   const PreviewItem({
     super.key,
     required this.title,
-    required this.icon,
-    this.onTap,
+    required this.icon
   });
 
   @override
   Widget build(BuildContext context) {
-    return InkWell(
-      onTap: onTap,
-      // borderRadius: BorderRadius.circular(16),
-      child: Container(
-        padding: EdgeInsets.only(left: 16.w, right: 16.w),
-        decoration: BoxDecoration(
-          gradient: LinearGradient(
-            begin: Alignment.centerLeft,
-            end: Alignment.centerRight,
-            colors: [
-              '#36363D'.color,
-              '#18181F'.color,
+    return Stack(
+      alignment: Alignment.topLeft,
+      children: [
+        Container(
+          padding: EdgeInsets.only(left: 16.w, right: 16.w),
+          decoration: BoxDecoration(
+            gradient: LinearGradient(
+              begin: Alignment.centerLeft,
+              end: Alignment.centerRight,
+              colors: [
+                '#36363D'.color,
+                '#18181F'.color,
+              ],
+            ),
+            borderRadius: BorderRadius.circular(23.r),
+          ),
+          child: Row(
+            children: [
+              Container(
+                width: 56.w,
+                height: 56.w,
+                child: icon,
+              ),
+              SizedBox(width: 10.w),
+              Expanded(
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  mainAxisAlignment: MainAxisAlignment.center,
+                  children: [
+                    Text(
+                      title,
+                      style: TextStyle(
+                        color: Colors.white,
+                        fontSize: 15.sp,
+                        fontWeight: FontWeight.w500,
+                      ),
+                    ),
+                  ],
+                ),
+              ),
             ],
           ),
-          borderRadius: BorderRadius.circular(23.r),
         ),
-        child: Row(
-          children: [
-            Container(
-              width: 56.w,
-              height: 56.w,
-              child: icon,
-            ),
-            SizedBox(width: 10.w),
-            Expanded(
-              child: Column(
-                crossAxisAlignment: CrossAxisAlignment.start,
-                mainAxisAlignment: MainAxisAlignment.center,
-                children: [
-                  Text(
-                    title,
-                    style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 15.sp,
-                      fontWeight: FontWeight.w500,
-                    ),
-                  ),
+        Container(
+          padding: EdgeInsets.symmetric(vertical: 2.h, horizontal: 15.w),
+          decoration: BoxDecoration(
+            color: '#383850'.color,
+            borderRadius: BorderRadius.only(topLeft: Radius.circular(100), bottomRight: Radius.circular(100)),
+          ),
+          child: ShaderMask(
+            shaderCallback: (Rect bounds) {
+              return LinearGradient(
+                begin: Alignment.centerLeft,
+                end: Alignment.centerRight,
+                colors: [
+                  '#ffdd55'.color,
+                  '#ffe89d'.color,
                 ],
-              ),
+              ).createShader(bounds);
+            },
+            child: Text(
+                "VIP",
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 12.sp,
+                    fontWeight: FontWeight.w700
+                )
             ),
-          ],
-        ),
-      ),
+          ),
+        )
+      ],
     );
   }
-}
+}
+
+