FireTVRemoteListener class
A widget that listens for Fire TV remote events and calls the specified callbacks
This widget requires a FocusNode and a Widget child.
Most key press events are called immediately when the user presses a button.
The special afterButton function is called after every detected event whether a press RawKeyDownEvent or release RawKeyUpEvent. It is called after the other events have been handled. This is useful for triggering a widget rebuild, or for passing keyboard event data back to the parent for further handling.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- FireTVRemoteListener
Constructors
- FireTVRemoteListener({Key? key, void onUp()?, void onDown()?, void onLeft()?, void onRight()?, void onSelect()?, void onPlayPause()?, void onRew()?, void onFF()?, void onMenu()?, void onPressed(RawKeyDownEvent)?, void onReleased(RawKeyUpEvent)?, void afterButton(RawKeyEvent)?, required Widget child, required FocusNode focusNode})
-
const
Properties
- afterButton → (void Function(RawKeyEvent)?)
-
Will be called after every key event whether RawKeyDownEvent or RawKeyUpEvent.
final
- child → Widget
-
final
- focusNode → FocusNode
-
All widgets that listen to keyboard events need a FocusNode. This widget is stateless,
so you need to create focusNode externally. Remember to
dispose
all FocusNodes.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onDown → (void Function()?)
-
Will be called whenever the user presses Down on the remote.
final
- onFF → (void Function()?)
-
Will be called whenever the user presses FastForward on the remote.
final
- onLeft → (void Function()?)
-
Will be called whenever the user presses Left on the remote.
final
- onMenu → (void Function()?)
-
Will be called whenever the user presses the Menu Button on the remote.
final
- onPlayPause → (void Function()?)
-
Will be called whenever the user presses Play/Pause on the remote.
final
- onPressed → (void Function(RawKeyDownEvent)?)
-
Will be called for every RawKeyDownEvent.
final
- onReleased → (void Function(RawKeyUpEvent)?)
-
Will be called for every RawKeyUpEvent.
final
- onRew → (void Function()?)
-
Will be called whenever the user presses Rewind on the remote.
final
- onRight → (void Function()?)
-
Will be called whenever the user presses Right on the remote.
final
- onSelect → (void Function()?)
-
Will be called whenever the user presses the Center Button on the remote.
final
- onUp → (void Function()?)
-
Will be called whenever the user presses Up on the remote.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
handleEvent(
RawKeyEvent event) → void - For some reason, Flutter LogicalKeyboardKey getters are not constant and therefore cannot be used properly in switch/case statements. We must use if/else to handle each possible event.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited