Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-12-17 12:43:09 +08:00
parent ab1e5cb62a
commit b4fb7d14d4
31 changed files with 84 additions and 85 deletions

View File

@@ -18,16 +18,16 @@ class SelectTopicPanel extends StatefulWidget {
const SelectTopicPanel({
super.key,
this.scrollController,
this.callback,
this.onCachePos,
});
final ScrollController? scrollController;
final ValueChanged<double>? callback;
final ValueChanged<double>? onCachePos;
static Future<TopicItem?> onSelectTopic(
BuildContext context, {
double offset = 0,
ValueChanged<double>? callback,
ValueChanged<double>? onCachePos,
}) {
return showModalBottomSheet<TopicItem?>(
context: Get.context!,
@@ -46,7 +46,7 @@ class SelectTopicPanel extends StatefulWidget {
snapSizes: const [0.65],
builder: (context, scrollController) => SelectTopicPanel(
scrollController: scrollController,
callback: callback,
onCachePos: onCachePos,
),
),
);
@@ -171,7 +171,7 @@ class _SelectTopicPanelState
_controller.focusNode.unfocus();
}
} else if (notification is ScrollEndNotification) {
widget.callback?.call(notification.metrics.pixels);
widget.onCachePos?.call(notification.metrics.pixels);
}
return false;
},