Skip to content

Commit

Permalink
feature updates and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Sep 3, 2022
1 parent 3fedaea commit 352cfb6
Show file tree
Hide file tree
Showing 85 changed files with 2,262 additions and 1,138 deletions.
5 changes: 5 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ android {
jvmTarget = '1.8'
}

lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand Down
25 changes: 9 additions & 16 deletions lib/apis/models/entities/comment.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/user.dart';

part 'comment.g.dart';

@JsonSerializable()
class Comment extends Equatable {
const Comment({
class Comment {
Comment({
required this.id,
required this.comment,
required this.user,
required this.post,
required this.likes,
required this.likesCount,
required this.commentStatus,
required this.createdAt,
});

Expand All @@ -32,19 +32,12 @@ class Comment extends Equatable {
@JsonKey(name: 'post')
final String post;

@JsonKey(name: 'likes')
final List<dynamic> likes;
@JsonKey(name: 'likesCount')
int likesCount;

@JsonKey(name: 'commentStatus')
String commentStatus;

@JsonKey(name: 'createdAt')
final DateTime createdAt;

@override
List<Object?> get props => <Object?>[
id,
comment,
user,
post,
likes,
createdAt,
];
}
6 changes: 4 additions & 2 deletions lib/apis/models/entities/comment.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions lib/apis/models/entities/follower.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/user.dart';

part 'follower.g.dart';

@JsonSerializable()
class Follower extends Equatable {
const Follower({
required this.id,
required this.user,
required this.createdAt,
});

factory Follower.fromJson(Map<String, dynamic> json) =>
_$FollowerFromJson(json);

Map<String, dynamic> toJson() => _$FollowerToJson(this);

@JsonKey(name: '_id')
final String id;

@JsonKey(name: 'user')
final User user;

@JsonKey(name: 'createdAt')
final DateTime createdAt;

@override
List<Object?> get props => <Object?>[
id,
user,
createdAt,
];
}
19 changes: 19 additions & 0 deletions lib/apis/models/entities/follower.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/user.dart';

part 'post_like_details.g.dart';
part 'like_details.g.dart';

@JsonSerializable()
class PostLikeDetails extends Equatable {
const PostLikeDetails({
class LikeDetails extends Equatable {
const LikeDetails({
this.id,
this.likedBy,
this.likedAt,
});

factory PostLikeDetails.fromJson(Map<String, dynamic> json) =>
_$PostLikeDetailsFromJson(json);
factory LikeDetails.fromJson(Map<String, dynamic> json) =>
_$LikeDetailsFromJson(json);

Map<String, dynamic> toJson() => _$PostLikeDetailsToJson(this);
Map<String, dynamic> toJson() => _$LikeDetailsToJson(this);

@JsonKey(name: '_id')
final String? id;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/location_info.dart';

part 'device_info.g.dart';
part 'login_device_info.g.dart';

@JsonSerializable()
class DeviceInfo extends Equatable {
const DeviceInfo({
class LoginDeviceInfo extends Equatable {
const LoginDeviceInfo({
this.id,
this.user,
this.deviceId,
Expand All @@ -17,10 +17,10 @@ class DeviceInfo extends Equatable {
this.createdAt,
});

factory DeviceInfo.fromJson(Map<String, dynamic> json) =>
_$DeviceInfoFromJson(json);
factory LoginDeviceInfo.fromJson(Map<String, dynamic> json) =>
_$LoginDeviceInfoFromJson(json);

Map<String, dynamic> toJson() => _$DeviceInfoToJson(this);
Map<String, dynamic> toJson() => _$LoginDeviceInfoToJson(this);

@JsonKey(name: '_id')
final String? id;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 10 additions & 23 deletions lib/apis/models/entities/notification.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/user.dart';

part 'notification.g.dart';

@JsonSerializable()
class ApiNotification extends Equatable {
const ApiNotification({
class ApiNotification {
ApiNotification({
required this.id,
required this.owner,
required this.user,
Expand All @@ -23,38 +22,26 @@ class ApiNotification extends Equatable {
Map<String, dynamic> toJson() => _$ApiNotificationToJson(this);

@JsonKey(name: '_id')
final String id;
String id;

@JsonKey(name: 'owner')
final User owner;
User owner;

@JsonKey(name: 'user')
final User user;
User user;

@JsonKey(name: 'body')
final String body;
String body;

@JsonKey(name: 'refId')
final String? refId;
String? refId;

@JsonKey(name: 'type')
final String type;
String type;

@JsonKey(name: 'isRead')
final bool isRead;
bool isRead;

@JsonKey(name: 'createdAt')
final DateTime createdAt;

@override
List<Object?> get props => <Object?>[
id,
owner,
user,
body,
refId,
type,
isRead,
createdAt,
];
DateTime createdAt;
}
38 changes: 9 additions & 29 deletions lib/apis/models/entities/post.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:social_media_app/apis/models/entities/post_like.dart';
import 'package:social_media_app/apis/models/entities/post_media_file.dart';
import 'package:social_media_app/apis/models/entities/user.dart';

part 'post.g.dart';

@JsonSerializable()
class Post extends Equatable {
const Post({
class Post {
Post({
this.id,
this.caption,
this.mediaFiles,
required this.owner,
required this.likes,
required this.likesCount,
required this.comments,
required this.isLiked,
required this.commentsCount,
required this.postStatus,
required this.createdAt,
Expand All @@ -37,35 +34,18 @@ class Post extends Equatable {
@JsonKey(name: 'owner')
final User owner;

@JsonKey(name: 'likes')
final List<PostLike> likes;

@JsonKey(name: 'likesCount')
final int likesCount;

@JsonKey(name: 'comments')
final List<String> comments;
int likesCount;

@JsonKey(name: 'commentsCount')
final int commentsCount;
int commentsCount;

@JsonKey(name: 'isLiked')
bool isLiked;

@JsonKey(name: 'postStatus')
final String postStatus;
String postStatus;

@JsonKey(name: 'createdAt')
final DateTime createdAt;

@override
List<Object?> get props => <Object?>[
id,
caption,
mediaFiles,
owner,
likes,
likesCount,
comments,
commentsCount,
postStatus,
createdAt,
];
}
9 changes: 2 additions & 7 deletions lib/apis/models/entities/post.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 352cfb6

Please sign in to comment.