Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
67367974
Commit
67367974
authored
Oct 08, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1538 from abarth/fix_snackbar
SnackBar throws exception on creation
parents
09d26302
6b1c85a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+4
-1
snack_bar_test.dart
packages/unit/test/widget/snack_bar_test.dart
+40
-0
No files found.
packages/flutter/lib/src/widgets/navigator.dart
View file @
67367974
...
@@ -245,6 +245,10 @@ abstract class Route {
...
@@ -245,6 +245,10 @@ abstract class Route {
}
}
abstract
class
PerformanceRoute
extends
Route
{
abstract
class
PerformanceRoute
extends
Route
{
PerformanceRoute
()
{
_performance
=
createPerformance
();
}
PerformanceView
get
performance
=>
_performance
?.
view
;
PerformanceView
get
performance
=>
_performance
?.
view
;
Performance
_performance
;
Performance
_performance
;
...
@@ -261,7 +265,6 @@ abstract class PerformanceRoute extends Route {
...
@@ -261,7 +265,6 @@ abstract class PerformanceRoute extends Route {
Widget
build
(
NavigatorState
navigator
,
PerformanceView
nextRoutePerformance
);
Widget
build
(
NavigatorState
navigator
,
PerformanceView
nextRoutePerformance
);
void
didPush
(
NavigatorState
navigator
)
{
void
didPush
(
NavigatorState
navigator
)
{
_performance
=
createPerformance
();
super
.
didPush
(
navigator
);
super
.
didPush
(
navigator
);
_performance
?.
forward
();
_performance
?.
forward
();
}
}
...
...
packages/unit/test/widget/snack_bar_test.dart
0 → 100644
View file @
67367974
import
'package:sky/widgets.dart'
;
import
'package:test/test.dart'
;
import
'widget_tester.dart'
;
void
main
(
)
{
test
(
'SnackBar control test'
,
()
{
testWidgets
((
WidgetTester
tester
)
{
String
helloSnackBar
=
'Hello SnackBar'
;
GlobalKey
<
PlaceholderState
>
placeholderKey
=
new
GlobalKey
<
PlaceholderState
>();
Key
tapTarget
=
new
Key
(
'tap-target'
);
tester
.
pumpWidget
(
new
App
(
routes:
{
'/'
:
(
RouteArguments
args
)
{
return
new
GestureDetector
(
onTap:
()
{
showSnackBar
(
navigator:
args
.
navigator
,
placeholderKey:
placeholderKey
,
content:
new
Text
(
helloSnackBar
)
);
},
child:
new
Center
(
key:
tapTarget
,
child:
new
Placeholder
(
key:
placeholderKey
)
)
);
}
}
));
tester
.
tap
(
tester
.
findElementByKey
(
tapTarget
));
expect
(
tester
.
findText
(
helloSnackBar
),
isNull
);
tester
.
pump
();
expect
(
tester
.
findText
(
helloSnackBar
),
isNotNull
);
});
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment