mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
tweaks (#1252)
* opt: cache * opt: MediaListPanel * feat: nested replyreply panel * tweaks * opt: abstract class * opt: PageStorageKey * opt: contextExt * opt: EpisodePanel * opt * opt: context instead GlobalKey * feat: jump to reply * refa: reply_reply * fix: jump * fix: index * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt: keepalive * reapply: nested replyreply * mod: spacing * opt: CommonSlidePageState * fix drag bottomsheet Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt reply jump Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt reply2reply Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * tweaks Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * tweaks Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * reapply: jumpToReply * fix: padding * fix: anim * fix some panels Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> * opt: implements Scaffold * opt: remove keepalive * revert: GlobalKey * tweaks Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
b9a55ccbce
commit
37fb63c3b1
@@ -142,7 +142,9 @@ abstract class MarqueeRender extends RenderBox
|
||||
if (value._ticker != null) {
|
||||
value._ticker!.absorbTicker(_ticker._ticker!);
|
||||
} else {
|
||||
value.createTicker(_onTick);
|
||||
value
|
||||
..createTicker(_onTick)
|
||||
..initStart();
|
||||
}
|
||||
}
|
||||
_ticker.cancel();
|
||||
@@ -223,7 +225,9 @@ abstract class MarqueeRender extends RenderBox
|
||||
|
||||
if (_distance > 0) {
|
||||
updateSize();
|
||||
_ticker.createTicker(_onTick);
|
||||
_ticker
|
||||
..createTicker(_onTick)
|
||||
..initStart();
|
||||
} else {
|
||||
_ticker.cancel();
|
||||
}
|
||||
@@ -394,13 +398,29 @@ class _MarqueeSimulation extends Simulation {
|
||||
);
|
||||
}
|
||||
|
||||
class ContextSingleTicker {
|
||||
class ContextSingleTicker implements TickerProvider {
|
||||
Ticker? _ticker;
|
||||
BuildContext context;
|
||||
final bool autoStart;
|
||||
|
||||
ContextSingleTicker(this.context);
|
||||
ContextSingleTicker(this.context, {this.autoStart = true});
|
||||
|
||||
void createTicker(TickerCallback onTick) {
|
||||
void initStart() {
|
||||
if (autoStart) {
|
||||
_ticker?.start();
|
||||
}
|
||||
}
|
||||
|
||||
void startIfNeeded() {
|
||||
if (_ticker case final ticker?) {
|
||||
if (!ticker.isActive) {
|
||||
ticker.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Ticker createTicker(TickerCallback onTick) {
|
||||
assert(() {
|
||||
if (_ticker == null) {
|
||||
return true;
|
||||
@@ -422,10 +442,11 @@ class ContextSingleTicker {
|
||||
_ticker = Ticker(
|
||||
onTick,
|
||||
debugLabel: kDebugMode ? 'created by ${describeIdentity(this)}' : null,
|
||||
)..start();
|
||||
);
|
||||
_tickerModeNotifier = TickerMode.getNotifier(context)
|
||||
..addListener(updateTicker);
|
||||
updateTicker(); // Sets _ticker.mute correctly.
|
||||
return _ticker!;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
|
||||
Reference in New Issue
Block a user