Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
10e54730
提交
10e54730
authored
3月 18, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
目录标识当前读到的章节
上级
8b08f2b4
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
20 行增加
和
11 行删除
+20
-11
library.dart
lib/models/library.dart
+3
-1
item.dart
lib/pages/book_category/widgets/item.dart
+1
-1
controller.dart
lib/pages/book_detail/controller.dart
+8
-3
view.dart
lib/pages/read_web/view.dart
+6
-5
item.dart
lib/pages/read_web/widgets/item.dart
+2
-1
没有找到文件。
lib/models/library.dart
浏览文件 @
10e54730
...
...
@@ -595,9 +595,11 @@ class SearchAllModel {
class
PopBackModel
{
PopBackModel
({
required
this
.
chapterId
,
required
this
.
back
required
this
.
back
,
required
this
.
chapterName
});
String
chapterId
;
String
chapterName
;
bool
back
;
}
lib/pages/book_category/widgets/item.dart
浏览文件 @
10e54730
...
...
@@ -144,7 +144,7 @@ class _BuildItemState extends State<BuildItem> {
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
currentRead
?
AppTheme
.
primary
:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Gaps
.
hGaps5
,
chapterModel
.
isReading
==
1
?
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
...
...
lib/pages/book_detail/controller.dart
浏览文件 @
10e54730
...
...
@@ -5,7 +5,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
final
String
bookId
;
BookDetailController
(
this
.
bookId
);
late
TabController
tabController
;
final
PageController
pageController
=
PageController
(
initialPage:
0
);
List
<
Widget
>
tabs
=
[
const
Tab
(
text:
'目录'
,),
...
...
@@ -13,6 +13,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'本书信息'
,),
];
late
TabController
tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
num
currentChapterId
=
0
;
...
...
@@ -24,7 +25,6 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
@override
void
onInit
()
{
tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
super
.
onInit
();
}
...
...
@@ -53,6 +53,11 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
/// 设置当前读的章节id
void
setCurrentReadChapterId
(){
for
(
ChapterModel
chapterModel
in
chapters
){
chapterModel
.
currentRead
=
false
;
if
(
chapterModel
.
id
==
currentChapterId
){
chapterModel
.
currentRead
=
true
;
chapterModel
.
selected
=
true
;
}
writeCurrentReadChapterIdToData
(
chapterModel
);
}
...
...
@@ -66,7 +71,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
cModel
.
selected
=
true
;
chapterModel
.
selected
=
true
;
}
writeCurrentReadChapterIdToData
(
c
hapter
Model
);
writeCurrentReadChapterIdToData
(
cModel
);
}
}
...
...
lib/pages/read_web/view.dart
浏览文件 @
10e54730
...
...
@@ -27,16 +27,16 @@ class _ReadPageState extends State<ReadPage> {
}
@override
Widget
build
(
BuildContext
context
)
{
PopBackModel
backModel
=
PopBackModel
(
chapterId:
widget
.
chapterId
,
back:
true
);
return
WillPopScope
(
return
GetBuilder
(
init:
ReadController
(
bookId:
widget
.
bookId
,
chapterId:
widget
.
chapterId
,
chapterName:
widget
.
chapterName
,
bookDetailModel:
widget
.
bookDetailModel
,
noteId:
widget
.
noteId
),
builder:
(
readController
)
=>
WillPopScope
(
onWillPop:
()
async
{
PopBackModel
backModel
=
PopBackModel
(
chapterId:
readController
.
chapterId
,
back:
true
,
chapterName:
readController
.
chapterId
);
context
.
pop
(
backModel
);
CustomToast
.
dismiss
();
return
false
;
},
child:
GetBuilder
<
ReadController
>(
init:
ReadController
(
bookId:
widget
.
bookId
,
chapterId:
widget
.
chapterId
,
chapterName:
widget
.
chapterName
,
bookDetailModel:
widget
.
bookDetailModel
,
noteId:
widget
.
noteId
),
builder:
(
readController
)
=>
Scaffold
(
child:
Scaffold
(
appBar:
CustomAppBar
(
titleSpacing:
0
,
title:
Align
(
...
...
@@ -409,6 +409,7 @@ class _ReadPageState extends State<ReadPage> {
controller
.
chooseTool
(
model
);
// 选择了新的章节 刷新 webview
controller
.
webViewController
.
reload
();
controller
.
setCurrentReadChapterId
();
},
);
}
...
...
lib/pages/read_web/widgets/item.dart
浏览文件 @
10e54730
...
...
@@ -100,6 +100,7 @@ class _BuildItemState extends State<BuildItem> {
onTap:
(){
if
(
chapterModel
.
children
!.
isEmpty
){
widget
.
onTapChapter
(
chapterModel
);
chapterModel
.
currentRead
=
true
;
}
else
{
setState
(()
{
...
...
@@ -130,7 +131,7 @@ class _BuildItemState extends State<BuildItem> {
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Text
(
chapterModel
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
chapterModel
.
currentRead
?
AppTheme
.
primary
:
chapterModel
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Gaps
.
hGaps5
,
chapterModel
.
isReading
==
1
?
Container
(
margin:
const
EdgeInsets
.
fromLTRB
(
0
,
6
,
0
,
0
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论