CupertinoMagnifier constructor

const CupertinoMagnifier({
  1. Key? key,
  2. Size size = kDefaultSize,
  3. BorderRadius borderRadius = const BorderRadius.all(Radius.elliptical(60, 50)),
  4. Offset additionalFocalPointOffset = Offset.zero,
  5. List<BoxShadow> shadows = const <BoxShadow>[BoxShadow(color: Color.fromARGB(25, 0, 0, 0), blurRadius: 11, spreadRadius: 0.2, blurStyle: BlurStyle.outer)],
  6. Clip clipBehavior = Clip.none,
  7. BorderSide borderSide = const BorderSide(color: Color.fromARGB(255, 232, 232, 232)),
  8. Animation<double>? inOutAnimation,
  9. double magnificationScale = 1.0,
})

Creates a RawMagnifier in the Cupertino style.

The default constructor parameters and constants were eyeballed on an iPhone XR iOS v15.5.

Implementation

const CupertinoMagnifier({
  super.key,
  this.size = kDefaultSize,
  this.borderRadius = const BorderRadius.all(Radius.elliptical(60, 50)),
  this.additionalFocalPointOffset = Offset.zero,
  this.shadows = const <BoxShadow>[
    BoxShadow(
      color: Color.fromARGB(25, 0, 0, 0),
      blurRadius: 11,
      spreadRadius: 0.2,
      blurStyle: BlurStyle.outer,
    ),
  ],
  this.clipBehavior = Clip.none,
  this.borderSide =
      const BorderSide(color: Color.fromARGB(255, 232, 232, 232)),
  this.inOutAnimation,
  this.magnificationScale = 1.0,
}) : assert(magnificationScale > 0, 'The magnification scale should be greater than zero.');