Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
b44d2924
提交
b44d2924
authored
3月 01, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加笔记时 语音可以播放
上级
d99e0482
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
49 行增加
和
20 行删除
+49
-20
controller.dart
lib/pages/read_web/controller.dart
+24
-1
category.dart
lib/pages/read_web/widgets/category.dart
+1
-1
discuss.dart
lib/pages/read_web/widgets/discuss.dart
+1
-1
input_discuss.dart
lib/pages/read_web/widgets/input_discuss.dart
+22
-16
note.dart
lib/pages/read_web/widgets/note.dart
+1
-1
没有找到文件。
lib/pages/read_web/controller.dart
浏览文件 @
b44d2924
...
@@ -81,6 +81,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -81,6 +81,8 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
late
TextEditingController
searchInput
=
TextEditingController
();
late
TextEditingController
searchInput
=
TextEditingController
();
just_audio
.
AudioPlayer
audioPlayer
=
just_audio
.
AudioPlayer
();
///------------------------------------------ 页面 生命周期--------------------------------------------------------
///------------------------------------------ 页面 生命周期--------------------------------------------------------
...
@@ -316,7 +318,6 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -316,7 +318,6 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
}
}
// 停止录音
// 停止录音
void
stopRecorder
()
async
{
void
stopRecorder
()
async
{
just_audio
.
AudioPlayer
audioPlayer
=
just_audio
.
AudioPlayer
();
startRecording
=
false
;
startRecording
=
false
;
final
path
=
await
_mRecorder
.
stopRecorder
();
final
path
=
await
_mRecorder
.
stopRecorder
();
var
duration
=
await
audioPlayer
.
setFilePath
(
path
!);
var
duration
=
await
audioPlayer
.
setFilePath
(
path
!);
...
@@ -354,6 +355,27 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
...
@@ -354,6 +355,27 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
clearDiscussAudios
();
clearDiscussAudios
();
}
}
// 播放音频
void
playAudio
(
AudioModel
audioModel
){
if
(
audioPlayer
.
playerState
.
playing
){
audioPlayer
.
stop
();
audioModel
.
currentDuration
=
'0:00:00'
;
// if(currentPlayMediaModel.id == mediaModel.id){
// return;
// }
}
// 本地音频
audioPlayer
.
setFilePath
(
audioModel
.
path
);
audioPlayer
.
play
();
audioPlayer
.
positionStream
.
listen
((
position
)
{
String
temp
=
Tools
.
formatDuration
(
position
);
Console
.
log
(
'播放时间---------------------
$temp
'
);
audioModel
.
currentDuration
=
temp
;
update
();
});
// currentPlayMediaModel = mediaModel;
}
// 添加讨论图片
// 添加讨论图片
void
addDiscussInputImages
(
String
path
){
void
addDiscussInputImages
(
String
path
){
discussInputImages
.
add
(
path
);
discussInputImages
.
add
(
path
);
...
@@ -874,4 +896,5 @@ class AudioModel {
...
@@ -874,4 +896,5 @@ class AudioModel {
AudioModel
({
required
this
.
path
,
required
this
.
duration
});
AudioModel
({
required
this
.
path
,
required
this
.
duration
});
String
path
;
String
path
;
String
duration
;
String
duration
;
late
String
currentDuration
;
}
}
lib/pages/read_web/widgets/category.dart
浏览文件 @
b44d2924
...
@@ -61,7 +61,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
...
@@ -61,7 +61,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
child:
CustomInputSearch
(
child:
CustomInputSearch
(
controller:
widget
.
controller
.
searchInput
,
controller:
widget
.
controller
.
searchInput
,
readOnly:
false
,
readOnly:
false
,
hintText:
'搜索全文
---目录
'
,
hintText:
'搜索全文'
,
onTap:
()
{
onTap:
()
{
// context.pushNamed(Routes.msgs);
// context.pushNamed(Routes.msgs);
},
},
...
...
lib/pages/read_web/widgets/discuss.dart
浏览文件 @
b44d2924
...
@@ -62,7 +62,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
...
@@ -62,7 +62,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
child:
CustomInputSearch
(
child:
CustomInputSearch
(
controller:
controller
.
searchInput
,
controller:
controller
.
searchInput
,
readOnly:
false
,
readOnly:
false
,
hintText:
'搜索全文
---讨论
'
,
hintText:
'搜索全文'
,
onTap:
()
{
onTap:
()
{
// context.pushNamed(Routes.msgs);
// context.pushNamed(Routes.msgs);
},
},
...
...
lib/pages/read_web/widgets/input_discuss.dart
浏览文件 @
b44d2924
...
@@ -125,23 +125,29 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
...
@@ -125,23 +125,29 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
physics:
const
NeverScrollableScrollPhysics
(),
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
itemBuilder:
(
BuildContext
context
,
int
index
){
return
Container
(
AudioModel
audioModel
=
widget
.
controller
.
discussInputAudios
[
index
];
height:
20
.
w
,
return
GestureDetector
(
margin:
EdgeInsets
.
only
(
right:
130
.
w
),
onTap:
(){
widget
.
controller
.
playAudio
(
audioModel
);
},
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
5
.
w
),
height:
20
.
w
,
padding:
EdgeInsets
.
only
(
right:
20
.
w
,
left:
10
.
w
),
margin:
EdgeInsets
.
only
(
right:
130
.
w
),
decoration:
BoxDecoration
(
child:
Container
(
borderRadius:
BorderRadius
.
circular
(
10
.
w
),
margin:
EdgeInsets
.
only
(
top:
5
.
w
),
color:
Colours
.
cF9
,
padding:
EdgeInsets
.
only
(
right:
20
.
w
,
left:
10
.
w
),
),
decoration:
BoxDecoration
(
child:
Row
(
borderRadius:
BorderRadius
.
circular
(
10
.
w
),
// mainAxisSize: MainAxisSize.min,
color:
Colours
.
cF9
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
),
children:
[
child:
Row
(
Image
.
asset
(
'assets/images/audio.png'
),
// mainAxisSize: MainAxisSize.min,
// Text('0:00/1:52',style: TextStyle(fontSize: 10.w,height: 1.4,color: Colours.c9),)
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
],
children:
[
Image
.
asset
(
'assets/images/audio.png'
),
// Text('0:00/1:52',style: TextStyle(fontSize: 10.w,height: 1.4,color: Colours.c9),)
],
),
),
),
),
),
);
);
...
...
lib/pages/read_web/widgets/note.dart
浏览文件 @
b44d2924
...
@@ -60,7 +60,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
...
@@ -60,7 +60,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
child:
CustomInputSearch
(
child:
CustomInputSearch
(
controller:
controller
.
searchInput
,
controller:
controller
.
searchInput
,
readOnly:
false
,
readOnly:
false
,
hintText:
'搜索全文
---笔记
'
,
hintText:
'搜索全文'
,
onTap:
()
{
onTap:
()
{
// context.pushNamed(Routes.msgs);
// context.pushNamed(Routes.msgs);
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论