fix(seerr): align request button focus
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:material_symbols_icons/symbols.dart';
|
||||
|
||||
import '../focus/dpad_navigator.dart';
|
||||
import '../focus/focusable_button.dart';
|
||||
import '../i18n/strings.g.dart';
|
||||
import '../media/media_kind.dart';
|
||||
import '../models/seerr/seerr_details.dart';
|
||||
@@ -408,11 +409,15 @@ class _SeerrRequestSheetState extends State<SeerrRequestSheet> {
|
||||
Text(error, style: theme.textTheme.bodySmall?.copyWith(color: theme.colorScheme.error)),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
FilledButton.icon(
|
||||
FocusableButton(
|
||||
focusNode: _requestButtonFocusNode,
|
||||
useBackgroundFocus: true,
|
||||
onPressed: _canSubmit ? _submit : null,
|
||||
icon: _submitting ? const LoadingIndicatorBox() : const AppIcon(Symbols.download_rounded, fill: 1),
|
||||
label: Text(t.seerr.request),
|
||||
child: FilledButton.icon(
|
||||
onPressed: _canSubmit ? _submit : null,
|
||||
icon: _submitting ? const LoadingIndicatorBox() : const AppIcon(Symbols.download_rounded, fill: 1),
|
||||
label: Text(t.seerr.request),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:plezy/focus/focusable_button.dart';
|
||||
import 'package:plezy/i18n/strings.g.dart';
|
||||
import 'package:plezy/media/media_kind.dart';
|
||||
import 'package:plezy/models/seerr/seerr_session.dart';
|
||||
@@ -159,6 +160,10 @@ void main() {
|
||||
// Nothing selected yet: submit disabled.
|
||||
final submitFinder = find.widgetWithText(FilledButton, 'Request');
|
||||
expect(tester.widget<FilledButton>(submitFinder).onPressed, isNull);
|
||||
final focusableSubmit = tester.widget<FocusableButton>(
|
||||
find.ancestor(of: submitFinder, matching: find.byType(FocusableButton)),
|
||||
);
|
||||
expect(focusableSubmit.useBackgroundFocus, isTrue);
|
||||
|
||||
await tester.tap(find.text('Season 2'));
|
||||
await tester.pump();
|
||||
|
||||
Reference in New Issue
Block a user