73 lines
1.5 KiB
Dart
73 lines
1.5 KiB
Dart
import 'package:didvan/models/ai/bots_model.dart';
|
|
|
|
class ToolsModel {
|
|
List<Tools>? tools;
|
|
|
|
ToolsModel({this.tools});
|
|
|
|
ToolsModel.fromJson(Map<String, dynamic> json) {
|
|
if (json['tools'] != null) {
|
|
tools = <Tools>[];
|
|
json['tools'].forEach((v) {
|
|
tools!.add(Tools.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
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<BotsModel>? bots;
|
|
|
|
Tools(
|
|
{this.id,
|
|
this.name,
|
|
this.image,
|
|
this.description,
|
|
this.guide,
|
|
this.order,
|
|
this.bots});
|
|
|
|
Tools.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
image = json['image'];
|
|
description = json['description'];
|
|
guide = json['guide'];
|
|
order = json['order'];
|
|
if (json['bots'] != null) {
|
|
bots = <BotsModel>[];
|
|
json['bots'].forEach((v) {
|
|
bots!.add(BotsModel.fromJson(v));
|
|
});
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
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;
|
|
}
|
|
}
|