import 'package:auto_gpt_flutter_client/models/task.dart'; class TestSuite { final String timestamp; final List tests; TestSuite({required this.timestamp, required this.tests}); // Serialization: Convert the object into a Map Map toJson() { return { 'timestamp': timestamp, 'tests': tests.map((task) => task.toJson()).toList(), }; } // Deserialization: Create an object from a Map factory TestSuite.fromJson(Map json) { return TestSuite( timestamp: json['timestamp'], tests: List.from(json['tests'].map( (taskJson) => Task.fromMap(Map.from(taskJson)))), ); } }