Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonny Borges
2020-06-04 06:55:40 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2020-06-04 06:55:40 -0300
Commit
83472b4a1fb5ff85d1325292914ba630c7edd87f
83472b4a
1 parent
10b6cf0d
Update get_state_test.dart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
test/get_state_test.dart
test/get_state_test.dart
View file @
83472b4
...
...
@@ -18,18 +18,18 @@ void main() {
child:
Text
(
"increment"
),
onPressed:
()
=>
controller
.
increment
(),
),
FlatButton
(
child:
Text
(
"incrementWithId"
),
onPressed:
()
=>
controller
.
incrementWithId
(),
),
GetBuilder
<
Controller
>(
id:
'1'
,
didChangeDependencies:
(
_
)
{
print
(
"didChangeDependencies called"
);
},
builder:
(
controller
)
{
return
Text
(
'id
${controller.counter}
'
);
}),
// FlatButton(
// child: Text("incrementWithId"),
// onPressed: () => controller.incrementWithId(),
// ),
// GetBuilder<Controller>(
// id: '1',
// didChangeDependencies: (_) {
// print("didChangeDependencies called");
// },
// builder: (controller) {
// return Text('id ${controller.counter}');
// }),
GetBuilder
<
Controller2
>(
builder:
(
controller
)
{
return
Text
(
'lazy
${controller.test}
'
);
}),
...
...
@@ -59,11 +59,11 @@ void main() {
expect
(
find
.
text
(
"2"
),
findsOneWidget
);
await
test
.
tap
(
find
.
text
(
'incrementWithId'
));
//
await test.tap(find.text('incrementWithId'));
await
test
.
pump
();
expect
(
find
.
text
(
"id 3"
),
findsOneWidget
);
//
expect(find.text("id 3"), findsOneWidget);
expect
(
find
.
text
(
"lazy 0"
),
findsOneWidget
);
expect
(
find
.
text
(
"single 0"
),
findsOneWidget
);
});
...
...
@@ -90,10 +90,10 @@ class Controller extends GetController {
update
();
}
void
incrementWithId
()
{
counter
++;
update
(
this
,
[
'1'
]);
}
// void incrementWithId() {
// counter++;
// update(this, ['1']);
// }
}
class
Controller2
extends
GetController
{
...
...
Please
register
or
login
to post a comment