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
e3cf62bc
Unverified
Commit
e3cf62bc
authored
Dec 06, 2017
by
Yegor
Committed by
GitHub
Dec 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modernize corners & borders in animation demo (#13352)
parent
fd7853fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
27 deletions
+19
-27
home.dart
examples/flutter_gallery/lib/demo/animation/home.dart
+3
-7
widgets.dart
examples/flutter_gallery/lib/demo/animation/widgets.dart
+16
-20
No files found.
examples/flutter_gallery/lib/demo/animation/home.dart
View file @
e3cf62bc
...
@@ -216,12 +216,8 @@ class _AllSectionsLayout extends MultiChildLayoutDelegate {
...
@@ -216,12 +216,8 @@ class _AllSectionsLayout extends MultiChildLayoutDelegate {
final
Rect
cardRect
=
_interpolateRect
(
columnCardRect
,
rowCardRect
).
shift
(
offset
);
final
Rect
cardRect
=
_interpolateRect
(
columnCardRect
,
rowCardRect
).
shift
(
offset
);
final
String
cardId
=
'card
$index
'
;
final
String
cardId
=
'card
$index
'
;
if
(
hasChild
(
cardId
))
{
if
(
hasChild
(
cardId
))
{
// Add a small horizontal gap between the cards.
layoutChild
(
cardId
,
new
BoxConstraints
.
tight
(
cardRect
.
size
));
final
Rect
insetRect
=
new
Rect
.
fromLTWH
(
positionChild
(
cardId
,
cardRect
.
topLeft
);
cardRect
.
left
+
0.5
,
cardRect
.
top
,
cardRect
.
width
-
1.0
,
cardRect
.
height
);
layoutChild
(
cardId
,
new
BoxConstraints
.
tight
(
insetRect
.
size
));
positionChild
(
cardId
,
insetRect
.
topLeft
);
}
}
// Layout the title for index.
// Layout the title for index.
...
@@ -549,7 +545,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
...
@@ -549,7 +545,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
final
double
screenHeight
=
mediaQueryData
.
size
.
height
;
final
double
screenHeight
=
mediaQueryData
.
size
.
height
;
final
double
appBarMaxHeight
=
screenHeight
-
statusBarHeight
;
final
double
appBarMaxHeight
=
screenHeight
-
statusBarHeight
;
// The scrolloffset that reveals the appBarMidHeight appbar.
// The scroll
offset that reveals the appBarMidHeight appbar.
final
double
appBarMidScrollOffset
=
statusBarHeight
+
appBarMaxHeight
-
_kAppBarMidHeight
;
final
double
appBarMidScrollOffset
=
statusBarHeight
+
appBarMaxHeight
-
_kAppBarMidHeight
;
return
new
SizedBox
.
expand
(
return
new
SizedBox
.
expand
(
...
...
examples/flutter_gallery/lib/demo/animation/widgets.dart
View file @
e3cf62bc
...
@@ -19,28 +19,24 @@ class SectionCard extends StatelessWidget {
...
@@ -19,28 +19,24 @@ class SectionCard extends StatelessWidget {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
new
Padding
(
return
new
DecoratedBox
(
padding:
const
EdgeInsets
.
only
(
bottom:
1.0
),
decoration:
new
BoxDecoration
(
child:
new
DecoratedBox
(
gradient:
new
LinearGradient
(
decoration:
new
BoxDecoration
(
begin:
Alignment
.
centerLeft
,
borderRadius:
new
BorderRadius
.
circular
(
4.0
),
end:
Alignment
.
centerRight
,
gradient:
new
LinearGradient
(
colors:
<
Color
>[
begin:
Alignment
.
centerLeft
,
section
.
leftColor
,
end:
Alignment
.
centerRight
,
section
.
rightColor
,
colors:
<
Color
>[
],
section
.
leftColor
,
section
.
rightColor
,
],
),
),
child:
new
Image
.
asset
(
section
.
backgroundAsset
,
package:
section
.
backgroundAssetPackage
,
color:
const
Color
.
fromRGBO
(
255
,
255
,
255
,
0.075
),
colorBlendMode:
BlendMode
.
modulate
,
fit:
BoxFit
.
cover
,
),
),
),
),
child:
new
Image
.
asset
(
section
.
backgroundAsset
,
package:
section
.
backgroundAssetPackage
,
color:
const
Color
.
fromRGBO
(
255
,
255
,
255
,
0.075
),
colorBlendMode:
BlendMode
.
modulate
,
fit:
BoxFit
.
cover
,
),
);
);
}
}
}
}
...
...
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