forked from eatvio/eatvio_app
33 lines
998 B
Dart
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);
|
|
}
|