Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-20 22:44:09 +08:00
parent db65e7df76
commit 7617bb692a
21 changed files with 279 additions and 280 deletions

View File

@@ -86,6 +86,14 @@ mixin CommonDynPageMixin<T extends StatefulWidget>
padding = MediaQuery.viewPaddingOf(context);
}
@override
bool onNotification(UserScrollNotification notification) {
if (notification.metrics.axisDirection == .down) {
return super.onNotification(notification);
}
return false;
}
Widget buildReplyHeader() {
final secondary = theme.colorScheme.secondary;
return SliverPinnedHeader(
@@ -331,22 +339,4 @@ mixin CommonDynPageMixin<T extends StatefulWidget>
tooltip: '评论',
child: const Icon(Icons.reply),
);
Widget fabAnimWrapper(Widget child) {
return NotificationListener<UserScrollNotification>(
onNotification: (notification) {
if (notification.metrics.axisDirection == .down) {
switch (notification.direction) {
case .forward:
showFab();
case .reverse:
hideFab();
default:
}
}
return false;
},
child: child,
);
}
}

View File

@@ -34,6 +34,24 @@ mixin BaseFabMixin<T extends StatefulWidget> on State<T>, TickerProvider {
fabAnimationCtr.forward();
}
}
Widget fabAnimWrapper({required Widget child}) {
return NotificationListener<UserScrollNotification>(
onNotification: onNotification,
child: child,
);
}
bool onNotification(UserScrollNotification notification) {
switch (notification.direction) {
case .forward:
showFab();
case .reverse:
hideFab();
default:
}
return false;
}
}
mixin FabMixin<T extends StatefulWidget> on BaseFabMixin<T> {