petsHero-AI/lib/features/home/models/category_item.dart
2026-03-09 16:39:54 +08:00

21 lines
475 B
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// 分类项V2 字段federation=id, brigade=name, greylist=icon
class CategoryItem {
const CategoryItem({
required this.id,
required this.name,
this.icon,
});
final int id;
final String name;
final String? icon;
factory CategoryItem.fromJson(Map<String, dynamic> json) {
return CategoryItem(
id: json['federation'] as int? ?? 0,
name: json['brigade'] as String? ?? '',
icon: json['greylist'] as String?,
);
}
}