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
2e4aa795
Commit
2e4aa795
authored
Apr 25, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FlexibleSpaceBar should not include transparent widgets (#3527)
parent
b1e684ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
37 deletions
+43
-37
flexible_space_bar.dart
packages/flutter/lib/src/material/flexible_space_bar.dart
+43
-37
No files found.
packages/flutter/lib/src/material/flexible_space_bar.dart
View file @
2e4aa795
...
...
@@ -80,18 +80,21 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
curve:
new
Interval
(
math
.
max
(
0.0
,
fadeStart
),
math
.
min
(
fadeEnd
,
1.0
))
);
final
double
parallax
=
new
Tween
<
double
>(
begin:
0.0
,
end:
appBarHeight
/
4.0
).
evaluate
(
_scaffoldAnimation
);
children
.
add
(
new
Positioned
(
top:
-
parallax
,
left:
0.0
,
right:
0.0
,
child:
new
Opacity
(
opacity:
new
Tween
<
double
>(
begin:
1.0
,
end:
0.0
).
evaluate
(
opacityCurve
),
child:
new
SizedBox
(
height:
appBarHeight
+
statusBarHeight
,
child:
config
.
background
final
double
opacity
=
new
Tween
<
double
>(
begin:
1.0
,
end:
0.0
).
evaluate
(
opacityCurve
);
if
(
opacity
>
0.0
)
{
children
.
add
(
new
Positioned
(
top:
-
parallax
,
left:
0.0
,
right:
0.0
,
child:
new
Opacity
(
opacity:
opacity
,
child:
new
SizedBox
(
height:
appBarHeight
+
statusBarHeight
,
child:
config
.
background
)
)
)
));
)
);
}
}
// title
...
...
@@ -102,34 +105,37 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
parent:
_scaffoldAnimation
,
curve:
new
Interval
(
fadeStart
,
fadeEnd
)
);
TextStyle
titleStyle
=
Theme
.
of
(
context
).
primaryTextTheme
.
title
;
titleStyle
=
titleStyle
.
copyWith
(
color:
titleStyle
.
color
.
withAlpha
(
new
Tween
<
double
>(
begin:
255.0
,
end:
0.0
).
evaluate
(
opacityCurve
).
toInt
())
);
final
double
yAlignStart
=
1.0
;
final
double
yAlignEnd
=
(
statusBarHeight
+
kToolBarHeight
/
2.0
)
/
toolBarHeight
;
final
double
scaleAndAlignEnd
=
(
appBarHeight
-
toolBarHeight
)
/
appBarHeight
;
final
CurvedAnimation
scaleAndAlignCurve
=
new
CurvedAnimation
(
parent:
_scaffoldAnimation
,
curve:
new
Interval
(
0.0
,
scaleAndAlignEnd
)
);
children
.
add
(
new
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
72.0
,
bottom:
14.0
),
child:
new
Align
(
alignment:
new
Tween
<
FractionalOffset
>(
begin:
new
FractionalOffset
(
0.0
,
yAlignStart
),
end:
new
FractionalOffset
(
0.0
,
yAlignEnd
)
).
evaluate
(
scaleAndAlignCurve
),
child:
new
ScaleTransition
(
alignment:
FractionalOffset
.
bottomLeft
,
scale:
new
Tween
<
double
>(
begin:
1.5
,
end:
1.0
).
animate
(
scaleAndAlignCurve
),
child:
new
Align
(
alignment:
new
FractionalOffset
(
0.0
,
1.0
),
child:
new
DefaultTextStyle
(
style:
titleStyle
,
child:
config
.
title
)
final
int
alpha
=
new
Tween
<
double
>(
begin:
255.0
,
end:
0.0
).
evaluate
(
opacityCurve
).
toInt
();
if
(
alpha
>
0
)
{
TextStyle
titleStyle
=
Theme
.
of
(
context
).
primaryTextTheme
.
title
;
titleStyle
=
titleStyle
.
copyWith
(
color:
titleStyle
.
color
.
withAlpha
(
alpha
)
);
final
double
yAlignStart
=
1.0
;
final
double
yAlignEnd
=
(
statusBarHeight
+
kToolBarHeight
/
2.0
)
/
toolBarHeight
;
final
double
scaleAndAlignEnd
=
(
appBarHeight
-
toolBarHeight
)
/
appBarHeight
;
final
CurvedAnimation
scaleAndAlignCurve
=
new
CurvedAnimation
(
parent:
_scaffoldAnimation
,
curve:
new
Interval
(
0.0
,
scaleAndAlignEnd
)
);
children
.
add
(
new
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
72.0
,
bottom:
14.0
),
child:
new
Align
(
alignment:
new
Tween
<
FractionalOffset
>(
begin:
new
FractionalOffset
(
0.0
,
yAlignStart
),
end:
new
FractionalOffset
(
0.0
,
yAlignEnd
)
).
evaluate
(
scaleAndAlignCurve
),
child:
new
ScaleTransition
(
alignment:
FractionalOffset
.
bottomLeft
,
scale:
new
Tween
<
double
>(
begin:
1.5
,
end:
1.0
).
animate
(
scaleAndAlignCurve
),
child:
new
Align
(
alignment:
new
FractionalOffset
(
0.0
,
1.0
),
child:
new
DefaultTextStyle
(
style:
titleStyle
,
child:
config
.
title
)
)
)
)
)
));
)
);
}
}
return
new
ClipRect
(
child:
new
Stack
(
children:
children
));
...
...
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