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
6e410fd8
Commit
6e410fd8
authored
Sep 16, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove MimicOverlay
This widget has no client.
parent
ac266c67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
243 deletions
+0
-243
pop_out_and_expand.dart
examples/widgets/pop_out_and_expand.dart
+0
-115
mimic_overlay.dart
packages/flutter/lib/src/widgets/mimic_overlay.dart
+0
-127
widgets.dart
packages/flutter/lib/widgets.dart
+0
-1
No files found.
examples/widgets/pop_out_and_expand.dart
deleted
100644 → 0
View file @
ac266c67
// 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
'package:sky/theme/colors.dart'
as
colors
;
import
'package:sky/widgets.dart'
;
class
GreenCard
extends
Component
{
GreenCard
({
this
.
child
});
Widget
child
;
Widget
build
()
{
return
new
Container
(
decoration:
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF0000FF
),
border:
new
Border
.
all
(
color:
const
Color
(
0xFF00FF00
),
width:
10.0
)
),
child:
new
Center
(
child:
child
)
);
}
}
class
CardData
{
final
GlobalKey
key
;
final
String
content
;
CardData
({
this
.
key
,
this
.
content
});
}
class
ExampleApp
extends
App
{
ExampleApp
()
{
for
(
int
i
=
0
;
i
<
20
;
++
i
)
{
_data
.
add
(
new
CardData
(
key:
new
GlobalKey
(),
content:
'
$i
'
));
}
}
final
List
<
CardData
>
_data
=
new
List
<
CardData
>();
GlobalKey
_overlay
;
Widget
_buildCard
(
CardData
cardData
)
{
return
new
GestureDetector
(
onTap:
()
{
setState
(()
{
_overlay
=
cardData
.
key
;
});
},
child:
new
Container
(
height:
100.0
,
margin:
new
EdgeDims
.
symmetric
(
horizontal:
20.0
,
vertical:
4.0
),
child:
new
Mimicable
(
key:
cardData
.
key
,
child:
new
GreenCard
(
child:
new
Text
(
cardData
.
content
))
)
)
);
}
Rect
_targetRect
;
void
_handleOverlaySizeChanged
(
Size
size
)
{
setState
(()
{
_targetRect
=
Point
.
origin
&
size
;
});
}
Widget
build
()
{
List
<
Widget
>
cards
=
new
List
<
Widget
>();
for
(
int
i
=
0
;
i
<
_data
.
length
;
++
i
)
{
cards
.
add
(
_buildCard
(
_data
[
i
]));
}
return
new
IconTheme
(
data:
const
IconThemeData
(
color:
IconThemeColor
.
white
),
child:
new
Theme
(
data:
new
ThemeData
(
brightness:
ThemeBrightness
.
light
,
primarySwatch:
colors
.
Blue
,
accentColor:
colors
.
RedAccent
[
200
]
),
child:
new
Scaffold
(
toolbar:
new
ToolBar
(
left:
new
IconButton
(
icon:
"navigation/arrow_back"
,
onPressed:
()
{
setState
(()
{
_overlay
=
null
;
});
}
)
),
body:
new
SizeObserver
(
callback:
_handleOverlaySizeChanged
,
child:
new
MimicOverlay
(
overlay:
_overlay
,
duration:
const
Duration
(
milliseconds:
5000
),
targetRect:
_targetRect
,
children:
[
new
Block
(
cards
)
]
)
)
)
)
);
}
}
void
main
(
)
{
runApp
(
new
ExampleApp
());
}
packages/flutter/lib/src/widgets/mimic_overlay.dart
deleted
100644 → 0
View file @
ac266c67
// 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
'package:sky/animation.dart'
;
import
'package:sky/src/widgets/animated_component.dart'
;
import
'package:sky/src/widgets/basic.dart'
;
import
'package:sky/src/widgets/framework.dart'
;
import
'package:sky/src/widgets/mimic.dart'
;
class
MimicOverlay
extends
AnimatedComponent
{
MimicOverlay
({
Key
key
,
this
.
children
,
this
.
overlay
,
this
.
duration
:
const
Duration
(
milliseconds:
200
),
this
.
curve
:
linear
,
this
.
targetRect
})
:
super
(
key:
key
);
List
<
Widget
>
children
;
GlobalKey
overlay
;
Duration
duration
;
Curve
curve
;
Rect
targetRect
;
void
syncConstructorArguments
(
MimicOverlay
source
)
{
children
=
source
.
children
;
duration
=
source
.
duration
;
_expandPerformance
.
duration
=
duration
;
targetRect
=
source
.
targetRect
;
_mimicBounds
.
end
=
targetRect
;
if
(
_expandPerformance
.
isCompleted
)
{
_mimicBounds
.
value
=
_mimicBounds
.
end
;
}
curve
=
source
.
curve
;
_mimicBounds
.
curve
=
curve
;
if
(
overlay
!=
source
.
overlay
)
{
overlay
=
source
.
overlay
;
if
(
_expandPerformance
.
isDismissed
)
{
_activeOverlay
=
overlay
;
}
else
{
_expandPerformance
.
reverse
();
}
}
}
void
initState
()
{
_mimicBounds
=
new
AnimatedRect
(
new
Rect
(),
curve:
curve
);
_mimicBounds
.
end
=
targetRect
;
_expandPerformance
=
new
AnimationPerformance
()
..
duration
=
duration
..
addVariable
(
_mimicBounds
)
..
addListener
(
_handleAnimationTick
)
..
addStatusListener
(
_handleAnimationStatusChanged
);
watch
(
_expandPerformance
);
}
GlobalKey
_activeOverlay
;
AnimatedRect
_mimicBounds
;
AnimationPerformance
_expandPerformance
;
void
_handleAnimationStatusChanged
(
AnimationStatus
status
)
{
if
(
status
==
AnimationStatus
.
dismissed
)
{
setState
(()
{
_activeOverlay
=
overlay
;
});
}
}
void
_handleAnimationTick
()
{
if
(
_activeOverlay
==
null
)
return
;
_updateMimicBounds
();
}
void
_updateMimicBounds
()
{
Mimicable
mimicable
=
GlobalKey
.
getWidget
(
_activeOverlay
)
as
Mimicable
;
Rect
globalBounds
=
mimicable
.
globalBounds
;
if
(
globalBounds
==
null
)
return
;
Rect
localBounds
=
globalToLocal
(
globalBounds
.
topLeft
)
&
globalBounds
.
size
;
if
(
localBounds
==
_mimicBounds
.
begin
)
return
;
setState
(()
{
_mimicBounds
.
begin
=
localBounds
;
if
(
_expandPerformance
.
isDismissed
)
_mimicBounds
.
value
=
_mimicBounds
.
begin
;
});
}
void
_handleMimicReady
()
{
_updateMimicBounds
();
if
(
_expandPerformance
.
isDismissed
)
_expandPerformance
.
forward
();
}
Widget
build
()
{
List
<
Widget
>
layers
=
new
List
<
Widget
>();
if
(
children
!=
null
)
layers
.
addAll
(
children
);
if
(
_activeOverlay
!=
null
)
{
layers
.
add
(
new
Positioned
(
left:
_mimicBounds
.
value
.
left
,
top:
_mimicBounds
.
value
.
top
,
child:
new
SizedBox
(
width:
_mimicBounds
.
value
.
width
,
height:
_mimicBounds
.
value
.
height
,
child:
new
Mimic
(
onMimicReady:
_handleMimicReady
,
original:
_activeOverlay
)
)
)
);
}
return
new
Stack
(
layers
);
}
}
packages/flutter/lib/widgets.dart
View file @
6e410fd8
...
...
@@ -36,7 +36,6 @@ export 'package:sky/src/widgets/input.dart';
export
'package:sky/src/widgets/material.dart'
;
export
'package:sky/src/widgets/material_button.dart'
;
export
'package:sky/src/widgets/mimic.dart'
;
export
'package:sky/src/widgets/mimic_overlay.dart'
;
export
'package:sky/src/widgets/mixed_viewport.dart'
;
export
'package:sky/src/widgets/modal_overlay.dart'
;
export
'package:sky/src/widgets/navigator.dart'
;
...
...
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