refactor: fix warnings
This commit is contained in:
@@ -56,7 +56,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
|
||||
_updateFocusHighlightStrategy(_mode);
|
||||
// Listen to hardware keyboard events globally
|
||||
HardwareKeyboard.instance.addHandler(_handleKeyEvent);
|
||||
RawKeyboard.instance.addListener(_handleRawKeyEvent);
|
||||
|
||||
// Register callback for gamepad input to switch to keyboard mode
|
||||
GamepadService.onGamepadInput = () => _setMode(InputMode.keyboard);
|
||||
@@ -65,7 +64,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
|
||||
@override
|
||||
void dispose() {
|
||||
HardwareKeyboard.instance.removeHandler(_handleKeyEvent);
|
||||
RawKeyboard.instance.removeListener(_handleRawKeyEvent);
|
||||
GamepadService.onGamepadInput = null;
|
||||
super.dispose();
|
||||
}
|
||||
@@ -79,12 +77,6 @@ class _InputModeTrackerState extends State<InputModeTracker> {
|
||||
return false;
|
||||
}
|
||||
|
||||
void _handleRawKeyEvent(RawKeyEvent event) {
|
||||
if (event is RawKeyDownEvent) {
|
||||
_setMode(InputMode.keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
void _setMode(InputMode mode) {
|
||||
if (_mode != mode) {
|
||||
setState(() => _mode = mode);
|
||||
|
||||
Reference in New Issue
Block a user