mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix: failed to search history
This commit is contained in:
@@ -217,7 +217,7 @@ class Api {
|
|||||||
static const String delHistory = '/x/v2/history/delete';
|
static const String delHistory = '/x/v2/history/delete';
|
||||||
|
|
||||||
// 搜索历史记录
|
// 搜索历史记录
|
||||||
static const String searchHistory = '/x/web-goblin/history/search';
|
static const String searchHistory = '/x/web-interface/history/search';
|
||||||
|
|
||||||
// 热搜
|
// 热搜
|
||||||
static const String hotSearchList =
|
static const String hotSearchList =
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ class _CreatePanelState extends State<CreatePanel> {
|
|||||||
DateTime? _publishTime;
|
DateTime? _publishTime;
|
||||||
ReplyOption _replyOption = ReplyOption.allow;
|
ReplyOption _replyOption = ReplyOption.allow;
|
||||||
|
|
||||||
|
late final int _limit = 18;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_isEnableStream.close();
|
_isEnableStream.close();
|
||||||
@@ -532,39 +534,44 @@ class _CreatePanelState extends State<CreatePanel> {
|
|||||||
parent: BouncingScrollPhysics(),
|
parent: BouncingScrollPhysics(),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
itemCount: _pathList.length == 9 ? 9 : _pathList.length + 1,
|
itemCount:
|
||||||
|
_pathList.length == _limit ? _limit : _pathList.length + 1,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (_pathList.length != 9 && index == _pathList.length) {
|
if (_pathList.length != _limit && index == _pathList.length) {
|
||||||
return Material(
|
return Material(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
List<XFile> pickedFiles =
|
EasyThrottle.throttle(
|
||||||
await _imagePicker.pickMultiImage(
|
'imagePicker', const Duration(milliseconds: 500),
|
||||||
limit: 9,
|
() async {
|
||||||
imageQuality: 100,
|
List<XFile> pickedFiles =
|
||||||
);
|
await _imagePicker.pickMultiImage(
|
||||||
if (pickedFiles.isNotEmpty) {
|
limit: _limit,
|
||||||
for (int i = 0; i < pickedFiles.length; i++) {
|
imageQuality: 100,
|
||||||
if (_pathList.length == 9) {
|
);
|
||||||
SmartDialog.showToast('最多选择9张图片');
|
if (pickedFiles.isNotEmpty) {
|
||||||
if (i != 0) {
|
for (int i = 0; i < pickedFiles.length; i++) {
|
||||||
_pathStream.add(_pathList);
|
if (_pathList.length == _limit) {
|
||||||
}
|
SmartDialog.showToast('最多选择$_limit张图片');
|
||||||
break;
|
if (i != 0) {
|
||||||
} else {
|
_pathStream.add(_pathList);
|
||||||
_pathList.add(pickedFiles[i].path);
|
}
|
||||||
if (i == pickedFiles.length - 1) {
|
break;
|
||||||
_pathStream.add(_pathList);
|
} else {
|
||||||
|
_pathList.add(pickedFiles[i].path);
|
||||||
|
if (i == pickedFiles.length - 1) {
|
||||||
|
_pathStream.add(_pathList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (_pathList.isNotEmpty && !_isEnable) {
|
||||||
|
_isEnable = true;
|
||||||
|
_isEnableStream.add(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (_pathList.isNotEmpty && !_isEnable) {
|
});
|
||||||
_isEnable = true;
|
|
||||||
_isEnableStream.add(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
child: Ink(
|
child: Ink(
|
||||||
width: 75,
|
width: 75,
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class MemberControllerNew extends CommonController
|
|||||||
tabs = tab2!.map((item) => Tab(text: item.title ?? '')).toList();
|
tabs = tab2!.map((item) => Tab(text: item.title ?? '')).toList();
|
||||||
tabController = TabController(
|
tabController = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: response.response.tab2.length,
|
length: tab2!.length,
|
||||||
initialIndex: initialIndex == -1 ? 0 : initialIndex,
|
initialIndex: initialIndex == -1 ? 0 : initialIndex,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
|||||||
_lastTime = DateTime.now().millisecondsSinceEpoch;
|
_lastTime = DateTime.now().millisecondsSinceEpoch;
|
||||||
if (!widget.hasOneThree) {
|
if (!widget.hasOneThree) {
|
||||||
controller?.forward();
|
controller?.forward();
|
||||||
widget.callBack!(true);
|
widget.callBack?.call(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,11 +55,11 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
|||||||
int duration = DateTime.now().millisecondsSinceEpoch - _lastTime;
|
int duration = DateTime.now().millisecondsSinceEpoch - _lastTime;
|
||||||
if (duration < 1500) {
|
if (duration < 1500) {
|
||||||
controller?.reverse();
|
controller?.reverse();
|
||||||
widget.callBack!(false);
|
widget.callBack?.call(false);
|
||||||
}
|
}
|
||||||
if (duration <= 50 && !isCancel) {
|
if (duration <= 50 && !isCancel) {
|
||||||
feedBack();
|
feedBack();
|
||||||
widget.onTap!();
|
widget.onTap?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
|||||||
if (_hideCircle) {
|
if (_hideCircle) {
|
||||||
controller?.reset();
|
controller?.reset();
|
||||||
if (_isThumbUp) {
|
if (_isThumbUp) {
|
||||||
widget.onLongPress!();
|
widget.onLongPress?.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -108,14 +108,12 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
|||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
feedBack();
|
feedBack();
|
||||||
widget.onTap!();
|
widget.onTap?.call();
|
||||||
},
|
},
|
||||||
onLongPress: _isThumbUp
|
onLongPress: _isThumbUp
|
||||||
? null
|
? null
|
||||||
: () {
|
: () {
|
||||||
if (widget.onLongPress != null) {
|
widget.onLongPress?.call();
|
||||||
widget.onLongPress!();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onTapDown: (details) => _isThumbUp ? _startLongPress() : null,
|
onTapDown: (details) => _isThumbUp ? _startLongPress() : null,
|
||||||
onTapUp: (details) => _isThumbUp ? _cancelLongPress() : null,
|
onTapUp: (details) => _isThumbUp ? _cancelLongPress() : null,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:PiliPalaX/grpc/app/main/community/reply/v1/reply.pb.dart'
|
|||||||
as reply;
|
as reply;
|
||||||
import 'package:PiliPalaX/http/msg.dart';
|
import 'package:PiliPalaX/http/msg.dart';
|
||||||
import 'package:chat_bottom_container/chat_bottom_container.dart';
|
import 'package:chat_bottom_container/chat_bottom_container.dart';
|
||||||
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -62,6 +63,7 @@ class _ReplyPageState extends State<ReplyPage>
|
|||||||
late final _imagePicker = ImagePicker();
|
late final _imagePicker = ImagePicker();
|
||||||
late final _pathStream = StreamController<List<String>>();
|
late final _pathStream = StreamController<List<String>>();
|
||||||
late final _pathList = <String>[];
|
late final _pathList = <String>[];
|
||||||
|
late final _limit = 9;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@@ -355,29 +357,33 @@ class _ReplyPageState extends State<ReplyPage>
|
|||||||
tooltip: '图片',
|
tooltip: '图片',
|
||||||
selected: false,
|
selected: false,
|
||||||
icon: const Icon(Icons.image, size: 22),
|
icon: const Icon(Icons.image, size: 22),
|
||||||
onPressed: () async {
|
onPressed: () {
|
||||||
List<XFile> pickedFiles =
|
EasyThrottle.throttle(
|
||||||
await _imagePicker.pickMultiImage(
|
'imagePicker', const Duration(milliseconds: 500),
|
||||||
limit: 9,
|
() async {
|
||||||
imageQuality: 100,
|
List<XFile> pickedFiles =
|
||||||
);
|
await _imagePicker.pickMultiImage(
|
||||||
if (pickedFiles.isNotEmpty) {
|
limit: _limit,
|
||||||
for (int i = 0; i < pickedFiles.length; i++) {
|
imageQuality: 100,
|
||||||
if (_pathList.length == 9) {
|
);
|
||||||
SmartDialog.showToast('最多选择9张图片');
|
if (pickedFiles.isNotEmpty) {
|
||||||
if (i != 0) {
|
for (int i = 0; i < pickedFiles.length; i++) {
|
||||||
_pathStream.add(_pathList);
|
if (_pathList.length == _limit) {
|
||||||
}
|
SmartDialog.showToast('最多选择$_limit张图片');
|
||||||
break;
|
if (i != 0) {
|
||||||
} else {
|
_pathStream.add(_pathList);
|
||||||
_pathList.add(pickedFiles[i].path);
|
}
|
||||||
if (i == pickedFiles.length - 1) {
|
break;
|
||||||
SmartDialog.dismiss();
|
} else {
|
||||||
_pathStream.add(_pathList);
|
_pathList.add(pickedFiles[i].path);
|
||||||
|
if (i == pickedFiles.length - 1) {
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
_pathStream.add(_pathList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user