logo和名称替换
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hgmj/assets_tool/images.dart';
|
||||
import 'package:hgmj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:hgmj/hj_utils/const.dart';
|
||||
import 'package:hgmj/hj_utils/screen.dart';
|
||||
import 'package:hgmj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:hgmj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:hgmj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:wydj/assets_tool/images.dart';
|
||||
import 'package:wydj/hj_page/home/provider/home_update_marker_provider.dart';
|
||||
import 'package:wydj/hj_utils/const.dart';
|
||||
import 'package:wydj/hj_utils/screen.dart';
|
||||
import 'package:wydj/tools_base/indicator/custom_tab_indicator.dart';
|
||||
import 'package:wydj/tools_base/loading/loading_center_widget.dart';
|
||||
import 'package:wydj/tools_base/widget/keep_alive_widget.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../cartoon/cartoon_sub_detail_page.dart';
|
||||
@@ -39,7 +39,8 @@ class HomeMainPage extends StatelessWidget {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
_body(logic),
|
||||
const Positioned(right: 12, bottom: 40, child: HomeFloatWidget()),
|
||||
const Positioned(
|
||||
right: 12, bottom: 40, child: HomeFloatWidget()),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -60,7 +61,8 @@ class HomeMainPage extends StatelessWidget {
|
||||
child: CommonSearchBarView(logic: logic),
|
||||
),
|
||||
//排序变化时 tabViewKey 变,整个 TabView 连 TabController 一起重建
|
||||
Expanded(child: HomeTabView(key: ValueKey(logic.tabViewKey), logic: logic)),
|
||||
Expanded(
|
||||
child: HomeTabView(key: ValueKey(logic.tabViewKey), logic: logic)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -80,7 +82,8 @@ class HomeTabView extends StatefulWidget {
|
||||
State<HomeTabView> createState() => _HomeTabViewState();
|
||||
}
|
||||
|
||||
class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStateMixin {
|
||||
class _HomeTabViewState extends State<HomeTabView>
|
||||
with SingleTickerProviderStateMixin {
|
||||
HomeMainLogic get logic => widget.logic;
|
||||
|
||||
bool get isDarkStyle => widget.isDarkStyle;
|
||||
@@ -148,19 +151,31 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
//1首页(原首页视频) 3暗网
|
||||
//showType==2 走分区聚合页,其余走排序列表页
|
||||
if (module.showType == 2) {
|
||||
return HomeTabSectionPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSectionPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
} else {
|
||||
return HomeTabSortPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSortPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
}
|
||||
} else if (module.isACG) {
|
||||
/// 动漫/漫画/小说
|
||||
return CartoonSubDetailPage(tagData: module, type: MediaStyle.Cartoon, index: index).keepAlive;
|
||||
return CartoonSubDetailPage(
|
||||
tagData: module,
|
||||
type: MediaStyle.Cartoon,
|
||||
index: index)
|
||||
.keepAlive;
|
||||
} else if (module.isDrama) {
|
||||
/// 短剧
|
||||
return HomeTabDramaPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabDramaPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
} else {
|
||||
//兜底
|
||||
return HomeTabSortPage(index, module, isDarkStyle: isDarkStyle).keepAlive;
|
||||
return HomeTabSortPage(index, module,
|
||||
isDarkStyle: isDarkStyle)
|
||||
.keepAlive;
|
||||
}
|
||||
}),
|
||||
),
|
||||
@@ -181,7 +196,9 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
tabAlignment: TabAlignment.start,
|
||||
tabs: logic.tabs.map((e) {
|
||||
//「最新」有更新时右上角挂红点
|
||||
final showDot = !isDarkStyle && e.id == '-110' && marker.showHomeLatestDot;
|
||||
final showDot = !isDarkStyle &&
|
||||
e.id == '-110' &&
|
||||
marker.showHomeLatestDot;
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14.w),
|
||||
alignment: Alignment.center,
|
||||
@@ -204,8 +221,11 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
labelPadding: EdgeInsets.zero,
|
||||
unselectedLabelStyle: const TextStyle(fontSize: 14),
|
||||
unselectedLabelColor: const Color(0x80FFFFFF),
|
||||
labelStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
labelColor: isDarkStyle ? const Color(0xffFFC000) : const Color(0xffFFC000),
|
||||
labelStyle:
|
||||
const TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
|
||||
labelColor: isDarkStyle
|
||||
? const Color(0xffFFC000)
|
||||
: const Color(0xffFFC000),
|
||||
indicator: CustomIndicator(
|
||||
height: 2,
|
||||
width: 16.w,
|
||||
@@ -230,7 +250,8 @@ class _HomeTabViewState extends State<HomeTabView> with SingleTickerProviderStat
|
||||
onTap: () => widget.logic.openEndDrawer(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(bottom: 4),
|
||||
child: Image.asset('acg_menu.png'.acgImgPath, width: 24, color: const Color(0xff989898)),
|
||||
child: Image.asset('acg_menu.png'.acgImgPath,
|
||||
width: 24, color: const Color(0xff989898)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user