mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-23 12:00:13 +08:00
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user