Files
eatvio_app/lib/features/profile/models/sub_model.dart
2025-05-21 17:42:43 +03:00

33 lines
998 B
Dart

import 'package:eatvio_app/core/models/pagination_model.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'sub_model.freezed.dart';
part 'sub_model.g.dart';
@freezed
abstract class SubPaginationModel with _$SubPaginationModel {
const factory SubPaginationModel({
required List<SubModel> data,
required Links links,
required Meta meta,
}) = _SubPaginationModel;
factory SubPaginationModel.fromJson(Map<String, Object?> json) => _$SubPaginationModelFromJson(json);
}
@freezed
abstract class SubModel with _$SubModel {
const factory SubModel({
required String slug,
required String name,
required String city,
required DateTime birthdate,
@JsonKey(name: 'is_entity_subscribed_by_me') required bool isEntitySubscribedByMe,
@JsonKey(name: 'profile_photo_url') required String profilePhotoUrl,
required List<String> roles,
}) = _SubModel;
factory SubModel.fromJson(Map<String, Object?> json) => _$SubModelFromJson(json);
}