mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-09 02:13:15 +00:00
14 lines
448 B
Dart
14 lines
448 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;
|
|
}
|
|
}
|