// To parse this JSON data, do // // final structureMaterialsIi = structureMaterialsIiFromJson(jsonString); import 'package:meta/meta.dart'; import 'dart:convert'; StructureMaterialsII structureMaterialsIiFromJson(String str) => StructureMaterialsII.fromJson(json.decode(str)); String structureMaterialsIiToJson(StructureMaterialsII data) => json.encode(data.toJson()); class StructureMaterialsII { final int? id; final int? bldgapprDetailsId; final List? foundation; final List? columns; final List? beams; final List? trussFraming; final List? roof; final List? flooring; final List? walls; final List? others; final String? genCode; final String? assessedById; final String? assessedByName; final String? dateCreated; final String? dateModified; StructureMaterialsII( {this.id, this.bldgapprDetailsId, this.foundation, this.columns, this.beams, this.trussFraming, this.roof, this.flooring, this.walls, this.others, this.genCode, this.assessedById, this.assessedByName, this.dateCreated, this.dateModified}); factory StructureMaterialsII.fromJson(Map json) => StructureMaterialsII( id: json["id"], bldgapprDetailsId: json["bldgapprDetailsId"], foundation: List.from(json["foundation"].map((x) => x)), columns: List.from(json["columns"].map((x) => x)), beams: List.from(json["beams"].map((x) => x)), trussFraming: List.from(json["truss_framing"].map((x) => x)), roof: List.from(json["roof"].map((x) => x)), flooring: List.from(json["flooring"].map((x) => x)), walls: List.from(json["walls"].map((x) => x)), others: List.from(json["others"].map((x) => x)), genCode: json["gen_code"], assessedById: json["assessed_by_id"], assessedByName: json["assessed_by_name"], dateCreated: json["date_created"], dateModified: json["date_modified"], ); factory StructureMaterialsII.fromJson2(Map json) => StructureMaterialsII( id: json["id"], bldgapprDetailsId: json["bldgapprDetailsId"], foundation: List.from(json["foundation"].map((x) => x)), columns: List.from(json["columns"].map((x) => x)), beams: List.from(json["beams"].map((x) => x)), trussFraming: List.from(json["trussFraming"].map((x) => x)), roof: List.from(json["roof"].map((x) => x)), flooring: List.from(json["flooring"].map((x) => x)), walls: List.from(json["walls"].map((x) => x)), others: List.from(json["others"].map((x) => x)), genCode: json["genCode"], assessedById: json["assessedById"], assessedByName: json["assessedByName"], dateCreated: json["dateCreated"], dateModified: json["dateModified"], ); StructureMaterialsII copy({ int? id, int? bldgapprDetailsId, List? foundation, List? columns, List? beams, List? trussFraming, List? roof, List? flooring, List? walls, List? others, String? genCode, String? assessedById, String? assessedByName, String? dateCreated, String? dateModified, }) => StructureMaterialsII( id: id ?? this.id, bldgapprDetailsId: bldgapprDetailsId ?? this.bldgapprDetailsId, foundation: foundation ?? this.foundation, columns: columns ?? this.columns, beams: beams ?? this.beams, trussFraming: trussFraming ?? this.trussFraming, roof: roof ?? this.roof, flooring: flooring ?? this.flooring, walls: walls ?? this.walls, others: others ?? this.others, genCode: genCode ?? this.genCode, assessedById: assessedById ?? this.assessedById, assessedByName: assessedByName ?? this.assessedByName, dateCreated: dateCreated ?? this.dateCreated, dateModified: dateModified ?? this.dateModified, ); Map toJson() => { "id": id, "bldgapprDetailsId": bldgapprDetailsId, "foundation": List.from(foundation!.map((x) => x)), "columns": List.from(columns!.map((x) => x)), "beams": List.from(beams!.map((x) => x)), "truss_framing": List.from(trussFraming!.map((x) => x)), "roof": List.from(roof!.map((x) => x)), "flooring": List.from(flooring!.map((x) => x)), "walls": List.from(walls!.map((x) => x)), "others": List.from(others!.map((x) => x)), "gen_code": genCode, "assessed_by_id": assessedById, "assessed_by_name": assessedByName, "date_created": dateCreated, "date_modified": dateModified, }; }