PatternLock constructor

const PatternLock({
  1. Key? key,
  2. required int width,
  3. required int height,
  4. required void onEntered(
    1. List<int> result
    ),
  5. Duration animationDuration = const Duration(milliseconds: 250),
  6. PatternLockCellActivationArea cellActivationArea = const PatternLockCellActivationArea(dimension: .7, units: PatternLockCellAreaUnits.relative, shape: PatternLockCellAreaShape.square),
  7. PatternLockLinkageSettings linkageSettings = const PatternLockLinkageSettings(allowRepetitions: false, maxLinkDistance: 1),
  8. Widget cellBuilder(
    1. BuildContext context,
    2. int position,
    3. double anim
    )?,
  9. void onUpdate(
    1. List<int> current
    )?,
  10. PatternLockLineAppearance lineAppearance = const PatternLockLineAppearance(color: Colors.blue, width: 5.0),
  11. bool hapticFeedback = true,
})

Implementation

const PatternLock({
  Key? key,
  required this.width,
  required this.height,
  required this.onEntered,
  this.animationDuration = const Duration(milliseconds: 250),
  this.cellActivationArea = const PatternLockCellActivationArea(
    dimension: .7,
    units: PatternLockCellAreaUnits.relative,
    shape: PatternLockCellAreaShape.square,
  ),
  this.linkageSettings = const PatternLockLinkageSettings(
    allowRepetitions: false,
    maxLinkDistance: 1,
  ),
  this.cellBuilder,
  this.onUpdate,
  this.lineAppearance = const PatternLockLineAppearance(
    color: Colors.blue,
    width: 5.0,
  ),
  this.hapticFeedback = true,
})  : assert(
        width > 0 && height > 0,
        'Both width and height must be not less than 1',
      ),
      super(key: key);