class Mautic { late int formId; String? firstname; String? lastname; String? email; String? fitnessLevel; String? goal; int? databaseId; String? subscriptionDate; String? language; Map toJson() => { "formId": this.formId, "firstname": this.firstname, "lastname": this.lastname, "email": this.email, "fitnessLevel": this.fitnessLevel, "goal": this.goal, "databaseId": this.databaseId, "subscriptionDate": this.subscriptionDate, "language": this.language }; String toForm() { String form = "mauticform[formId]=${this.formId}"; form += this.email == null ? "" : "&mauticform[email]=${this.email}"; form += this.lastname == null ? "" : "&mauticform[f_name]=${this.lastname}"; form += this.firstname == null ? "" : "&mauticform[firstname]=${this.firstname}"; form += this.fitnessLevel == null ? "" : "&mauticform[fitness_level]=${this.fitnessLevel}"; form += this.goal == null ? "" : "&mauticform[goal]=${this.goal}"; form += this.subscriptionDate == null ? "" : "&mauticform[subscribed]=${this.subscriptionDate}"; form += this.databaseId == null ? "" : "&mauticform[database_id]=${this.databaseId}"; form += this.language == null ? "" : "&mauticform[language]=${this.language}"; return form; } @override String toString() => this.toJson().toString(); }