• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Duit-Foundation / duit_kernel / 20522775167

26 Dec 2025 12:54PM UTC coverage: 76.029% (-0.4%) from 76.46%
20522775167

Pull #50

github

web-flow
Merge 20c5b5c4e into 08552f056
Pull Request #50: feat: Migration to capability-based API pt1

0 of 13 new or added lines in 3 files covered. (0.0%)

1754 of 2307 relevant lines covered (76.03%)

4.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/lib/src/driver_api/capabilities/focus_capability.dart
1
import "package:duit_kernel/duit_kernel.dart";
2
import "package:flutter/widgets.dart";
3
import "package:meta/meta.dart";
4

5
/// A mixin that provides an interface for managing focus nodes
6
/// within the Duit kernel driver API.
7
///
8
/// Classes that use [FocusCapabilityDelegate] must implement focus management
9
/// behaviors by overriding the methods. By default, methods throw
10
/// [MissingCapabilityMethodImplementation] if not overridden.
11
///
12
/// See also:
13
///  - [UnfocusDisposition], for handling how focus should be removed.
14
///  - [TraversalDirection], for spatial focus navigation.
15
///  - Focus cookbook - https://docs.flutter.dev/cookbook/forms/focus
16
///  - [FocusNode] docs - https://api.flutter.dev/flutter/widgets/FocusNode-class.html
17
mixin FocusCapabilityDelegate {
18
  late final UIDriver driver;
19

20
  @mustBeOverridden
4✔
21
  void requestFocus(
22
    String nodeId, {
23
    String? targetNodeId,
24
  }) =>
25
      throw const MissingCapabilityMethodImplementation(
26
        "requestFocus",
27
        "FocusCapabilityDelegate",
28
      );
29

30
  @mustBeOverridden
4✔
31
  bool nextFocus(String nodeId) =>
32
      throw const MissingCapabilityMethodImplementation(
33
        "nextFocus",
34
        "FocusCapabilityDelegate",
35
      );
36

37
  @mustBeOverridden
4✔
38
  bool previousFocus(String nodeId) =>
39
      throw const MissingCapabilityMethodImplementation(
40
        "previousFocus",
41
        "FocusCapabilityDelegate",
42
      );
43

44
  @mustBeOverridden
4✔
45
  void unfocus(
46
    String nodeId, {
47
    UnfocusDisposition disposition = UnfocusDisposition.scope,
48
  }) =>
49
      throw const MissingCapabilityMethodImplementation(
50
        "unfocus",
51
        "FocusCapabilityDelegate",
52
      );
53

54
  @mustBeOverridden
4✔
55
  bool focusInDirection(String nodeId, TraversalDirection direction) =>
56
      throw const MissingCapabilityMethodImplementation(
57
        "focusInDirection",
58
        "FocusCapabilityDelegate",
59
      );
60

61
  @mustBeOverridden
4✔
62
  void attachFocusNode(String nodeId, FocusNode node) =>
63
      throw const MissingCapabilityMethodImplementation(
64
        "attachFocusNode",
65
        "FocusCapabilityDelegate",
66
      );
67

68
  @mustBeOverridden
4✔
69
  void detachFocusNode(String nodeId) =>
70
      throw const MissingCapabilityMethodImplementation(
71
        "detachFocusNode",
72
        "FocusCapabilityDelegate",
73
      );
74

75
  @mustBeOverridden
×
76
  FocusNode? getNode(Object? key) =>
77
      throw const MissingCapabilityMethodImplementation(
78
        "getNode",
79
        "FocusCapabilityDelegate",
80
      );
81

NEW
82
  @mustBeOverridden
×
83
  void releaseResources() => throw const MissingCapabilityMethodImplementation(
84
        "releaseResources",
85
        "FocusCapabilityDelegate",
86
      );
87
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc