import 'package:didvan/models/ai/bots_model.dart'; class ToolsModel { List? tools; ToolsModel({this.tools}); ToolsModel.fromJson(Map json) { if (json['tools'] != null) { tools = []; json['tools'].forEach((v) { tools!.add(Tools.fromJson(v)); }); } } Map toJson() { final Map data = {}; if (tools != null) { data['tools'] = tools!.map((v) => v.toJson()).toList(); } return data; } } class Tools { int? id; String? name; String? image; String? description; String? guide; int? order; List? bots; Tools( {this.id, this.name, this.image, this.description, this.guide, this.order, this.bots}); Tools.fromJson(Map json) { id = json['id']; name = json['name']; image = json['image']; description = json['description']; guide = json['guide']; order = json['order']; if (json['bots'] != null) { bots = []; json['bots'].forEach((v) { bots!.add(BotsModel.fromJson(v)); }); } } Map toJson() { final Map data = {}; data['id'] = id; data['name'] = name; data['image'] = image; data['description'] = description; data['guide'] = guide; data['order'] = order; if (bots != null) { data['bots'] = bots!.map((v) => v.toJson()).toList(); } return data; } }