validateMoney method
Implementation
String? validateMoney(String valueWithCurency, int minimalValue,
{String? errorMessage, String? errorMessage2, String? errorMessage3}) {
var value = TextHelper().removeCurrency(valueWithCurency);
if (value.isEmpty) return errorMessage ?? errorEmpty;
try {
if (int.parse(value) < minimalValue)
return errorMessage2 ??
'Harus lebih dari ${TextHelper().getCurrency(minimalValue)}';
} catch (e) {
return errorMessage3 ?? "Format tidak sesuai";
}
return null;
}