import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter/foundation.dart';
part 'groups.freezed.dart';
part 'groups.g.dart';

@freezed
class Groups with _$Groups {
  const factory Groups({Normal? normal, Normal? streaming}) = _Groups;

  factory Groups.fromJson(Map<String, Object?> json) => _$GroupsFromJson(json);
}

@freezed
class Normal with _$Normal {
  const factory Normal({List<Tags>? tags, List<LocationList>? list}) = _Normal;

  factory Normal.fromJson(Map<String, Object?> json) => _$NormalFromJson(json);
}

@freezed
class Tags with _$Tags {
  const factory Tags({int? id, String? name, String? icon, int? sort}) = _Tags;

  factory Tags.fromJson(Map<String, Object?> json) => _$TagsFromJson(json);
}

@freezed
class LocationList with _$LocationList {
  const factory LocationList({
    int? id,
    String? name,
    String? icon,
    int? tag,
    List<Locations>? locations,
  }) = _LocationList;

  factory LocationList.fromJson(Map<String, Object?> json) =>
      _$LocationListFromJson(json);
}

@freezed
class Locations with _$Locations {
  const factory Locations({
    int? id,
    String? name,
    String? code,
    String? icon,
    String? country,
    int? sort,
  }) = _Locations;

  factory Locations.fromJson(Map<String, Object?> json) =>
      _$LocationsFromJson(json);
}
