feat: 添加logo,修复部分ui
This commit is contained in:
1 parent
a3426831ed
commit
a3f489abe2
18 files changed
+263
-124
No files matched your search
@@ -30,16 +30,16 @@ class HomeCardWidget extends StatelessWidget {
|
||||
cutCorner: CutCorner.topRight,
|
||||
cutSize: 30,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 8, right: 8, bottom: 8),
|
||||
padding: EdgeInsets.only(left: 8, right: 8, bottom: 8),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_threeLine(),
|
||||
const SizedBox(height: 10),
|
||||
OutlinedTitle(title, fontSize: 17),
|
||||
const SizedBox(height: 10),
|
||||
SizedBox(height: 10.h),
|
||||
OutlinedTitle(title, fontSize: 17.w),
|
||||
SizedBox(height: 10.h),
|
||||
Expanded(child: _listView()),
|
||||
const SizedBox(height: 6),
|
||||
SizedBox(height: 6.h),
|
||||
NovyButtonBg(text: 'Click to watch', width: 327.w),
|
||||
],
|
||||
),
|
||||
@@ -67,14 +67,14 @@ class HomeCardWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
HelpImage.network(drama.imageUrl, width: 104.w, height: 157.h),
|
||||
const SizedBox(height: 5),
|
||||
SizedBox(height: 4.h),
|
||||
NovyText(
|
||||
drama.name,
|
||||
fontSize: 12.sp,
|
||||
color: Colors.black,
|
||||
maxLines: 2,
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
SizedBox(height: 1.5.h),
|
||||
if (tag != '') Row(children: [NyTagWidget(text: tag)]),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:novyronst/common/help/app_nav.dart';
|
||||
import 'package:novyronst/common/help/help_time.dart';
|
||||
import 'package:novyronst/common/model/ny_category_model.dart';
|
||||
import 'package:novyronst/common/model/ny_drama_model.dart';
|
||||
import 'package:novyronst/pages/first/pages/category_list_page.dart';
|
||||
import 'package:novyronst/pages/first/player_detail/video_detail_page.dart';
|
||||
import 'package:novyronst/pages/widgets/cut_corner_clipper.dart';
|
||||
import 'package:novyronst/pages/widgets/ny_progress_widget.dart';
|
||||
import 'package:novyronst/pages/widgets/ny_tag_widget.dart';
|
||||
@@ -12,6 +15,8 @@ import 'package:novyronst/tools/widgets/novy_button_bg.dart';
|
||||
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
|
||||
import 'package:novyronst/tools/widgets/novy_img_bg.dart';
|
||||
|
||||
import '../../../common/api/video_request.dart';
|
||||
|
||||
class HomeFirstView extends StatefulWidget {
|
||||
const HomeFirstView({super.key, required this.categories});
|
||||
|
||||
@@ -23,32 +28,79 @@ class HomeFirstView extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
NyDramaModel? firstHistoryItem(List<NyDramaModel> items) {
|
||||
if (items.isEmpty) return null;
|
||||
return items.first;
|
||||
}
|
||||
|
||||
double historyProgress(NyDramaModel item) {
|
||||
final process = item.currentEpisode;
|
||||
if (process == null) return 0;
|
||||
return (process / item.episodeTotal).clamp(0, 1).toDouble();
|
||||
}
|
||||
|
||||
String homeHistoryTag(NyDramaModel item) {
|
||||
final category = item.category;
|
||||
if (category != null && category.isNotEmpty) return category.first;
|
||||
|
||||
final categoryList = item.categoryList;
|
||||
if (categoryList != null && categoryList.isNotEmpty) {
|
||||
return categoryList.first.name;
|
||||
}
|
||||
|
||||
return item.tagType;
|
||||
}
|
||||
|
||||
class _HomeFirstViewState extends State<HomeFirstView> {
|
||||
NyDramaModel? _historyItem;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_getHistoryList();
|
||||
}
|
||||
|
||||
void _getHistoryList() {
|
||||
VideoRequest.getCollections().then((value) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_historyItem = firstHistoryItem(value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const double space = 25;
|
||||
final historyItem = _historyItem;
|
||||
final hasHistory = historyItem != null;
|
||||
final top = 151 - space;
|
||||
final height = top + (hasHistory ? 204 + 16 : 0) + 45;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
// 151
|
||||
SizedBox(height: 151 - space + 200 + 52 + 20),
|
||||
SizedBox(height: height),
|
||||
HelpImage.asset(
|
||||
ConstImage.homeFirst,
|
||||
width: AppScreen.screenWidth,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Positioned(
|
||||
top: 151 - space,
|
||||
left: 16,
|
||||
right: 16,
|
||||
top: top - 20,
|
||||
left: 16.w,
|
||||
right: 16.w,
|
||||
child: Column(
|
||||
children: [
|
||||
CutCornerClipper(
|
||||
width: AppScreen.screenWidth - 32,
|
||||
height: 204,
|
||||
cutSize: 80,
|
||||
child: _buildVideoItem(),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (hasHistory) ...[
|
||||
CutCornerClipper(
|
||||
width: AppScreen.screenWidth - 32.w,
|
||||
height: 204,
|
||||
cutSize: 80.w,
|
||||
child: _buildVideoItem(historyItem),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
@@ -97,7 +149,9 @@ class _HomeFirstViewState extends State<HomeFirstView> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildVideoItem() {
|
||||
Widget _buildVideoItem(NyDramaModel item) {
|
||||
final tag = homeHistoryTag(item);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
@@ -107,58 +161,71 @@ class _HomeFirstViewState extends State<HomeFirstView> {
|
||||
NovyText(
|
||||
'Current Viewing Progress',
|
||||
color: Colors.black,
|
||||
fontSize: 16,
|
||||
fontFamily: ConstFont.montBlack,
|
||||
fontSize: 15.w,
|
||||
fontFamily: ConstFont.montBold,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
HelpImage.asset(ConstImage.homeCurrentTag, height: 10),
|
||||
HelpImage.asset(ConstImage.homeCurrentTag, height: 10.h),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey.withAlpha(200),
|
||||
HelpImage.networkRadius(
|
||||
item.imageUrl,
|
||||
width: 60,
|
||||
height: 90,
|
||||
fit: BoxFit.cover,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
SizedBox(
|
||||
height: 90,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
NovyText(
|
||||
'Jdksyjs dsaoy',
|
||||
color: Colors.black,
|
||||
fontSize: 14,
|
||||
fontFamily: ConstFont.montMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
NovyText(
|
||||
'Jdksyjs dsaoy dasku dsaldsa dljas',
|
||||
color: Colors.grey,
|
||||
fontSize: 10,
|
||||
fontFamily: ConstFont.montRegular,
|
||||
maxLines: 2,
|
||||
),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
NyTagWidget(text: 'Safiray'),
|
||||
const SizedBox(width: 8),
|
||||
NyHotWidget(text: '12.4k'),
|
||||
],
|
||||
),
|
||||
],
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
height: 90,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
NovyText(
|
||||
item.name,
|
||||
color: Colors.black,
|
||||
fontSize: 13.w,
|
||||
fontFamily: ConstFont.montMedium,
|
||||
maxLines: 1,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
NovyText(
|
||||
item.description,
|
||||
color: Colors.grey,
|
||||
fontSize: 10.w,
|
||||
fontFamily: ConstFont.montRegular,
|
||||
maxLines: 2,
|
||||
),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
if (tag.isNotEmpty) ...[
|
||||
NyTagWidget(text: tag),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
NyHotWidget(
|
||||
text: HelpTime.formatNum(item.watchTotal),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
NyProgressWidget(),
|
||||
NyProgressWidget(progress: historyProgress(item)),
|
||||
const SizedBox(height: 6),
|
||||
NovyButtonBg(text: 'Keep Watching', type: 2, width: 327.w),
|
||||
NovyButtonBg(text: 'Keep Watching', type: 2, width: 327.w).addInkWell(
|
||||
onTap: () {
|
||||
AppNav.to(VideoDetailPage(drama: item));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -21,11 +21,11 @@ class HomeRankWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CutCornerClipper(
|
||||
width: AppScreen.screenWidth - 32,
|
||||
width: AppScreen.screenWidth - 32.w,
|
||||
cutCorner: CutCorner.bottomLeft,
|
||||
cutSize: 40,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8),
|
||||
padding: EdgeInsets.all(8.w),
|
||||
child: dramaRanks.isEmpty
|
||||
? const SizedBox(height: 20)
|
||||
: Column(
|
||||
@@ -35,7 +35,7 @@ class HomeRankWidget extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 20.w),
|
||||
NovyButtonBg(text: 'Keep Watching', width: 308.w),
|
||||
NovyButtonBg(text: 'Keep Watching', width: 302.w),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -48,7 +48,7 @@ class HomeRankWidget extends StatelessWidget {
|
||||
return Row(
|
||||
children: [
|
||||
_firstVideoView(),
|
||||
const SizedBox(width: 8),
|
||||
SizedBox(width: 8.w),
|
||||
_otherVideoView(),
|
||||
],
|
||||
);
|
||||
@@ -111,19 +111,19 @@ class HomeRankWidget extends StatelessWidget {
|
||||
onTap: () => AppNav.to(VideoDetailPage(drama: item)),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
width: 160.w,
|
||||
width: 157.w,
|
||||
height: 93.w,
|
||||
child: Row(
|
||||
children: [
|
||||
HelpImage.network(item.imageUrl, width: 62.w, height: 93.w),
|
||||
const SizedBox(width: 8),
|
||||
HelpImage.network(item.imageUrl, width: 61.w, height: 93.w),
|
||||
SizedBox(width: 7.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_colorsText(index + 2),
|
||||
const SizedBox(height: 8),
|
||||
NovyText(item.name, fontSize: 13, color: Colors.black),
|
||||
NovyText(item.name, fontSize: 13.w, color: Colors.black),
|
||||
const SizedBox(height: 5),
|
||||
tag.isNotEmpty
|
||||
? NyTagWidget(text: tag)
|
||||
@@ -144,10 +144,10 @@ class HomeRankWidget extends StatelessWidget {
|
||||
return Text(
|
||||
'$index',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontSize: 19.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.grey.withAlpha(127),
|
||||
fontStyle: FontStyle.italic,
|
||||
// fontStyle: FontStyle.italic,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -165,10 +165,10 @@ class HomeRankWidget extends StatelessWidget {
|
||||
child: Text(
|
||||
'$index',
|
||||
style: TextStyle(
|
||||
fontSize: index == 1 ? 40 : 20,
|
||||
fontSize: index == 1 ? 40.w : 19.w,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
fontStyle: FontStyle.italic,
|
||||
// fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:novyronst/common/api/video_request.dart';
|
||||
import 'package:novyronst/common/const/const_color.dart';
|
||||
import 'package:novyronst/common/const/const_string.dart';
|
||||
@@ -8,6 +9,7 @@ import 'package:novyronst/common/model/ny_drama_model.dart';
|
||||
import 'package:novyronst/common/model/ny_episode_model.dart';
|
||||
import 'package:novyronst/pages/first/player_detail/video_detail_page.dart';
|
||||
import 'package:novyronst/pages/widgets/cut_corner_clipper.dart';
|
||||
import 'package:novyronst/root/lib_export.dart';
|
||||
import 'package:novyronst/tools/widgets/novy_com_widget.dart';
|
||||
|
||||
import '../../../common/model/ny_detail_model.dart';
|
||||
@@ -99,7 +101,7 @@ class _ActorSection extends StatelessWidget {
|
||||
alignment: Alignment.topRight,
|
||||
child: OutlinedTitle(
|
||||
'Read This Series Of Short Plays',
|
||||
fontSize: 17,
|
||||
fontSize: AppScreen.isIos ? 17.w : 16.w,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
|
||||
Reference in new issue
Block a user