提交 f1271eae authored 作者: yueweilu's avatar yueweilu

1、我的笔记才能删除

2、音频校验空数据 3、解析数据判空
上级 1921b708
......@@ -366,7 +366,9 @@ class NoteModel {
content = json['content'];
positioning = json['positioning'];
// noteContent = json['note_content'];
if (types ==3){
noteContent = json['note_content'] != null ? NoteContentModel.fromJson(json['note_content']) : null;
}
color = json['color'];
chapterName = json['chapter_name'];
isMy = json['is_my'];
......
......@@ -103,11 +103,13 @@ class NoteController extends GetxController {
);
for(NoteModel noteModel in result){
if(noteModel.noteContent!=null && noteModel.noteContent!.audio != null){
if(noteModel.noteContent!.audio!.isNotEmpty){
for(MediaModel mediaModel in noteModel.noteContent!.audio!){
Duration? duration = await just_audio.AudioPlayer().setUrl(mediaModel.content??'');
for(MediaModel? mediaModel in noteModel.noteContent!.audio!){
Duration? duration = await just_audio.AudioPlayer().setUrl(mediaModel?.content??'');
mediaModel.duration = Tools.formatDuration(duration!);
mediaModel?.duration = Tools.formatDuration(duration!);
}
}
}
}
......@@ -127,6 +129,7 @@ class NoteController extends GetxController {
refreshController.resetFooter();
} catch (error) {
refreshController.finishRefresh(IndicatorResult.fail);
Console.log('error-----------------------$error');
}
}
......@@ -139,6 +142,7 @@ class NoteController extends GetxController {
await _getNotes();
refreshController.finishLoad();
} catch (error) {
Console.log('error-----------------------$error');
refreshController.finishLoad(IndicatorResult.fail);
}
}
......
......@@ -77,11 +77,13 @@ class UserNotesDesController extends GetxController {
types: tag
);
for(NoteModel noteModel in result){
if(noteModel.noteContent!=null && noteModel.noteContent!.audio != null){
if(noteModel.noteContent!.audio!.isNotEmpty){
for(MediaModel mediaModel in noteModel.noteContent!.audio!){
Duration? duration = await just_audio.AudioPlayer().setUrl(mediaModel.content??'');
for(MediaModel? mediaModel in noteModel.noteContent!.audio!){
Duration? duration = await just_audio.AudioPlayer().setUrl(mediaModel?.content??'');
mediaModel.duration = Tools.formatDuration(duration!);
mediaModel?.duration = Tools.formatDuration(duration!);
}
}
}
}
......
......@@ -26,6 +26,7 @@ class BuildHigh extends StatelessWidget {
],
),
child: Slidable(
enabled: model.isMy == 1 ? true : false,
endActionPane: ActionPane(
motion: const ScrollMotion(),
children: [
......
......@@ -26,6 +26,7 @@ class BuildLine extends StatelessWidget {
],
),
child: Slidable(
enabled: model.isMy == 1 ? true : false,
endActionPane: ActionPane(
motion: const ScrollMotion(),
children: [
......
......@@ -31,6 +31,7 @@ class BuildNote extends StatelessWidget {
],
),
child: Slidable(
enabled: model.isMy == 1 ? true : false,
endActionPane: ActionPane(
motion: const ScrollMotion(),
children: [
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论