Initial commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user