refactor: remove keyboard navigation
This commit is contained in:
@@ -5,7 +5,6 @@ import '../../../i18n/strings.g.dart';
|
||||
import '../../../mixins/item_updatable.dart';
|
||||
import '../../../models/plex_hub.dart';
|
||||
import '../../../models/plex_metadata.dart';
|
||||
import '../../../widgets/hub_navigation_controller.dart';
|
||||
import '../../../widgets/hub_section.dart';
|
||||
import 'base_library_tab.dart';
|
||||
|
||||
@@ -21,21 +20,6 @@ class LibraryRecommendedTab extends BaseLibraryTab<PlexHub> {
|
||||
class _LibraryRecommendedTabState
|
||||
extends BaseLibraryTabState<PlexHub, LibraryRecommendedTab>
|
||||
with ItemUpdatable {
|
||||
final HubNavigationController _hubNavigationController =
|
||||
HubNavigationController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_hubNavigationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// Focus the first item in the first hub
|
||||
@override
|
||||
void focusFirstItem() {
|
||||
_hubNavigationController.focusHub(0, 0);
|
||||
}
|
||||
|
||||
@override
|
||||
PlexClient get client => getClientForLibrary();
|
||||
|
||||
@@ -111,28 +95,24 @@ class _LibraryRecommendedTabState
|
||||
|
||||
@override
|
||||
Widget buildContent(List<PlexHub> items) {
|
||||
return HubNavigationScope(
|
||||
controller: _hubNavigationController,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) {
|
||||
final hub = items[index];
|
||||
final isContinueWatching =
|
||||
hub.hubIdentifier == '_library_continue_watching_';
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) {
|
||||
final hub = items[index];
|
||||
final isContinueWatching =
|
||||
hub.hubIdentifier == '_library_continue_watching_';
|
||||
|
||||
return HubSection(
|
||||
hub: hub,
|
||||
icon: _getHubIcon(hub),
|
||||
navigationOrder: index,
|
||||
isInContinueWatching: isContinueWatching,
|
||||
onRefresh: updateItem,
|
||||
onRemoveFromContinueWatching: isContinueWatching
|
||||
? _refreshContinueWatching
|
||||
: null,
|
||||
);
|
||||
},
|
||||
),
|
||||
return HubSection(
|
||||
hub: hub,
|
||||
icon: _getHubIcon(hub),
|
||||
isInContinueWatching: isContinueWatching,
|
||||
onRefresh: updateItem,
|
||||
onRemoveFromContinueWatching: isContinueWatching
|
||||
? _refreshContinueWatching
|
||||
: null,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user