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
34923506
Commit
34923506
authored
Apr 24, 2017
by
Ian Hickson
Committed by
GitHub
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Placeholder. It has no clients. (#9563)
parent
55f33468
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
64 deletions
+6
-64
placeholder.dart
packages/flutter/lib/src/widgets/placeholder.dart
+0
-40
widgets.dart
packages/flutter/lib/widgets.dart
+0
-1
framework_test.dart
packages/flutter/test/widgets/framework_test.dart
+6
-1
placeholder_test.dart
packages/flutter/test/widgets/placeholder_test.dart
+0
-22
No files found.
packages/flutter/lib/src/widgets/placeholder.dart
deleted
100644 → 0
View file @
55f33468
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'basic.dart'
;
import
'framework.dart'
;
/// A widget whose child can be mutated.
class
Placeholder
extends
StatefulWidget
{
/// Creates a widget whose child can be mutated.
const
Placeholder
({
Key
key
})
:
super
(
key:
key
);
@override
PlaceholderState
createState
()
=>
new
PlaceholderState
();
}
/// State for a [Placeholder] widget.
///
/// Useful for setting the child currently displayed by this placeholder widget.
class
PlaceholderState
extends
State
<
Placeholder
>
{
/// The child that this widget builds.
///
/// Mutating this field will cause this widget to rebuild with the new child.
Widget
get
child
=>
_child
;
Widget
_child
;
set
child
(
Widget
value
)
{
if
(
_child
==
value
)
return
;
setState
(()
{
_child
=
value
;
});
}
@override
Widget
build
(
BuildContext
context
)
{
if
(
_child
!=
null
)
return
child
;
return
const
SizedBox
(
width:
0.0
,
height:
0.0
);
}
}
packages/flutter/lib/widgets.dart
View file @
34923506
...
...
@@ -43,7 +43,6 @@ export 'src/widgets/page_storage.dart';
export
'src/widgets/page_view.dart'
;
export
'src/widgets/pages.dart'
;
export
'src/widgets/performance_overlay.dart'
;
export
'src/widgets/placeholder.dart'
;
export
'src/widgets/preferred_size.dart'
;
export
'src/widgets/primary_scroll_controller.dart'
;
export
'src/widgets/raw_keyboard_listener.dart'
;
...
...
packages/flutter/test/widgets/framework_test.dart
View file @
34923506
...
...
@@ -11,6 +11,11 @@ class TestState extends State<StatefulWidget> {
Widget
build
(
BuildContext
context
)
=>
null
;
}
// TODO(ianh): Remove this once we add the real Placeholder widget
class
Placeholder
extends
Container
{
Placeholder
({
Key
key
})
:
super
(
key:
key
);
}
void
main
(
)
{
testWidgets
(
'UniqueKey control test'
,
(
WidgetTester
tester
)
async
{
final
Key
key
=
new
UniqueKey
();
...
...
@@ -440,7 +445,7 @@ void main() {
final
GlobalKey
key
=
new
GlobalKey
();
await
tester
.
pumpWidget
(
new
Container
(
key:
key
));
expect
(
log
,
isEmpty
);
await
tester
.
pumpWidget
(
const
Placeholder
());
await
tester
.
pumpWidget
(
new
Placeholder
());
debugPrint
=
oldCallback
;
debugPrintGlobalKeyedWidgetLifecycle
=
false
;
...
...
packages/flutter/test/widgets/placeholder_test.dart
deleted
100644 → 0
View file @
55f33468
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/widgets.dart'
;
void
main
(
)
{
testWidgets
(
'Placeholder control test'
,
(
WidgetTester
tester
)
async
{
final
GlobalKey
<
PlaceholderState
>
key
=
new
GlobalKey
<
PlaceholderState
>();
await
tester
.
pumpWidget
(
new
Placeholder
(
key:
key
));
key
.
currentState
.
child
=
const
Text
(
'target'
);
expect
(
find
.
text
(
'target'
),
findsNothing
);
await
tester
.
pump
();
expect
(
find
.
text
(
'target'
),
findsOneWidget
);
});
}
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