forked from dart-code-checker/dart-code-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_max_line_count.dart
59 lines (49 loc) · 1.12 KB
/
example_max_line_count.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
const a = TextButton(
onPressed: () => null,
child: Container(),
);
const b = TextButton(
onPressed: () {
firstLine();
secondLine();
thirdLine();
},
child: Container(),
);
const c = TextButton(
// LINT
onPressed: () {
firstLine();
secondLine();
thirdLine();
fourthLine();
},
child: Container(),
);
return Container();
}
}
class Widget {}
class StatelessWidget extends Widget {}
class BuildContext {}
class Container extends Widget {
final Widget? child;
const Container({this.child});
}
class TextButton {
final Widget child;
final void Function()? onPressed;
final Widget Function(BuildContext)? builder;
final Widget Function(BuildContext, int)? anotherBuilder;
final MyOtherWidget Function(BuildContext, int)? myOtherWidgetBuilder;
const TextButton({
required this.child,
required this.onPressed,
this.builder,
this.anotherBuilder,
this.myOtherWidgetBuilder,
});
}