mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 23:48:14 -07:00
feat: Android TV support (#503)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
7ab8c015b9
commit
c299492d6d
168 changed files with 12019 additions and 3073 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue