Skip to content

Commit

Permalink
bug fixes and ui updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Aug 31, 2022
1 parent 886a80c commit db683c5
Show file tree
Hide file tree
Showing 48 changed files with 985 additions and 799 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ other users.

<img src="screenshots/register.png" alt="" width="400" />

### Home Screen

<img src="screenshots/home.png" alt="" width="400" />

### Profile Screen

<img src="screenshots/profile.png" alt="" width="400" />

### Settings Screen
### Notification Screen

<img src="screenshots/settings.png" alt="" width="400" />
<img src="screenshots/notification.png" alt="" width="400" />

## Connect With Me

Expand Down
19 changes: 15 additions & 4 deletions lib/apis/models/entities/post.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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';

Expand All @@ -8,12 +9,14 @@ part 'post.g.dart';
@JsonSerializable()
class Post extends Equatable {
const Post({
required this.id,
this.id,
this.caption,
this.mediaFiles,
required this.owner,
required this.likes,
required this.likesCount,
required this.comments,
required this.commentsCount,
required this.postStatus,
required this.createdAt,
});
Expand All @@ -23,7 +26,7 @@ class Post extends Equatable {
Map<String, dynamic> toJson() => _$PostToJson(this);

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

@JsonKey(name: 'caption')
final String? caption;
Expand All @@ -35,10 +38,16 @@ class Post extends Equatable {
final User owner;

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

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

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

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

@JsonKey(name: 'postStatus')
final String postStatus;
Expand All @@ -53,7 +62,9 @@ class Post extends Equatable {
mediaFiles,
owner,
likes,
likesCount,
comments,
commentsCount,
postStatus,
createdAt,
];
Expand Down
13 changes: 10 additions & 3 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.

62 changes: 0 additions & 62 deletions lib/apis/models/entities/post_details.dart

This file was deleted.

34 changes: 0 additions & 34 deletions lib/apis/models/entities/post_details.g.dart

This file was deleted.

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

part 'post_like.g.dart';

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

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

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

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

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

@JsonKey(name: 'likedAt')
final DateTime? likedAt;

@override
List<Object?> get props => <Object?>[
id,
likedBy,
likedAt,
];
}
21 changes: 21 additions & 0 deletions lib/apis/models/entities/post_like.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/post_like_details.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 'post_like_details.g.dart';

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

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

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

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

@JsonKey(name: 'likedBy')
final User? likedBy;

@JsonKey(name: 'likedAt')
final DateTime? likedAt;

@override
List<Object?> get props => <Object?>[
id,
likedBy,
likedAt,
];
}
25 changes: 25 additions & 0 deletions lib/apis/models/entities/post_like_details.g.dart

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

10 changes: 10 additions & 0 deletions lib/apis/models/entities/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class Profile extends Equatable {
required this.posts,
required this.followers,
required this.following,
required this.followersCount,
required this.followingsCount,
required this.role,
required this.accountType,
required this.accountStatus,
Expand Down Expand Up @@ -100,6 +102,12 @@ class Profile extends Equatable {
@JsonKey(name: 'following')
final List<dynamic> following;

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

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

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

Expand Down Expand Up @@ -156,6 +164,8 @@ class Profile extends Equatable {
posts,
followers,
following,
followingsCount,
followersCount,
role,
accountType,
accountStatus,
Expand Down
4 changes: 4 additions & 0 deletions lib/apis/models/entities/profile.g.dart

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

Loading

0 comments on commit db683c5

Please sign in to comment.