mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-03 00:29:42 +08:00
fix: failed to search history
This commit is contained in:
@@ -47,7 +47,7 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
||||
_lastTime = DateTime.now().millisecondsSinceEpoch;
|
||||
if (!widget.hasOneThree) {
|
||||
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;
|
||||
if (duration < 1500) {
|
||||
controller?.reverse();
|
||||
widget.callBack!(false);
|
||||
widget.callBack?.call(false);
|
||||
}
|
||||
if (duration <= 50 && !isCancel) {
|
||||
feedBack();
|
||||
widget.onTap!();
|
||||
widget.onTap?.call();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
||||
if (_hideCircle) {
|
||||
controller?.reset();
|
||||
if (_isThumbUp) {
|
||||
widget.onLongPress!();
|
||||
widget.onLongPress?.call();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -108,14 +108,12 @@ class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
||||
? null
|
||||
: () {
|
||||
feedBack();
|
||||
widget.onTap!();
|
||||
widget.onTap?.call();
|
||||
},
|
||||
onLongPress: _isThumbUp
|
||||
? null
|
||||
: () {
|
||||
if (widget.onLongPress != null) {
|
||||
widget.onLongPress!();
|
||||
}
|
||||
widget.onLongPress?.call();
|
||||
},
|
||||
onTapDown: (details) => _isThumbUp ? _startLongPress() : null,
|
||||
onTapUp: (details) => _isThumbUp ? _cancelLongPress() : null,
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:PiliPalaX/grpc/app/main/community/reply/v1/reply.pb.dart'
|
||||
as reply;
|
||||
import 'package:PiliPalaX/http/msg.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_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -62,6 +63,7 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
late final _imagePicker = ImagePicker();
|
||||
late final _pathStream = StreamController<List<String>>();
|
||||
late final _pathList = <String>[];
|
||||
late final _limit = 9;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -355,29 +357,33 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
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);
|
||||
onPressed: () {
|
||||
EasyThrottle.throttle(
|
||||
'imagePicker', const Duration(milliseconds: 500),
|
||||
() async {
|
||||
List<XFile> pickedFiles =
|
||||
await _imagePicker.pickMultiImage(
|
||||
limit: _limit,
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFiles.isNotEmpty) {
|
||||
for (int i = 0; i < pickedFiles.length; i++) {
|
||||
if (_pathList.length == _limit) {
|
||||
SmartDialog.showToast('最多选择$_limit张图片');
|
||||
if (i != 0) {
|
||||
_pathStream.add(_pathList);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
_pathList.add(pickedFiles[i].path);
|
||||
if (i == pickedFiles.length - 1) {
|
||||
SmartDialog.dismiss();
|
||||
_pathStream.add(_pathList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user