Open AlaaEldeenYsr opened 1 year ago
Add a method to patch errors
void main(List<String> args) { final form = fb.group({ 'name': '', 'phone': '', 'identity': '', 'school_id': '', 'childs': fb.array([ { "path": '', "stage_id": '', "gender": '', }, ]), }); final errorsJson = { 'name': { 'SERVER_ERROR': {"error": 'please fill the value'} }, 'phone': { 'SERVER_ERROR': {"error": 'please fill the value'} }, 'identity': { 'SERVER_ERROR': {"error": 'please fill the value'} }, 'school_id': { 'SERVER_ERROR': {"error": 'please fill the value'} }, 'childs': [ { "path": { 'SERVER_ERROR': {"error": 'please fill the value'} }, "stage_id": { 'SERVER_ERROR': {"error": 'please fill the value'} }, "gender": { 'SERVER_ERROR': {"error": 'please fill the value'} }, }, ] }; ReactiveFormConfig( validationMessages: { 'SERVER_ERROR': (error) => (error as Map)['error'], }, child: child, ); form.patchErrors(errorsJson); }
@joanpablo any support please
Add a method to patch errors