Skip to content

[Feature Request]: Support FocusNode for Android TV D-pad Navigation #200

@alexaungmyooo

Description

@alexaungmyooo

Version

5.3.1

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.27.1, on macOS 15.3.2 24D81 darwin-x64, locale en-GB)
    • Flutter version 3.27.1 on channel stable at /Users/aungmyooo/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (3 months ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/aungmyooo/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.98.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.106.0

[✓] Connected device (4 available)
    • AOSP TV on x86 (mobile)    • emulator-5554             • android-x86    • Android 14 (API 34) (emulator)
    • Aung Myo’s iPhone (mobile) • 00008120-0006612E0198A01E • ios            • iOS 18.3.2 22D82
    • macOS (desktop)            • macos                     • darwin-x64     • macOS 15.3.2 24D81 darwin-x64
    • Chrome (web)               • chrome                    • web-javascript • Google Chrome 134.0.6998.118

[✓] Network resources
    • All expected network resources are available.

• No issues found!

What platforms are you seeing the problem on?

Android

What happened?

We are building a Flutter app for Android TV, which uses D-pad navigation with FocusNode.
Your persistent_bottom_nav_bar_v2 package works great for routing and screen stacks, but unfortunately:

The default nav bars (Style1BottomNavBar, etc.) do not expose access to the nav item widgets.

This makes it impossible to add Focus, FocusNode, or handle LogicalKeyboardKey events for TV navigation.

What we expected
We'd love the ability to:

Provide a list of FocusNodes for each tab item.

Get a callback or hook like onNavItemFocused(int index) or onKeyEvent.

Or ideally, allow full override of item rendering inside nav bar styles (not just wrapping the nav bar itself).

Steps to reproduce

Install persistent_bottom_nav_bar_v2

Use PersistentTabView with Style1BottomNavBar

Attempt to apply FocusNode to individual tab items (impossible)

Try to add D-pad arrow key navigation (not supported)

Result: nav bar is not accessible for focus control

Code to reproduce the problem

N/A

Relevant log output

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions