mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-16 13:43:17 +00:00
14 lines
449 B
Dart
14 lines
449 B
Dart
import 'package:cubit_form/cubit_form.dart';
|
|
|
|
class LegnthStringValidationWithLenghShowing extends ValidationModel<String> {
|
|
LegnthStringValidationWithLenghShowing(int length, String errorText)
|
|
: super((n) => n.length != length, errorText);
|
|
|
|
@override
|
|
String? check(String val) {
|
|
var length = val.length;
|
|
var errorMassage = this.errorMassage.replaceAll("[]", length.toString());
|
|
return test(val) ? errorMassage : null;
|
|
}
|
|
}
|