forked from eatvio/eatvio_app
feat(profile): subscribers and subscriptions
This commit is contained in:
38
lib/features/profile/models/sub_model.dart
Normal file
38
lib/features/profile/models/sub_model.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user