Cleanup
This commit is contained in:
parent
be4e3c1ea4
commit
70ca4105f0
@ -77,6 +77,7 @@ class ColosseumIllustration extends StatelessWidget {
|
||||
initialScale: .9,
|
||||
initialOffset: Offset(-40, 60),
|
||||
heightFactor: .65,
|
||||
offset: Offset.zero,
|
||||
fractionalOffset: Offset(-.5, .1),
|
||||
zoomAmt: .25,
|
||||
dynamicHzOffset: -150,
|
||||
|
@ -16,8 +16,6 @@ class IllustrationPiece extends StatefulWidget {
|
||||
this.fractionalOffset,
|
||||
this.zoomAmt = 0,
|
||||
this.initialOffset = Offset.zero,
|
||||
this.boxFit = BoxFit.fitHeight,
|
||||
this.overflow = true,
|
||||
this.enableHero = false,
|
||||
this.initialScale = 1,
|
||||
this.dynamicHzOffset = 0,
|
||||
@ -50,12 +48,6 @@ class IllustrationPiece extends StatefulWidget {
|
||||
/// The % amount that this object should scale up as the user drags their finger up the screen
|
||||
final double zoomAmt;
|
||||
|
||||
/// Applied to the underlying image in the piece, defaults to [BoxFit.cover]
|
||||
final BoxFit boxFit;
|
||||
|
||||
/// Whether or not this piece can overflow it's parent on the horizontal bounds
|
||||
final bool overflow;
|
||||
|
||||
/// Adds a hero tag to this piece, made from wonderType + fileName
|
||||
final bool enableHero;
|
||||
|
||||
@ -93,10 +85,10 @@ class _IllustrationPieceState extends State<IllustrationPiece> {
|
||||
final anim = wonderBuilder.anim;
|
||||
final curvedAnim = Curves.easeOut.transform(anim.value);
|
||||
final config = wonderBuilder.widget.config;
|
||||
Widget img = Image.asset(imgPath, opacity: anim, fit: widget.boxFit);
|
||||
if (widget.overflow) {
|
||||
Widget img = Image.asset(imgPath, opacity: anim, fit: BoxFit.fitHeight);
|
||||
// Add overflow box so image doesn't get clipped as we translate it around
|
||||
img = OverflowBox(maxWidth: 2000, child: img);
|
||||
}
|
||||
|
||||
final double introZoom = (widget.initialScale - 1) * (1 - curvedAnim);
|
||||
|
||||
/// Determine target height
|
||||
|
@ -54,8 +54,6 @@ class PyramidsGizaIllustration extends StatelessWidget {
|
||||
heightFactor: .5,
|
||||
minHeight: 300,
|
||||
zoomAmt: .1,
|
||||
boxFit: BoxFit.contain,
|
||||
overflow: !config.shortMode,
|
||||
)
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user