@@ -2,6 +2,7 @@ import 'package:flauncher/models/watch_next_program.dart';
22import 'package:flauncher/providers/apps_service.dart' ;
33import 'package:flauncher/providers/settings_service.dart' ;
44import 'package:flauncher/providers/watch_next_service.dart' ;
5+ import 'package:flauncher/actions.dart' ;
56import 'package:flutter/material.dart' ;
67import 'package:flutter/services.dart' ;
78import 'package:provider/provider.dart' ;
@@ -23,45 +24,48 @@ class ContinueWatchingRow extends StatelessWidget {
2324 return const SizedBox .shrink ();
2425 }
2526
26- return Column (
27- crossAxisAlignment: CrossAxisAlignment .start,
28- children: [
29- Padding (
30- padding: const EdgeInsets .only (left: 16 , bottom: 8 , top: 8 ),
31- child: Text (
32- "Continue Watching" ,
33- style: Theme .of (context).textTheme.titleLarge! .copyWith (
34- shadows: [
35- const Shadow (
36- color: Colors .black54,
37- offset: Offset (1 , 1 ),
38- blurRadius: 8 ,
39- )
40- ],
27+ return Padding (
28+ padding: const EdgeInsets .symmetric (vertical: 8 ),
29+ child: Column (
30+ crossAxisAlignment: CrossAxisAlignment .start,
31+ children: [
32+ Padding (
33+ padding: const EdgeInsets .only (left: 16 , bottom: 8 ),
34+ child: Text (
35+ "Continue Watching" ,
36+ style: Theme .of (context).textTheme.titleLarge! .copyWith (
37+ shadows: [
38+ const Shadow (
39+ color: Colors .black54,
40+ offset: Offset (1 , 1 ),
41+ blurRadius: 8 ,
42+ )
43+ ],
44+ ),
4145 ),
4246 ),
43- ),
44- SizedBox (
45- height : 150 , // Height of card + padding
46- child : ListView . builder (
47- clipBehavior : Clip .none ,
48- padding : const EdgeInsets . all ( 8 ) ,
49- scrollDirection : Axis .horizontal ,
50- itemCount : programs.length,
51- itemBuilder : (context, index) {
52- final program = programs[index];
53- return Padding (
54- padding : const EdgeInsets . symmetric (horizontal : 8 ),
55- child : WatchNextCard (
56- program : program ,
57- appsService : appsService ,
58- watchNextService : watchNextService ,
59- ),
60- );
61- } ,
47+ SizedBox (
48+ height : 150 , // Height of card + padding
49+ child : ListView . builder (
50+ clipBehavior : Clip .none,
51+ padding : const EdgeInsets . all ( 8 ) ,
52+ scrollDirection : Axis .horizontal ,
53+ itemCount : programs.length ,
54+ itemBuilder : (context, index) {
55+ final program = programs[index];
56+ return Padding (
57+ padding : const EdgeInsets . symmetric (horizontal : 8 ),
58+ child : WatchNextCard (
59+ program : program,
60+ appsService : appsService ,
61+ watchNextService : watchNextService ,
62+ ) ,
63+ );
64+ },
65+ ) ,
6266 ),
63- ) ,
64- ] ,
67+ ] ,
68+ ) ,
6569 );
6670 },
6771 );
@@ -96,6 +100,14 @@ class _WatchNextCardState extends State<WatchNextCard> {
96100 setState (() {
97101 _focused = _focusNode.hasFocus;
98102 });
103+ if (_focusNode.hasFocus) {
104+ Scrollable .ensureVisible (
105+ context,
106+ alignment: 0.5 ,
107+ curve: Curves .easeInOut,
108+ duration: const Duration (milliseconds: 100 ),
109+ );
110+ }
99111 });
100112 }
101113
@@ -137,6 +149,9 @@ class _WatchNextCardState extends State<WatchNextCard> {
137149 event.logicalKey == LogicalKeyboardKey .gameButtonA) {
138150 _onPressed ();
139151 return KeyEventResult .handled;
152+ } else if (event.logicalKey == LogicalKeyboardKey .arrowUp) {
153+ Actions .invoke (context, const MoveFocusToSettingsIntent ());
154+ return KeyEventResult .handled;
140155 }
141156 }
142157 return KeyEventResult .ignored;
0 commit comments