passo_mobile_app/lib/model/passo/class_components.dart

98 lines
3.3 KiB
Dart
Raw Normal View History

2023-07-28 02:35:36 +00:00
// To parse this JSON data, do
//
// final classComponents = classComponentsFromJson(jsonString);
import 'package:meta/meta.dart';
import 'dart:convert';
ClassComponents classComponentsFromJson(String str) =>
ClassComponents.fromJson(json.decode(str));
String classComponentsToJson(ClassComponents data) =>
json.encode(data.toJson());
class ClassComponents {
final int id;
final String componentName;
final String minBaseUnitvalPercent;
final String maxBaseUnitvalPercent;
final String minUnitvalSqrmtr;
final String maxUnitvalSqrmtr;
final String minAddBaseunitval;
final String maxAddBaseunitval;
final String minDeductBaserate;
final String maxDeductBaserate;
final String minLinearMeter;
final String maxLinearMeter;
final String minSpacing;
final String maxSpacing;
final String roughFinish;
final String highFinish;
final bool withoutBucc;
// final String genCode;
2023-07-28 02:35:36 +00:00
ClassComponents({
required this.id,
required this.componentName,
required this.minBaseUnitvalPercent,
required this.maxBaseUnitvalPercent,
required this.minUnitvalSqrmtr,
required this.maxUnitvalSqrmtr,
required this.minAddBaseunitval,
required this.maxAddBaseunitval,
required this.minDeductBaserate,
required this.maxDeductBaserate,
required this.minLinearMeter,
required this.maxLinearMeter,
required this.minSpacing,
required this.maxSpacing,
required this.roughFinish,
required this.highFinish,
required this.withoutBucc,
// required this.genCode,
2023-07-28 02:35:36 +00:00
});
factory ClassComponents.fromJson(Map<String, dynamic> json) =>
ClassComponents(
id: json["id"],
componentName: json["component_name"],
minBaseUnitvalPercent: json["min_base_unitval_percent"],
maxBaseUnitvalPercent: json["max_base_unitval_percent"],
minUnitvalSqrmtr: json["min_unitval_sqrmtr"],
maxUnitvalSqrmtr: json["max_unitval_sqrmtr"],
minAddBaseunitval: json["min_add_baseunitval"],
maxAddBaseunitval: json["max_add_baseunitval"],
minDeductBaserate: json["min_deduct_baserate"],
maxDeductBaserate: json["max_deduct_baserate"],
minLinearMeter: json["min_linear_meter"],
maxLinearMeter: json["max_linear_meter"],
minSpacing: json["min_spacing"],
maxSpacing: json["max_spacing"],
roughFinish: json["rough_finish"],
highFinish: json["high_finish"],
withoutBucc: json["without_bucc"],
// genCode: json["gen_code"]
2023-07-28 02:35:36 +00:00
);
Map<String, dynamic> toJson() => {
"id": id,
"component_name": componentName,
"min_base_unitval_percent": minBaseUnitvalPercent,
"max_base_unitval_percent": maxBaseUnitvalPercent,
"min_unitval_sqrmtr": minUnitvalSqrmtr,
"max_unitval_sqrmtr": maxUnitvalSqrmtr,
"min_add_baseunitval": minAddBaseunitval,
"max_add_baseunitval": maxAddBaseunitval,
"min_deduct_baserate": minDeductBaserate,
"max_deduct_baserate": maxDeductBaserate,
"min_linear_meter": minLinearMeter,
"max_linear_meter": maxLinearMeter,
"min_spacing": minSpacing,
"max_spacing": maxSpacing,
"rough_finish": roughFinish,
"high_finish": highFinish,
"without_bucc": withoutBucc,
// "gen_code": genCode,
2023-07-28 02:35:36 +00:00
};
}