- You need shortCut keys widget -- to determine different Intent (Like select Intent)
- Select Intent is enough to control the remote
return Shortcuts(
shortcuts: {
LogicalKeySet(LogicalKeyboardKey.select): ActivateIntent(),
// LogicalKeySet(LogicalKeyboardKey.enter): SelectIntent()
},
child: MaterialApp(
title: 'Flutter Demo',
- Last thing you need focus so that your tv remote knows where to click -- For This we use a widget which have autoFocus property
return ListView.builder(
itemCount: 20,
itemBuilder: (context, index) {
return InkWell(
autofocus: true, //here is autofocus
focusColor: Colors.green,
onTap: () {
print(index);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Details(
key: Key(index.toString()),
data: state.todos[index].title.toString()),
));
},
- visit this link to see the example to perform specific button task https://github.com/aman246149/flutter-tv-remote-control/blob/master/mysample/lib/main.dart
source -https://api.flutter.dev/flutter/widgets/FocusNode-class.html