Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
ec1b92d8
提交
ec1b92d8
authored
3月 13, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、删除无用代码
2、注释不必要log
上级
685056fd
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
7 行增加
和
39 行删除
+7
-39
controller.dart
lib/pages/read_web/controller.dart
+1
-1
index.dart
lib/pages/read_web/index.dart
+1
-0
view.dart
lib/pages/read_web/view.dart
+3
-34
http.dart
lib/services/http.dart
+2
-2
sql.dart
lib/utils/sql.dart
+0
-2
没有找到文件。
lib/pages/read_web/controller.dart
浏览文件 @
ec1b92d8
...
...
@@ -49,7 +49,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
bool
get
show
=>
_show
;
// 录音
final
FlutterSoundRecorder
_mRecorder
=
FlutterSoundRecorder
();
final
FlutterSoundRecorder
_mRecorder
=
FlutterSoundRecorder
(
logLevel:
Level
.
error
);
// 录音开始
bool
startRecording
=
false
;
// 是否存在离线文件
...
...
lib/pages/read_web/index.dart
浏览文件 @
ec1b92d8
...
...
@@ -23,6 +23,7 @@ import 'package:get/get.dart';
import
'package:go_router/go_router.dart'
;
import
'package:intl/intl.dart'
;
import
'package:just_audio/just_audio.dart'
as
just_audio
;
import
'package:logger/logger.dart'
;
import
'package:path_provider/path_provider.dart'
;
import
'dart:async'
;
import
'package:plugin_platform_interface/plugin_platform_interface.dart'
;
...
...
lib/pages/read_web/view.dart
浏览文件 @
ec1b92d8
...
...
@@ -262,19 +262,6 @@ class _ReadPageState extends State<ReadPage> {
},
),
// AnimatedPositioned(
// duration: readController.controller.duration!,
// curve: Curves.easeInOut,
// top: readController.show ? 0 : -100, // 负值隐藏,0 显示
// left: 0,
// right: 0,
// height: 100,
// child: Container(
// color: Colors.limeAccent,
// alignment: Alignment.center,
// child: Text('top View'),
// ),
// ),
Positioned
(
left:
0
,
right:
0
,
...
...
@@ -282,19 +269,6 @@ class _ReadPageState extends State<ReadPage> {
bottom:
69
,
child:
_showContent
(
readController
,
readController
.
toolModel
)
),
// AnimatedPositioned(
// duration: readController.controller.duration!,
// curve: Curves.easeInOut,
// bottom: readController.show ? 0 : -49 - MediaQuery.of(context).viewInsets.bottom, // 负值隐藏,0 显示
// left: 0,
// right: 0,
// height: 49,
// child: Container(
// color: Colors.limeAccent,
// alignment: Alignment.center,
// child: _createToolBar(readController)
// ),
// ),
/// 底部工具栏布局
Visibility
(
visible:
readController
.
show
,
...
...
@@ -400,14 +374,12 @@ class _ReadPageState extends State<ReadPage> {
// 点 搜索全部 列表 某一项 事件
onTapSearchItem:
(
SearchAllModel
sModel
){
controller
.
chooseTool
(
model
);
// TODO:重新加载阅读界面 参数:chapter_id text
Console
.
log
(
'-----------目录点击搜索条目---------------------'
);
// 加载阅读界面 参数:chapter_id text
controller
.
sModel
=
sModel
;
controller
.
selectChapter
(
ChapterModel
(
id:
sModel
.
chapterId
,
name:
sModel
.
chapterName
));
controller
.
webViewController
.
reload
();
},
onTapChapter:
(
ChapterModel
chapterModel
){
Console
.
log
(
'-----------选择的章节-------------
${chapterModel.name}
--------'
);
// 配置选择的章节
controller
.
selectChapter
(
chapterModel
);
// 取消选中 tool
...
...
@@ -426,8 +398,7 @@ class _ReadPageState extends State<ReadPage> {
// 点 搜索全部 列表 某一项 事件
onTapSearchItem:
(
SearchAllModel
sModel
){
controller
.
chooseTool
(
model
);
// TODO:重新加载阅读界面 参数:chapter_id text
Console
.
log
(
'-----------笔记点击搜索条目---------------------'
);
// 重新加载阅读界面 参数:chapter_id text
controller
.
sModel
=
sModel
;
controller
.
selectChapter
(
ChapterModel
(
id:
sModel
.
chapterId
,
name:
sModel
.
chapterName
));
controller
.
webViewController
.
reload
();
...
...
@@ -446,8 +417,7 @@ class _ReadPageState extends State<ReadPage> {
onTapSearchItem:
(
SearchAllModel
sModel
){
controller
.
chooseTool
(
model
);
controller
.
sModel
=
sModel
;
// TODO:重新加载阅读界面 参数:chapter_id text
Console
.
log
(
'-----------讨论点击搜索条目---------------------'
);
// 重新加载阅读界面 参数:chapter_id text
controller
.
selectChapter
(
ChapterModel
(
id:
sModel
.
chapterId
,
name:
sModel
.
chapterName
));
controller
.
webViewController
.
reload
();
},
...
...
@@ -459,7 +429,6 @@ class _ReadPageState extends State<ReadPage> {
}
/// 目录、评论、笔记 背景
Widget
_showContent
(
ReadController
controller
,
ToolModel
model
)
{
Console
.
log
(
'++++++++++++++++++++++++
${model.tag}
'
);
if
(
controller
.
show
){
if
(
model
.
selected
){
return
GestureDetector
(
...
...
lib/services/http.dart
浏览文件 @
ec1b92d8
...
...
@@ -345,7 +345,7 @@ class _CacheInterceptor extends Interceptor {
// 在发起请求之前,检查缓存是否存在有效数据
String
cacheKey
=
'
${options.uri.toString()}
?
${options.data}
'
;
final
cachedFile
=
await
DefaultCacheManager
().
getFileFromCache
(
cacheKey
);
Console
.
log
(
'获取数据----------cacheKey-----------------------
$cacheKey
'
);
//
Console.log('获取数据----------cacheKey-----------------------$cacheKey');
if
(
cachedFile
!=
null
&&
cachedFile
.
validTill
.
isAfter
(
DateTime
.
now
()))
{
// 如果缓存有效,直接返回缓存数据
final
cachedData
=
await
cachedFile
.
file
.
readAsBytes
();
...
...
@@ -374,7 +374,7 @@ class _CacheInterceptor extends Interceptor {
final
requestBody
=
response
.
requestOptions
.
data
.
toString
();
// 将 GET 请求的参数和请求体参数拼接成缓存的键
final
cacheKey
=
requestBody
.
isEmpty
?
url
:
'
$url
?
$requestBody
'
;
Console
.
log
(
'----------cacheKey-----------------------
$cacheKey
'
);
//
Console.log('----------cacheKey-----------------------$cacheKey');
// 将响应数据转换为字符串,并将其编码为字节列表
List
<
int
>
bytes
=
utf8
.
encode
(
jsonEncode
(
response
.
data
));
Uint8List
uint8List
=
Uint8List
.
fromList
(
bytes
);
...
...
lib/utils/sql.dart
浏览文件 @
ec1b92d8
...
...
@@ -53,10 +53,8 @@ class SqlManager {
static
Future
<
Database
?>
getCurrentDatabase
()
async
{
if
(
_database
==
null
)
{
Console
.
log
(
'Sql-------------getCurrentDatabase---------------_database == null----'
);
await
init
();
}
Console
.
log
(
'Sql-------------getCurrentDatabase---------------
$_database
'
);
return
_database
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论