form_bloc
form_bloc copied to clipboard
How to submitting form_bloc into API using model & params?
I have a model and I want to submit data input from form_bloc into it, the data should be submitted into params and the data is placed inside List<dynamic>? response; how to submit it with using form_bloc?
class FormModel {
bool? status;
String? message;
List<dynamic>? response;
double? generated;
int? tokenExpire;
int? serverTime;
FormModel({
this.status,
this.message,
this.response,
this.generated,
this.tokenExpire,
this.serverTime,
});
FormModel.fromJson(Map<String, dynamic> json) {
status = json['status'] as bool?;
message = json['message'] as String?;
response = json['response'] as List?;
generated = json['generated'] as double?;
tokenExpire = json['tokenExpire'] as int?;
serverTime = json['serverTime'] as int?;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> json = <String, dynamic>{};
json['status'] = status;
json['message'] = message;
json['response'] = response;
json['generated'] = generated;
json['tokenExpire'] = tokenExpire;
json['serverTime'] = serverTime;
return json;
}
}
https://github.com/GiancarloCode/form_bloc/pull/312#issuecomment-1164240179