mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: reply panel
This commit is contained in:
@@ -349,35 +349,38 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
selected: !snapshot.data!,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
ToolbarIconButton(
|
||||
tooltip: '图片',
|
||||
selected: false,
|
||||
icon: const Icon(Icons.image, size: 22),
|
||||
onPressed: () async {
|
||||
List<XFile> pickedFiles = await _imagePicker.pickMultiImage(
|
||||
limit: 9,
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFiles.isNotEmpty) {
|
||||
for (int i = 0; i < pickedFiles.length; i++) {
|
||||
if (_pathList.length == 9) {
|
||||
SmartDialog.showToast('最多选择9张图片');
|
||||
if (i != 0) {
|
||||
_pathStream.add(_pathList);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
_pathList.add(pickedFiles[i].path);
|
||||
if (i == pickedFiles.length - 1) {
|
||||
SmartDialog.dismiss();
|
||||
_pathStream.add(_pathList);
|
||||
if (widget.root == 0) ...[
|
||||
const SizedBox(width: 20),
|
||||
ToolbarIconButton(
|
||||
tooltip: '图片',
|
||||
selected: false,
|
||||
icon: const Icon(Icons.image, size: 22),
|
||||
onPressed: () async {
|
||||
List<XFile> pickedFiles =
|
||||
await _imagePicker.pickMultiImage(
|
||||
limit: 9,
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFiles.isNotEmpty) {
|
||||
for (int i = 0; i < pickedFiles.length; i++) {
|
||||
if (_pathList.length == 9) {
|
||||
SmartDialog.showToast('最多选择9张图片');
|
||||
if (i != 0) {
|
||||
_pathStream.add(_pathList);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
_pathList.add(pickedFiles[i].path);
|
||||
if (i == pickedFiles.length - 1) {
|
||||
SmartDialog.dismiss();
|
||||
_pathStream.add(_pathList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
],
|
||||
const Spacer(),
|
||||
StreamBuilder(
|
||||
initialData: _enablePublish,
|
||||
|
||||
@@ -255,16 +255,18 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
)
|
||||
.then((value) {
|
||||
// 完成评论,数据添加 // TODO: data cast
|
||||
if (value != null && value['data'] is ReplyInfo) {
|
||||
if (value != null && value['data'] != null) {
|
||||
_savedReplies[key] = null;
|
||||
List<ReplyInfo> list =
|
||||
_videoReplyReplyController.loadingState.value is Success
|
||||
? (_videoReplyReplyController.loadingState.value as Success)
|
||||
.response
|
||||
: <ReplyInfo>[];
|
||||
list.add(value['data']);
|
||||
_videoReplyReplyController.loadingState.value =
|
||||
LoadingState.success(list);
|
||||
if (value['data'] is ReplyInfo) {
|
||||
List<ReplyInfo> list =
|
||||
_videoReplyReplyController.loadingState.value is Success
|
||||
? (_videoReplyReplyController.loadingState.value as Success)
|
||||
.response
|
||||
: <ReplyInfo>[];
|
||||
list.add(value['data']);
|
||||
_videoReplyReplyController.loadingState.value =
|
||||
LoadingState.success(list);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user