25 lines
668 B
Dart
25 lines
668 B
Dart
import 'package:aitrainer_app/model/tutorial_step.dart';
|
|
|
|
enum TutorialEnum { basic, development, training }
|
|
|
|
class Tutorial {
|
|
late int tutorialId;
|
|
late String name;
|
|
|
|
List<TutorialStep>? steps;
|
|
|
|
Tutorial.fromJson(Map<String, dynamic> json) {
|
|
this.tutorialId = json['tutorialId'];
|
|
this.name = json['name'];
|
|
|
|
if (json['steps'] != null && json['steps'].length > 0) {
|
|
steps = json['steps'].map<TutorialStep>((step) => TutorialStep.fromJson(step)).toList();
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() => {'tutorialId': this.tutorialId, 'name': this.name, 'steps': steps.toString()};
|
|
|
|
@override
|
|
String toString() => this.toJson().toString();
|
|
}
|