21 lines
520 B
Dart
21 lines
520 B
Dart
|
|
import 'package:flutter/foundation.dart';
|
||
|
|
|
||
|
|
|
||
|
|
enum PlayerPanelCategory { subtitle, audio, speed, fit, episode, danmaku }
|
||
|
|
|
||
|
|
|
||
|
|
class PlayerPanelController extends ValueNotifier<PlayerPanelCategory?> {
|
||
|
|
PlayerPanelController() : super(null);
|
||
|
|
|
||
|
|
bool get isOpen => value != null;
|
||
|
|
PlayerPanelCategory? get category => value;
|
||
|
|
|
||
|
|
void open(PlayerPanelCategory category) => value = category;
|
||
|
|
|
||
|
|
|
||
|
|
void toggle(PlayerPanelCategory category) =>
|
||
|
|
value = (value == category) ? null : category;
|
||
|
|
|
||
|
|
void close() => value = null;
|
||
|
|
}
|