Package provides Widget with background mask.
Add package to your pubspec.yaml and import 'package:focus_mask/focus_mask.dart';
FocusMask.circle(
point: Offset(100, 100),
radius: 50,
);
FocusMask.square(
point: Offset(100, 100),
size: slider * 3,
);
FocusMask.rectangle(
point: Offset(100, 100),
width: 50,
height: 50,
);
FocusMask.offset(
offset: EdgeInsets.symmetric(
vertical: 50,
horizontal: 50,
),
);
FocusMask widget using CustomPainter, so you can write your own:
FocusMask(
painter: HERE_YOUR_CUSTOM_PAINTER,
);
For example, FocusMask.circle()
is the same as:
FocusMask(
painter: FocusMaskCirclePainter(point: point, radius: radius, color: color)
);
Feel free to contribute.