mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00

PlayerControls slider & duration are now vertical hotkey init moved to Home Player & YoutubeExplode are provided through riverpod Playback handles all things Player used to do GoRoutes are seperated from main to individual model file usePaletteColor bugfix occuring for before initilizing mount
19 lines
569 B
Dart
19 lines
569 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
bool? useIsCurrentRoute([String matcher = "/"]) {
|
|
final isCurrentRoute = useState<bool?>(null);
|
|
final context = useContext();
|
|
useEffect(() {
|
|
WidgetsBinding.instance?.addPostFrameCallback((timer) {
|
|
final isCurrent = GoRouter.of(context).location == matcher;
|
|
if (isCurrent != isCurrentRoute.value) {
|
|
isCurrentRoute.value = isCurrent;
|
|
}
|
|
});
|
|
return null;
|
|
});
|
|
return isCurrentRoute.value;
|
|
}
|