mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-12 04:10:12 +08:00
opt mouse control
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/topic_item.dart';
|
||||
import 'package:PiliPlus/pages/fav/topic/controller.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -78,6 +79,13 @@ class _FavTopicPageState extends State<FavTopicPage>
|
||||
_controller.onLoadMore();
|
||||
}
|
||||
final item = response[index];
|
||||
|
||||
void onLongPress() => showConfirmDialog(
|
||||
context: context,
|
||||
title: '确定取消收藏?',
|
||||
onConfirm: () => _controller.onRemove(index, item.id),
|
||||
);
|
||||
|
||||
return Material(
|
||||
color: theme.colorScheme.onInverseSurface,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
@@ -89,13 +97,8 @@ class _FavTopicPageState extends State<FavTopicPage>
|
||||
'name': item.name!,
|
||||
},
|
||||
),
|
||||
onLongPress: () => showConfirmDialog(
|
||||
context: context,
|
||||
title: '确定取消收藏?',
|
||||
onConfirm: () {
|
||||
_controller.onRemove(index, item.id);
|
||||
},
|
||||
),
|
||||
onLongPress: Utils.isMobile ? onLongPress : null,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(6),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user