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

Duit-Foundation / flutter_duit / 21492772417

29 Jan 2026 07:59PM UTC coverage: 80.567% (+0.06%) from 80.51%
21492772417

push

github

web-flow
feat: OutlinedButton widget (#331)

48 of 54 new or added lines in 4 files covered. (88.89%)

4743 of 5887 relevant lines covered (80.57%)

35.63 hits per line

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

83.33
/lib/src/ui/widgets/elevated_button.dart
1
import "package:duit_kernel/duit_kernel.dart";
2
import "package:flutter/material.dart";
3
import "package:flutter_duit/src/duit_impl/index.dart";
4

5
final class DuitElevatedButton extends StatefulWidget {
6
  final UIElementController controller;
7
  final Widget child;
8

9
  const DuitElevatedButton({
12✔
10
    required this.controller,
11
    required this.child,
12
    super.key,
13
  });
14

15
  @override
12✔
16
  State<DuitElevatedButton> createState() => _DuitElevatedButtonState();
12✔
17
}
18

19
class _DuitElevatedButtonState extends State<DuitElevatedButton>
20
    with ViewControllerChangeListener {
21
  late final FocusNode _focusNode;
22

23
  @override
12✔
24
  void initState() {
25
    final controller = widget.controller;
24✔
26
    attachStateToController(controller);
12✔
27

28
    _focusNode = attributes.focusNode(
36✔
29
      defaultValue: FocusNode(),
12✔
30
    )!;
31

32
    controller.driver.attachFocusNode(
24✔
33
      widget.controller.id,
36✔
34
      _focusNode,
12✔
35
    );
36

37
    super.initState();
12✔
38
  }
39

40
  @override
12✔
41
  void dispose() {
42
    widget.controller.driver.detachFocusNode(widget.controller.id);
84✔
43
    super.dispose();
12✔
44
  }
45

46
  void _onLongPress() {
4✔
47
    final action = attributes.getAction("onLongPress");
8✔
48
    if (action != null) {
49
      widget.controller.performAction(action);
12✔
50
    }
51
  }
52

NEW
53
  void _onFocusChange(bool _) {
×
NEW
54
    final action = attributes.getAction("onFocusChange");
×
55
    if (action != null) {
NEW
56
      widget.controller.performAction(action);
×
57
    }
58
  }
59

NEW
60
  void _onHover(bool _) {
×
NEW
61
    final action = attributes.getAction("onHover");
×
62
    if (action != null) {
NEW
63
      widget.controller.performAction(action);
×
64
    }
65
  }
66

67
  @override
12✔
68
  Widget build(BuildContext context) {
69
    return ElevatedButton(
12✔
70
      key: ValueKey(widget.controller.id),
48✔
71
      focusNode: _focusNode,
12✔
72
      autofocus: attributes.getBool("autofocus"),
24✔
73
      clipBehavior: attributes.clipBehavior(defaultValue: Clip.none)!,
24✔
74
      onPressed: widget.controller.performRelatedAction,
36✔
75
      style: attributes.buttonStyle(),
24✔
76
      onLongPress: _onLongPress,
12✔
77
      onFocusChange: _onFocusChange,
12✔
78
      onHover: _onHover,
12✔
79
      child: widget.child,
24✔
80
    );
81
  }
82
}
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