KonectarApp/lib/model/scope_model.dart

51 lines
1.2 KiB
Dart

// To parse this JSON data, do
//
// final welcome = welcomeFromJson(jsonString);
import 'dart:convert';
ScopeModel welcomeFromJson(String str) => ScopeModel.fromJson(json.decode(str));
String welcomeToJson(ScopeModel data) => json.encode(data.toJson());
class ScopeModel {
List<Therapeutic> therapeutics;
ScopeModel({
required this.therapeutics,
});
factory ScopeModel.fromJson(Map<String, dynamic> json) => ScopeModel(
therapeutics: List<Therapeutic>.from(
json["therapeutics"].map((x) => Therapeutic.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"therapeutics": List<dynamic>.from(therapeutics.map((x) => x.toJson())),
};
}
class Therapeutic {
String id;
String clientId;
String therapeuticName;
Therapeutic({
required this.id,
required this.clientId,
required this.therapeuticName,
});
factory Therapeutic.fromJson(Map<String, dynamic> json) => Therapeutic(
id: json["id"],
clientId: json["client_id"],
therapeuticName: json["therapeutic_name"],
);
Map<String, dynamic> toJson() => {
"id": id,
"client_id": clientId,
"therapeutic_name": therapeuticName,
};
}