forked from eatvio/eatvio_app
39 lines
1.2 KiB
Dart
39 lines
1.2 KiB
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
|
|
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
|
|
class SubModel with _$SubModel {
|
|
const factory SubModel({
|
|
required int id,
|
|
required String slug,
|
|
required String name,
|
|
required String city,
|
|
required DateTime birthdate,
|
|
@JsonKey(name: 'is_subscribe')
|
|
required bool isSubscribe,
|
|
required String email,
|
|
@JsonKey(name: 'profile_photo_url') required String profilePhotoUrl,
|
|
required String role,
|
|
@JsonKey(name: 'is_public_profile') required bool isPublicProfile,
|
|
@JsonKey(name: 'created_at') required DateTime createdAt,
|
|
@JsonKey(name: 'updated_at') required DateTime updatedAt,
|
|
}) = _SubModel;
|
|
|
|
factory SubModel.fromJson(Map<String, Object?> json) => _$SubModelFromJson(json);
|
|
}
|