Skip to content

aman246149/flutter-tv-remote-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

flutter-tv-remote-control

image

To control app you only need these five button Left,Right,Top,Bottom and center for select

Basic thing to control TV remote button (You can achive this by using ShortCuts and focus)

  • 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()),
                        ));
                  },
  • image

If you want to perform any specific task from these four keys that is also very simple

source -https://api.flutter.dev/flutter/widgets/FocusNode-class.html

note-> Similar thing can be achieve by using ShortCut widget ,Actions Widget and Focus Widget and combination of all three widget is FocusDetectorWidget. But it is very hard to maintain sometime so i prefer above methods.😁😁

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published