Map<String, dynamic> toJson() { return { 'selectedIndex': selectedIndex, 'list': list?.map((e) => e.toJson()).toList(), }; }