PixelPerfect constructor

PixelPerfect({
  1. Key? key,
  2. required Widget child,
  3. String? assetPath,
  4. double? scale = 1.0,
  5. Offset offset = Offset.zero,
  6. double initBottom = 20.0,
  7. double initOpacity = 0.4,
})

Creates an PixelPerfect Basic Widget. The assetPath argument is the path to your asset design image The scale argument is scale parameter of your image. Default value is 1;

Implementation

factory PixelPerfect({
  Key? key,
  required Widget child,
  String? assetPath,
  double? scale = 1.0,
  Offset offset = Offset.zero,
  double initBottom = 20.0,
  double initOpacity = 0.4,
}) {
  return PixelPerfect._(
    key: key,
    child: child,
    offset: offset,
    image: assetPath != null
        ? Image.asset(
            assetPath,
            fit: BoxFit.none,
            scale: scale,
          )
        : null,
    bottom: initBottom,
    initOpacity: initOpacity,
  );
}