add Form Field

abstract fun addFormField(    fieldName: String,     view: View,     rules: List<BaseRule>,     action: (String) -> Unit? = null)

Method to add field to the form

Parameters

fieldName

name used for getting variable later on

view

the view that need to be implemented with validation

rules

list of rules to be implemented

action

what action to invoked when the validation is not met

Sources

Link copied to clipboard