Skip to content

Commit

Permalink
test: test case add
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithdv committed Nov 12, 2024
1 parent 7b2f3c9 commit 2d4da04
Showing 1 changed file with 35 additions and 12 deletions.
47 changes: 35 additions & 12 deletions packages/altive_lints/example/lints/avoid_single_child.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,48 @@ class MyWidget extends StatelessWidget {
if (random.nextBool()) const Text('Hello World'),
],
),
// expect_lint: avoid_single_child
Column(
children: [
if (random.nextBool())
const Text('Hello World')
else ...[
const Text('Hello'),
const Text('World'),
],
],
),
// expect_lint: avoid_single_child
Column(
children: [
if(isValued)...[
Container(),
]else...[
Container(),
],
],
),
// expect_lint: avoid_single_child
Column(
children: [
if(isValued)...[
Container(),
],
],
),
Column(
children: [
if(isValued)...[
Container(),
Container(),
],
],
),
Column(
children: [
if(isValued)...[
Container(),
],
Container(),
],
),
Column(
Expand All @@ -77,7 +111,6 @@ class MyWidget extends StatelessWidget {
]
: [
const Text('Hello'),
const Text('World'),
],
),
if (random.nextBool())
Expand Down Expand Up @@ -115,16 +148,6 @@ class MyWidget extends StatelessWidget {
// Ignore this for the sake of example.
// ignore: avoid_redundant_argument_values
const Column(children: []),
// expect_lint: avoid_single_child
Column(
children: [
if(isValued)...[
Container(),
]else...[
Container(),
],
],
),
],
);
}
Expand Down

0 comments on commit 2d4da04

Please sign in to comment.