mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
modernize corners & borders in animation demo (#13352)
This commit is contained in:
parent
fd7853faad
commit
e3cf62bc5b
@ -216,12 +216,8 @@ class _AllSectionsLayout extends MultiChildLayoutDelegate {
|
||||
final Rect cardRect = _interpolateRect(columnCardRect, rowCardRect).shift(offset);
|
||||
final String cardId = 'card$index';
|
||||
if (hasChild(cardId)) {
|
||||
// Add a small horizontal gap between the cards.
|
||||
final Rect insetRect = new Rect.fromLTWH(
|
||||
cardRect.left + 0.5, cardRect.top, cardRect.width - 1.0, cardRect.height
|
||||
);
|
||||
layoutChild(cardId, new BoxConstraints.tight(insetRect.size));
|
||||
positionChild(cardId, insetRect.topLeft);
|
||||
layoutChild(cardId, new BoxConstraints.tight(cardRect.size));
|
||||
positionChild(cardId, cardRect.topLeft);
|
||||
}
|
||||
|
||||
// Layout the title for index.
|
||||
@ -549,7 +545,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
|
||||
final double screenHeight = mediaQueryData.size.height;
|
||||
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;
|
||||
|
||||
return new SizedBox.expand(
|
||||
|
||||
@ -19,28 +19,24 @@ class SectionCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return new Padding(
|
||||
padding: const EdgeInsets.only(bottom: 1.0),
|
||||
child: new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
borderRadius: new BorderRadius.circular(4.0),
|
||||
gradient: new LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
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,
|
||||
return new DecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
gradient: new LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
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,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user