Flutter TV remote navigation: text fields that give the arrows back, with wind_kit 1.15
- published
- reading
- 6 min
- author
- Anılcan Çakır
- lang
- en tr
- format
- markdown
On a TV, a focused Flutter text field keeps every arrow key for its caret, and Back on the remote can pop the whole form. wind_kit 1.15 fixes both with one theme flag, remoteNavigation, and focusScale lifts the focused card so it reads from across the room.
On this page
The remote has five buttons, and the text field took four#
Today, I'll show you how to make a Flutter form work with a TV remote: arrows that move between fields, a Back button that leaves the field instead of the whole page, and a focused card you can see from the couch.
A TV remote has arrows, Select and Back. No pointer, no keyboard. Put a Flutter text field on that screen and two things go wrong:
- The arrows get stuck. On Apple platforms the text-editing shortcuts bind every arrow to a caret move, and the field's own directional focus action ignores the arrow by design. Once the remote lands on a field, Up and Down move the caret, so the user cannot get out.
- Back closes the form. On an Apple TV build (through the community flutter-tvos engine), the remote's Menu button arrives as
goBack. When nothing handles it, the engine pops the route, and the whole form goes away with what the user typed.
Android TV has its own version of the first one: flutter/flutter#147772, "D-pad navigation on TextField is broken", has been open since May 2024.
wind_kit 1.15.0 (released on 2 December 2026) fixes both with one theme flag, and adds a second flag for the focus ring. Here is what you'll get from this post:
- the two flags and where they go,
- a small TV app (a row of shows and an "Add a profile" form) you can run on the web with the arrow keys,
- screenshots of the same form with the flag off and on,
- where this is the wrong tool.
Let's start.
Two flags in the theme#
Both switches live in WindThemeData. I turn them on only for a TV build, because a phone needs neither:
// lib/config/theme.dart
import 'package:flutter/widgets.dart';
import 'package:wind_kit/wind_kit.dart';
/// Whether this is a TV build.
///
/// Set at compile time with `--dart-define=TV=true`; a phone or desktop build leaves it
/// out. Nothing here detects the device.
const bool isTelevision = bool.fromEnvironment('TV');
/// The app's dark palette, plus the two TV switches.
///
/// `remoteNavigation` lets a focused single-line field hand the remote's arrows to focus
/// traversal and leave on Back, and `focusScale` lifts the focused card so it reads from
/// across the room. Both stay off on a phone, where a finger needs neither.
final WindThemeData appTheme = WindThemeData(
brightness: Brightness.dark,
syncWithSystem: false,
remoteNavigation: isTelevision,
focusScale: isTelevision ? 1.05 : 1.0,
ringColor: const Color(0xFF96D0FF),
aliases: {
'bg-surface': 'bg-[#15191f]',
'bg-panel': 'bg-[#22272e]',
'bg-raised': 'bg-[#2d333b]',
'border-line': 'border-[#373e47]',
'bg-accent': 'bg-[#539bf5]',
'text-ink': 'text-[#cdd9e5]',
'text-soft': 'text-[#adbac7]',
'text-faint': 'text-[#8b949e]',
'text-on-accent': 'text-[#15191f]',
'text-warm': 'text-[#f69d50]',
},
);
remoteNavigation: truemakes a focused single-lineWInputhand the arrows to focus traversal, and makes Back (goBack) or Escape leave the field without popping the route.focusScale: 1.05lifts a focusedWDivwhoseclassNamehas afocus:class. Five percent sounds small, but it reads from across a room.
The TV build passes --dart-define=TV=true. The rest of the file is the dark palette of this blog, as aliases, so your copy looks like the screenshots below.
The form you drive with arrows#
The form is plain wind_kit: two WInput fields and two WButtons. There is no TV code in it at all:
// lib/pages/profile_form_page.dart
import 'package:flutter/widgets.dart';
import 'package:wind_kit/wind_kit.dart';
/// Adds a profile from the couch: two fields and two buttons, all reachable by arrows.
class ProfileFormPage extends StatefulWidget {
const ProfileFormPage({super.key});
@override
State<ProfileFormPage> createState() => _ProfileFormPageState();
}
class _ProfileFormPageState extends State<ProfileFormPage> {
String _name = '';
String _email = '';
static const String _fieldClass =
'w-full px-4 py-3 rounded-lg bg-panel border border-line '
'text-lg text-ink focus:border-[#539bf5] focus:ring-2';
@override
Widget build(BuildContext context) {
return WDiv(
className: 'bg-surface flex flex-col px-16 py-12',
child: WDiv(
className: 'flex flex-col gap-6 w-[640px]',
children: [
WText('Add a profile', className: 'text-3xl font-bold text-ink'),
WText(
'Move with the arrows, press Select to type.',
className: 'text-base text-faint',
),
_label('Name'),
WInput(
value: _name,
onChanged: (value) => setState(() => _name = value),
autofocus: true,
placeholder: 'Who is watching?',
className: _fieldClass,
placeholderClassName: 'text-faint',
),
_label('Email'),
WInput(
value: _email,
onChanged: (value) => setState(() => _email = value),
type: InputType.email,
placeholder: 'For the sign-in link',
className: _fieldClass,
placeholderClassName: 'text-faint',
),
WDiv(
className: 'flex flex-row gap-4 pt-2',
children: [
WButton(
onTap: () => Navigator.of(context).pop(),
className: 'px-6 py-3 rounded-lg bg-accent focus:ring-2',
child: WText(
'Save',
className: 'text-base font-semibold text-on-accent',
),
),
WButton(
onTap: () => Navigator.of(context).pop(),
className: 'px-6 py-3 rounded-lg bg-panel border border-line focus:ring-2',
child: WText(
'Cancel',
className: 'text-base font-medium text-ink',
),
),
],
),
],
),
);
}
Widget _label(String text) =>
WText(text, className: 'text-sm font-medium text-soft -mb-3');
}
Let's give it a shot. First without the flag. I typed a name, then pressed Down twice:

The focus ring is still on Name. On a remote this is a dead end: the arrows belong to the caret now, and there is no Tab key to escape with.
Now the same build with remoteNavigation on. I typed the name and pressed Down once:

Focus moved to Email. Select starts editing as before, so the remote's click is still "type here".
A few details I like here:
- An arrow at the edge of the form is left unhandled, so a handler above it still hears it. A side rail that opens on Left keeps working.
- A multi-line field keeps its arrows for the caret, because there the caret really needs them.
- A disabled
WInputtakes no focus at all, so an arrow never lands on a field the user cannot use.
// lib/main.dart
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:wind_kit/wind_kit.dart';
import 'config/theme.dart';
import 'pages/home_page.dart';
void main() {
runApp(const CouchApp());
}
/// A small TV app: a row of shows to pick from and a form to add a profile.
class CouchApp extends StatelessWidget {
const CouchApp({super.key});
@override
Widget build(BuildContext context) {
return WindTheme(
data: appTheme,
child: WidgetsApp(
title: 'Couch',
color: const Color(0xFF539BF5),
debugShowCheckedModeBanner: false,
shortcuts: _remoteShortcuts,
pageRouteBuilder: <T>(RouteSettings settings, WidgetBuilder builder) =>
PageRouteBuilder<T>(
settings: settings,
pageBuilder: (context, _, _) => builder(context),
),
home: const HomePage(),
),
);
}
}
/// The remote's arrows move focus, as they do on a TV build.
///
/// On iOS, Android and the desktops `WidgetsApp.defaultShortcuts` already binds the
/// arrows to directional focus; on the web it binds them to scrolling, so the web build
/// of this demo maps them back.
final Map<ShortcutActivator, Intent> _remoteShortcuts = {
...WidgetsApp.defaultShortcuts,
const SingleActivator(LogicalKeyboardKey.arrowUp):
const DirectionalFocusIntent(TraversalDirection.up),
const SingleActivator(LogicalKeyboardKey.arrowDown):
const DirectionalFocusIntent(TraversalDirection.down),
const SingleActivator(LogicalKeyboardKey.arrowLeft):
const DirectionalFocusIntent(TraversalDirection.left),
const SingleActivator(LogicalKeyboardKey.arrowRight):
const DirectionalFocusIntent(TraversalDirection.right),
};
Back leaves the field, not the page#
Think of a TV remote's Back button like the Esc key in a dialog: it should close the smallest thing that is open. With the flag on, Back (or Escape on a keyboard) closes the field, not the page.
I filled Email, then pressed Escape:

The form is still there, and focus went back to Name, the control that was focused before Email. That part matters on a remote: without it nothing is focused after you leave the field, and the next arrow jumps to the first control on the screen.
When no field is focused, wind_kit does not listen at all, so Back on the form itself still pops the route. That is what a TV user expects.
A focus you can see from the couch#
On a phone you see your finger. On a TV, the focus ring is the only cursor the user has, and they read it from across the room. So the home screen's cards ring and lift:
// lib/pages/home_page.dart
import 'package:flutter/widgets.dart';
import 'package:wind_kit/wind_kit.dart';
import 'profile_form_page.dart';
/// The TV home: a row of shows the remote moves through, and a way to add a profile.
class HomePage extends StatelessWidget {
const HomePage({super.key});
static const List<(String, String)> _shows = [
('Northern Lines', 'Season 2, episode 4'),
('The Quiet Kitchen', 'Episode 7'),
('Harbour Nights', 'Season 1, episode 9'),
('Paper Planets', 'Episode 2'),
];
@override
Widget build(BuildContext context) {
return WDiv(
className: 'bg-surface flex flex-col gap-8 px-16 py-12',
children: [
WDiv(
className: 'flex flex-row items-center justify-between',
children: [
WText('Couch', className: 'text-3xl font-bold text-ink'),
WButton(
onTap: () => Navigator.of(context).push(
PageRouteBuilder<void>(
pageBuilder: (_, _, _) => const ProfileFormPage(),
),
),
className: 'px-5 py-3 rounded-lg bg-panel border border-line focus:ring-2',
child: WText(
'Add a profile',
className: 'text-base font-medium text-ink',
),
),
],
),
WText(
'Continue watching',
className: 'text-xl font-semibold text-soft',
),
// The padding leaves room for the lift: a lifted card paints outside its box.
WDiv(
className: 'flex flex-row gap-6 py-4',
children: [
for (final (index, (title, progress)) in _shows.indexed)
_ShowCard(
title: title,
progress: progress,
autofocus: index == 0,
),
],
),
],
);
}
}
/// A poster the remote can land on: it rings and lifts while focused.
class _ShowCard extends StatelessWidget {
const _ShowCard({
required this.title,
required this.progress,
this.autofocus = false,
});
final String title;
final String progress;
/// The first card takes focus on open, so the remote has a place to start.
final bool autofocus;
@override
Widget build(BuildContext context) {
return WAnchor(
onTap: () {},
autofocus: autofocus,
child: WDiv(
className:
'w-64 rounded-xl overflow-hidden bg-raised border border-line '
'focus:ring-4 duration-150 ease-out',
children: [
WDiv(
className: 'w-full h-36 bg-panel flex items-center justify-center',
child: WText(
title.substring(0, 1),
className: 'text-5xl font-bold text-warm',
),
),
WDiv(
className: 'flex flex-col gap-1 p-4',
children: [
WText(title, className: 'text-base font-semibold text-ink'),
WText(progress, className: 'text-sm text-faint'),
],
),
],
),
);
}
}
Each card is a WAnchor around a WDiv with rounded-xl overflow-hidden focus:ring-4 duration-150 ease-out. I pressed Right once:

The second card grew by 5 percent and drew its ring. It's so simple.
1.15.0 also fixed a related case. A borderless card with overflow-hidden used to clip its own ring, so a focused poster lifted with no ring at all. The clip now cuts the content only, and the ring is painted outside it. My cards have a border, which already clipped inside the ring, so they showed it before too.
The WAnchor binds no key of its own. It answers ActivateIntent, which Flutter raises for Enter and Space, and on Android also for the gamepad A button and select, the D-pad centre. So one onTap covers a keyboard and an Android TV remote.
Where this is the wrong tool#
- It does not give you an Apple TV build. Flutter has no official tvOS support. The Apple TV builds run on the community flutter-tvos engine (
flutter_tvos1.1.4 on pub.dev, 24 November 2026). wind_kit makes the form behave on the remote; the engine is a separate choice. - Only
WDivlifts.WButtonandWInputkeep their size and show their ring. If you want a button to grow, build it like the cards: aWAnchorwith theonTap, around aWDivwith thefocus:classes. - The lift is paint only. It takes no layout room, so a parent clip or a scroll edge cuts it, and the next card can paint over it. Leave padding around a row of cards, about half of
focusScale - 1times the card's size, plus the ring. My row haspy-4for this. - Set
focusScalebeforerunApp. Moving it between1.0and another value at runtime remounts everyfocus:div, scroll offsets and field state included. - A scrolling box clips its own ring.
overflow-autoandoverflow-scrolldraw the ring inside the scroll view, so ring the element around it, or usering-inset.
Install#
flutter pub add wind_kit:^1.15.0
Then run the TV build on the web, with the arrows as the remote:
flutter run -d web-server --web-port=8080 --dart-define=TV=true
The TV Remote Navigation section of the WInput docs and the TV remote part of the theming docs have the details. The package page is anilcancakir.com/wind_kit.
That's all. Have a nice day.