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 Aug 30, 2022
1 parent 785447f commit 886a80c
Show file tree
Hide file tree
Showing 52 changed files with 1,830 additions and 550 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# social_media_app

A social media application developed using Flutter and GetX state management.
A social media application developed using Flutter and GetX state management for
sharing and connecting with people around the world.
It is a mobile app that allows users to share their photos and videos with
other users.

## Features

Expand All @@ -9,10 +12,11 @@ A social media application developed using Flutter and GetX state management.
- Forgot Password
- Reset Password
- Change Password
- Account Verification
- Get Profile Details
- Update Profile Details
- Upload Profile Picture
- Delete Profile
- Follow/Unfollow User
- Create Post
- Fetch Posts
- Like/Unlike Post
Expand All @@ -22,6 +26,7 @@ A social media application developed using Flutter and GetX state management.
- Get Comments
- Like/Unlike Comment
- Delete Comment
- Customized Settings

## Download APK

Expand Down
24 changes: 24 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,28 @@
android:name="flutterEmbedding"
android:value="2" />
</application>

<queries>
<!-- If your app opens https URLs -->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<!-- If your app makes calls -->
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
<!-- If your sends SMS messages -->
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="smsto" />
</intent>
<!-- If your app sends emails -->
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="*/*" />
</intent>
</queries>

</manifest>
Binary file added assets/images/mki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 0 additions & 35 deletions lib/apis/models/responses/follower_list_response.dart

This file was deleted.

25 changes: 0 additions & 25 deletions lib/apis/models/responses/follower_list_response.g.dart

This file was deleted.

38 changes: 34 additions & 4 deletions lib/apis/models/responses/notification_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ part 'notification_response.g.dart';
class NotificationResponse extends Equatable {
const NotificationResponse({
this.success,
this.count,
this.currentPage,
this.totalPages,
this.limit,
this.hasPrevPage,
this.prevPage,
this.hasNextPage,
this.nextPage,
this.results,
});

Expand All @@ -20,16 +26,40 @@ class NotificationResponse extends Equatable {
@JsonKey(name: 'success')
final bool? success;

@JsonKey(name: 'count')
final int? count;
@JsonKey(name: 'currentPage')
final int? currentPage;

@JsonKey(name: 'totalPages')
final int? totalPages;

@JsonKey(name: 'limit')
final int? limit;

@JsonKey(name: 'hasPrevPage')
final bool? hasPrevPage;

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

@JsonKey(name: 'hasNextPage')
final bool? hasNextPage;

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

@JsonKey(name: 'results')
final List<ApiNotification>? results;

@override
List<Object?> get props => <Object?>[
success,
count,
currentPage,
totalPages,
limit,
hasPrevPage,
prevPage,
hasNextPage,
nextPage,
results,
];
}
16 changes: 14 additions & 2 deletions lib/apis/models/responses/notification_response.g.dart

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

44 changes: 37 additions & 7 deletions lib/apis/providers/api_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,31 @@ class ApiProvider {

Future<http.Response> resetPassword(Map<String, dynamic> body) async {
final response = await _client.post(
Uri.parse(baseUrl! + AppUrls.resetPasswordEndpoint),
Uri.parse('${baseUrl!}${AppUrls.resetPasswordEndpoint}'),
headers: {
"content-type": "application/json",
},
body: jsonEncode(body),
);

return response;
}

Future<http.Response> sendVerifyAccountOtp(Map<String, dynamic> body) async {
final response = await _client.post(
Uri.parse('${baseUrl!}${AppUrls.verifyAccountEndpoint}'),
headers: {
"content-type": "application/json",
},
body: jsonEncode(body),
);

return response;
}

Future<http.Response> verifyAccount(Map<String, dynamic> body) async {
final response = await _client.put(
Uri.parse('${baseUrl!}${AppUrls.verifyAccountEndpoint}'),
headers: {
"content-type": "application/json",
},
Expand Down Expand Up @@ -294,9 +318,11 @@ class ApiProvider {
return response;
}

Future<http.Response> getFollowers(String token, String userId) async {
Future<http.Response> getFollowers(String token, String userId,
{int? page, int? limit}) async {
final response = await _client.get(
Uri.parse('${baseUrl! + AppUrls.getFollowersEndpoint}?id=$userId'),
Uri.parse(
'${baseUrl! + AppUrls.getFollowersEndpoint}?id=$userId&page=$page&limit=$limit'),
headers: {
"content-type": "application/json",
"authorization": "Bearer $token",
Expand All @@ -306,9 +332,11 @@ class ApiProvider {
return response;
}

Future<http.Response> getFollowings(String token, String userId) async {
Future<http.Response> getFollowings(String token, String userId,
{int? page, int? limit}) async {
final response = await _client.get(
Uri.parse('${baseUrl! + AppUrls.getFollowingEndpoint}?id=$userId'),
Uri.parse(
'${baseUrl! + AppUrls.getFollowingEndpoint}?id=$userId&page=$page&limit=$limit'),
headers: {
"content-type": "application/json",
"authorization": "Bearer $token",
Expand Down Expand Up @@ -385,9 +413,11 @@ class ApiProvider {
return response;
}

Future<http.Response> getNotifications(String token) async {
Future<http.Response> getNotifications(String token,
{int? page, int? limit}) async {
final response = await _client.get(
Uri.parse(baseUrl! + AppUrls.getNotifications),
Uri.parse(
'${baseUrl!}${AppUrls.getNotifications}?page=$page&limit=$limit'),
headers: {
"content-type": "application/json",
"authorization": "Bearer $token",
Expand Down
8 changes: 7 additions & 1 deletion lib/apis/services/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class AuthService extends GetxService {
'lastActive': DateTime.now().toIso8601String(),
};

AppUtils.printLog("Save LoginInfo Request...");
AppUtils.printLog("Save LoginInfo Request");

try {
final response = await _apiProvider.saveDeviceInfo(_token, body);
Expand All @@ -159,21 +159,27 @@ class AuthService extends GetxService {

if (response.statusCode == 200) {
AppUtils.printLog(decodedData[StringValues.message]);
AppUtils.printLog("Save LoginInfo Success");
} else {
AppUtils.printLog(decodedData[StringValues.message]);
AppUtils.printLog("Save LoginInfo Error");
}
} on SocketException {
AppUtils.printLog("Save LoginInfo Error");
AppUtils.printLog(StringValues.internetConnError);
AppUtils.showSnackBar(StringValues.internetConnError, StringValues.error);
} on TimeoutException {
AppUtils.printLog("Save LoginInfo Error");
AppUtils.printLog(StringValues.connTimedOut);
AppUtils.printLog(StringValues.connTimedOut);
AppUtils.showSnackBar(StringValues.connTimedOut, StringValues.error);
} on FormatException catch (e) {
AppUtils.printLog("Save LoginInfo Error");
AppUtils.printLog(StringValues.formatExcError);
AppUtils.printLog(e);
AppUtils.showSnackBar(StringValues.errorOccurred, StringValues.error);
} catch (exc) {
AppUtils.printLog("Save LoginInfo Error");
AppUtils.printLog(StringValues.errorOccurred);
AppUtils.printLog(exc);
AppUtils.showSnackBar(StringValues.errorOccurred, StringValues.error);
Expand Down
1 change: 1 addition & 0 deletions lib/constants/assets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ abstract class AssetValues {
static const String avatar = 'assets/images/avatar.png';
static const String welcome = 'assets/images/welcome.png';
static const String error = 'assets/images/error.png';
static const String makeInIndia = 'assets/images/mki.png';
}
11 changes: 10 additions & 1 deletion lib/constants/strings.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
abstract class StringValues {
static const appName = 'Rippl!';
static const appVersion = '1.0.0';
static const welcome = 'Welcome';
static const to = 'to';
static const hello = 'Hello';
Expand All @@ -12,6 +13,7 @@ abstract class StringValues {
static const registerWelcome = 'Hello! Register to get started';
static const forgotPassword = 'Forgot Password';
static const resetPassword = 'Reset Password';
static const verifyAccount = 'Verify Account';
static const name = 'Name';
static const next = 'Next';
static const firstName = 'First Name';
Expand All @@ -26,10 +28,11 @@ abstract class StringValues {
static const currentPassword = "Current Password";
static const resetYourPassword = 'Reset your password';
static const forgotYourPassword = 'Forgot your password?';
static const verifyYourAccount = 'Verify your account';
static const enterEmailForOtp =
'Enter your email address and an OTP will be sent to your email address if account exists';
static const enterOtpYouGet =
'An OTP has been sent to your email address, please enter OTP and reset your password';
'An OTP has been sent to your email address, please enter OTP to proceed';
static const settings = 'Settings';
static const profile = 'Profile';
static const doNotHaveAccount = "Don't have an account?";
Expand Down Expand Up @@ -74,6 +77,7 @@ abstract class StringValues {
static const doNotHaveOtp = "Don't have an OTP?";
static const alreadyHaveOtp = "Already have an OTP?";
static const passwordChangeSuccessful = 'Password changed successfully.';
static const verifyAccountSuccessful = 'Account verified successfully.';
static const editProfile = 'Edit Profile';
static const updateProfileSuccessful = 'Profile updated successfully.';
static const updateUsernameSuccessful = 'Username updated successfully.';
Expand Down Expand Up @@ -185,4 +189,9 @@ abstract class StringValues {
static const twoFaAuthHelpText =
'Help protect your account from unauthorised access by requiring a second authentication method in addition to your password.';
static const moreDetails = 'More Details';
static const websiteUrl = 'https://nixlab.co.in';
static const appDownloadUrl =
'https://github.com/nixrajput/social-media-app-flutter/releases';
static const appGithubUrl =
'https://github.com/nixrajput/social-media-app-flutter';
}
1 change: 1 addition & 0 deletions lib/constants/urls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ abstract class AppUrls {
static const String registerEndpoint = '/register';
static const String forgotPasswordEndpoint = '/forgot-password';
static const String resetPasswordEndpoint = '/reset-password';
static const String verifyAccountEndpoint = '/verify-account';

static const String getPostsEndpoint = '/get-posts';
static const String postEndpoint = '/post';
Expand Down
Loading

0 comments on commit 886a80c

Please sign in to comment.