getMessage method

String? getMessage([
  1. String? attribute
])

Returns the formatted error message for this rule.

Replaces {{attribute}} placeholder with the provided attribute name.

Implementation

String? getMessage([String? attribute]) {
  return message?.replaceAll('{{attribute}}', attribute ?? 'data');
}