wonders/lib/ui/wonder_illustrations/common/paint_textures.dart
Jared Bell 8ef645bf52 Polish up responsive Wonder layouts
Adjust graphics within illustration widgets, Revise paint texture use, Update graphics for wonders and collectible search, Clean out extra scale factor images.
2022-11-30 01:53:33 -07:00

25 lines
902 B
Dart

import 'package:wonders/common_libs.dart';
class IllustrationTexture extends StatelessWidget {
const IllustrationTexture(this.path,
{Key? key, this.scale = 1, this.color, this.flipX = false, this.flipY = false, this.opacity})
: super(key: key);
final Color? color;
final double scale;
final bool flipX;
final bool flipY;
final String path;
final Animation<double>? opacity;
@override
Widget build(BuildContext context) => ListenableBuilder(
listenable: opacity ?? AlwaysStoppedAnimation(1),
builder: (context, child) => ClipRect(
child: Transform.scale(
scaleX: scale * (flipX ? -1 : 1),
scaleY: scale * (flipY ? -1 : 1),
child: Image.asset(path, repeat: ImageRepeat.repeat, fit: BoxFit.contain, alignment: Alignment.topCenter, color: color, opacity: opacity, cacheWidth: 2048)),
),
);
}