feat: Android TV support (#503)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-09-28 21:07:49 +02:00 committed by GitHub
parent 7ab8c015b9
commit c299492d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
168 changed files with 12019 additions and 3073 deletions

View file

@ -7,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:fladder/screens/shared/animated_fade_size.dart';
import 'package:fladder/util/refresh_state.dart';
import 'package:fladder/widgets/shared/ensure_visible.dart';
class SelectableIconButton extends ConsumerStatefulWidget {
final FutureOr<dynamic> Function() onPressed;
@ -33,6 +34,7 @@ class SelectableIconButton extends ConsumerStatefulWidget {
class _SelectableIconButtonState extends ConsumerState<SelectableIconButton> {
bool loading = false;
bool focused = false;
@override
Widget build(BuildContext context) {
const duration = Duration(milliseconds: 250);
@ -51,6 +53,16 @@ class _SelectableIconButtonState extends ConsumerState<SelectableIconButton> {
widget.iconColor ?? (widget.selected ? Theme.of(context).colorScheme.onPrimary : null)),
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
),
onFocusChange: (value) {
setState(() {
focused = value;
});
if (value) {
context.ensureVisible(
alignment: 1.0,
);
}
},
onPressed: loading
? null
: () async {