feat: 首页,播放页,搜索页,收藏UI
This commit is contained in:
1 parent
197c3e9b88
commit
e59ac2177b
19 files changed
+475
-81
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:skywood/global/const/common_color.dart';
|
||||
import 'package:skywood/main/lib_file.dart';
|
||||
import 'package:skywood/pages/home/players/page/drama_detail_page.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_drama.dart';
|
||||
import 'package:skywood/utils/tools/sky_time_tool.dart';
|
||||
import 'package:skywood/utils/tools/widgets/sky_common_widget.dart';
|
||||
@@ -91,6 +93,9 @@ class DailyQuestWidget extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 3.h),
|
||||
],
|
||||
);
|
||||
).addInkWell(onTap: () {
|
||||
|
||||
HelpNav.to(DramaDetailPage(dramaBean: drama));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:skywood/main/lib_file.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_category.dart';
|
||||
import 'package:skywood/utils/tools/widgets/sky_common_widget.dart';
|
||||
|
||||
class HomeCateWidget extends StatelessWidget {
|
||||
|
||||
@@ -12,15 +13,20 @@ class HomeCateWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, // 🔥 上下2行
|
||||
crossAxisSpacing: 10, // 行间距(垂直方向)
|
||||
mainAxisSpacing: 10, // 列间距(水平方向)
|
||||
childAspectRatio: 0.7, // 宽高比(宽度/高度)
|
||||
), itemBuilder: (context, index) {
|
||||
return _buildCateItem(categories[index], index);
|
||||
}
|
||||
return SizedBox(
|
||||
height: 270, width: double.infinity,
|
||||
child: GridView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, // 🔥 上下2行
|
||||
crossAxisSpacing: 14, // 行间距(垂直方向)
|
||||
mainAxisSpacing: 10, // 列间距(水平方向)
|
||||
childAspectRatio: 140 / 131.0, // 宽高比(宽度/高度)
|
||||
),
|
||||
itemCount: categories.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildCateItem(categories[index], index);}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,8 +34,69 @@ class HomeCateWidget extends StatelessWidget {
|
||||
String imgName = index%3 == 0 ? ConstImg.purpleBg : (index%3 == 1 ? ConstImg.yellowBg : ConstImg.redBg);
|
||||
return Stack(
|
||||
children: [
|
||||
HelpImg.asset(imgName, width: 140.w, height: 131.h, fit: BoxFit.cover),
|
||||
HelpImg.asset(imgName, width: 140.w, height: 131.w, fit: BoxFit.fill),
|
||||
Positioned(
|
||||
bottom: 24.h, left: 10.w, right: 10.w,
|
||||
child: _customText(category.name,),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_customText(String text) {
|
||||
return Text(
|
||||
text,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.white, // 内部字体白色
|
||||
fontStyle: FontStyle.italic,
|
||||
fontFamily: 'Inter',
|
||||
fontWeight: FontWeight.w600,
|
||||
shadows: [
|
||||
Shadow(
|
||||
color: Colors.black, // 描边颜色
|
||||
offset: Offset(1, 1), // 偏移量
|
||||
blurRadius: 0, // 不模糊,形成硬边描边
|
||||
),
|
||||
Shadow(
|
||||
color: Colors.black,
|
||||
offset: Offset(-1, -1),
|
||||
blurRadius: 0,
|
||||
),
|
||||
Shadow(
|
||||
color: Colors.black,
|
||||
offset: Offset(1, -1),
|
||||
blurRadius: 0,
|
||||
),
|
||||
Shadow(
|
||||
color: Colors.black,
|
||||
offset: Offset(-1, 1),
|
||||
blurRadius: 0,
|
||||
),
|
||||
// 四个角再加一些,让描边更饱满
|
||||
// Shadow(
|
||||
// color: Colors.black,
|
||||
// offset: Offset(2, 0),
|
||||
// blurRadius: 0,
|
||||
// ),
|
||||
// Shadow(
|
||||
// color: Colors.black,
|
||||
// offset: Offset(-2, 0),
|
||||
// blurRadius: 0,
|
||||
// ),
|
||||
// Shadow(
|
||||
// color: Colors.black,
|
||||
// offset: Offset(0, 2),
|
||||
// blurRadius: 0,
|
||||
// ),
|
||||
// Shadow(
|
||||
// color: Colors.black,
|
||||
// offset: Offset(0, -2),
|
||||
// blurRadius: 0,
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ class HotCartridgeWidget extends StatelessWidget {
|
||||
),
|
||||
Positioned(
|
||||
top: 1, left: 5.w, right: 5.w,
|
||||
child: HelpImg.network(drama.imageUrl, width: 100.w, height: 130.h),
|
||||
child: HelpImg.network(drama.imageUrl, width: 100.w, height: 130.h, fit: BoxFit.cover),
|
||||
),
|
||||
HelpImg.asset(index<3?ConstImg.hotBg1:ConstImg.hotBg2, width: 110.w, height: 174.h)
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user