Skip to content

Commit

Permalink
updated to version 1.0.1+26
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Nov 23, 2022
1 parent e0467bd commit 6bb2083
Show file tree
Hide file tree
Showing 14 changed files with 612 additions and 195 deletions.
19 changes: 16 additions & 3 deletions lib/apis/providers/api_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,19 @@ class ApiProvider {
return response;
}

/// Logout Other Devices
Future<ResponseData> logoutOtherDevices(String token, String deviceId) async {
final response = await _catchAsyncApiError(
endPoint: AppUrls.logoutFromOtherDevicesEndpoint,
method: 'DELETE',
feature: 'Logout Other Devices',
headers: {"authorization": "Bearer $token"},
queryParams: {'deviceId': deviceId},
);

return response;
}

/// Verify Login Info & Session
Future<ResponseData> verifyLoginInfo(String token, String deviceId) async {
final response = await _catchAsyncApiError(
Expand Down Expand Up @@ -672,11 +685,11 @@ class ApiProvider {
return response;
}

/// Request Blue Tick
Future<ResponseData> requestBlueTick(
/// Request Verification
Future<ResponseData> requestVerification(
String token, Map<String, dynamic> body) async {
final response = await _catchAsyncApiError(
endPoint: AppUrls.reportUserEndpoint,
endPoint: AppUrls.requestVerificationEndpoint,
method: 'POST',
feature: 'Report User',
headers: {"authorization": "Bearer $token"},
Expand Down
10 changes: 10 additions & 0 deletions lib/constants/dimens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,16 @@ abstract class Dimens {

static EdgeInsets edgeInsetsOnlyBottom16 = EdgeInsets.only(bottom: sixTeen);

static EdgeInsets edgeInsetsOnlyLeft8 = EdgeInsets.only(left: eight);

static EdgeInsets edgeInsetsOnlyLeft16 = EdgeInsets.only(left: sixTeen);

static EdgeInsets edgeInsetsOnlyLeft20 = EdgeInsets.only(left: twenty);

static EdgeInsets edgeInsetsOnlyLeft24 = EdgeInsets.only(left: twentyFour);

static EdgeInsets edgeInsetsOnlyLeft32 = EdgeInsets.only(left: thirtyTwo);

//SizedBoxes

static SizedBox boxHeight2 = SizedBox(height: two);
Expand Down
31 changes: 26 additions & 5 deletions lib/constants/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ abstract class StringValues {
static const trending = 'Trending';
static const refresh = 'Refresh';
static const chats = 'Chats';
static const currentDevice = 'Current Device';
static const otherDevices = 'Other Devices';
static const logoutAllDevices = 'Logout All Other Devices';
static const noConversation = 'No conversation yet';
static const followUserLine =
'Do follow some users to see their latest posts';
Expand Down Expand Up @@ -288,25 +291,25 @@ abstract class StringValues {
'The verification process is simple and easy. You just need to follow the steps below:';
static const verificationProcess = [
{
'index': 1,
'index': '01',
'title': 'Check your eligibility',
'desc':
'Your account must be active and you must have a valid email address or phone number. Your account must be adhering to our Community Guidelines and must not be in violation of our policies. Your account must have a profile photo and bio.',
},
{
'index': 2,
'index': '02',
'title': 'Submit your request',
'desc':
'You will need to provide your full name, email address or phone number, and a photo of your government-issued ID or passport.',
},
{
'index': 3,
'index': '03',
'title': 'Wait for our response',
'desc':
'We will review your request and get back to you within 30 days. If your request is approved, you will get the blue tick on your profile. You will also get a notification and email from us. If your request is denied, you will get a notification and email from us.',
},
{
'index': 4,
'index': '04',
'title': 'Keep your account active',
'desc':
'You must keep your account active and adhere to our Community Guidelines and policies. If your account is inactive for 90 days, your verification badge will be removed.',
Expand All @@ -315,9 +318,11 @@ abstract class StringValues {
static const verificationDescription =
"Here's everything you need to know about verification on Rippl and how to get verified.";
static const verificationDescription2 =
'The blue tick is a verification badge that appears next to your name on your profile. It means that you are an authentic person or business on Rippl. To get the blue tick, you need to meet the requirements and apply for verification.';
'A verified badge on Rippl means that an account of public interest is authentic. It lets people know that an account of public interest is the authentic presence of the public figure, celebrity, or global brand it represents. Verified accounts are marked by a badge on Rippl.';
static const applyForSelfVerify = 'Apply for self verification';
static const applyForBlueTick = 'Apply for blue tick';
static const applyForVerify = 'Apply for verification';
static const apply = 'Apply';
static const verificationRequest = 'Verification Request';
static const request = 'Request';
static const zero = '0';
Expand All @@ -343,6 +348,22 @@ abstract class StringValues {
'Enter your valid phone number with country code.';
static const enterPhone = 'Enter your phone number';
static const enterEmailHelp = 'Enter your valid email address.';
static const verifiedOnOtherPlatform = 'Are you verified on other platforms?';
static const otherPlatformLinks = 'Other Platform Links';
static const otherPlatformLinksHelp =
'If you are verified on other platforms, please provide the link to your verified profile. All links must be publicly accessible. Write comma (,) to separate multiple links.';
static const hasWikiPage = 'Do you have a Wikipedia page?';
static const wikiPageLink = 'Wikipedia Page Link';
static const wikiPageLinkHelp =
'If you have a Wikipedia page, please provide the link to your Wikipedia page.';
static const featuredInNewsArticle =
'Have you been featured in a news article?';
static const newsArticleLink = 'News Article Link';
static const newsArticleLinkHelp =
'If you have been featured in a news article, please provide the link to your news article. All links must be publicly accessible. Write comma (,) to separate multiple links.';
static const otherLinks = 'Other Links';
static const otherLinksHelp =
'If you have any other links that you want to provide, please provide the link. All links must be publicly accessible. Write comma (,) to separate multiple links.';
static const requestSent = 'Request Sent';
static const likes = 'Likes';
static const send = 'Send';
Expand Down
3 changes: 2 additions & 1 deletion lib/constants/urls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ abstract class AppUrls {
static const loginInfoEndpoint = '/login-info';
static const getLoginHistoryEndpoint = '/get-login-history';
static const verifyLoginInfoEndpoint = '/verify-login-info';
static const logoutFromOtherDevicesEndpoint = '/logout-all-other-devices';

static const preKeyBundleEndpoint = '/pre-key-bundle';

Expand All @@ -59,7 +60,7 @@ abstract class AppUrls {
static const reportPostEndpoint = '/report-post';
static const reportCommentEndpoint = '/report-comment';

static const requestBlueTickEndpoint = '/request-blue-tick';
static const requestVerificationEndpoint = '/request-verification';

static const searchUserEndpoint = '/search-user';
static const followUserEndpoint = '/follow-user';
Expand Down
1 change: 1 addition & 0 deletions lib/modules/auth/controllers/register_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class RegisterController extends GetxController {
'uname': uname,
'password': password,
'confirmPassword': confPassword,
'isValidated': 'true',
};

AppUtility.showLoadingDialog();
Expand Down

This file was deleted.

39 changes: 34 additions & 5 deletions lib/modules/settings/controllers/login_info_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:async';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
import 'package:social_media_app/apis/models/entities/login_info.dart';
import 'package:social_media_app/apis/models/responses/common_response.dart';
import 'package:social_media_app/apis/models/responses/login_history_response.dart';
import 'package:social_media_app/apis/providers/api_provider.dart';
import 'package:social_media_app/app_services/auth_service.dart';
Expand Down Expand Up @@ -119,18 +118,16 @@ class LoginInfoController extends GetxController {

if (response.isSuccessful) {
final decodedData = response.data;
final apiResponse = CommonResponse.fromJson(decodedData);
AppUtility.showSnackBar(
apiResponse.message!,
decodedData[StringValues.message],
StringValues.success,
duration: 1,
);
} else {
final decodedData = response.data;
final apiResponse = CommonResponse.fromJson(decodedData);
update();
AppUtility.showSnackBar(
apiResponse.message!,
decodedData[StringValues.message],
StringValues.error,
);
}
Expand All @@ -141,7 +138,39 @@ class LoginInfoController extends GetxController {
}
}

Future<void> _logoutAllOtherDevices(String deviceId) async {
_loginInfoList.removeWhere((element) => element.deviceId != deviceId);
update();

try {
final response =
await _apiProvider.logoutOtherDevices(_auth.token, deviceId);

if (response.isSuccessful) {
final decodedData = response.data;
await _getLoginHistory();
AppUtility.showSnackBar(
decodedData[StringValues.message],
StringValues.success,
duration: 1,
);
} else {
final decodedData = response.data;
update();
AppUtility.showSnackBar(
decodedData[StringValues.message],
StringValues.error,
);
}
} catch (exc) {
update();
AppUtility.showSnackBar('Error: ${exc.toString()}', StringValues.error);
}
}

Future<void> getLoginHisory() async => await _getLoginHistory();
Future<void> logoutAllOtherDevices(String deviceId) async =>
await _logoutAllOtherDevices(deviceId);
Future<void> loadMore() async =>
await _loadMore(page: _loginHistoryData.value.currentPage! + 1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:social_media_app/constants/colors.dart';
import 'package:social_media_app/constants/dimens.dart';
import 'package:social_media_app/constants/strings.dart';
import 'package:social_media_app/constants/styles.dart';
import 'package:social_media_app/extensions/string_extensions.dart';
import 'package:social_media_app/global_widgets/custom_app_bar.dart';
import 'package:social_media_app/global_widgets/primary_filled_btn.dart';
import 'package:social_media_app/global_widgets/unfocus_widget.dart';
Expand All @@ -25,7 +24,7 @@ class VerifiedAccountSettingView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
NxAppBar(
title: StringValues.blueTickVerification,
title: StringValues.verification,
padding: Dimens.edgeInsets8_16,
),
Dimens.boxHeight16,
Expand Down Expand Up @@ -66,7 +65,7 @@ class VerifiedAccountSettingView extends StatelessWidget {
),
),

Dimens.boxHeight16,
Dimens.boxHeight8,

/// Verification Description
Expand All @@ -90,7 +89,7 @@ class VerifiedAccountSettingView extends StatelessWidget {
),
),

Dimens.boxHeight32,
Dimens.boxHeight16,

/// Verification Process
Expand All @@ -110,8 +109,6 @@ class VerifiedAccountSettingView extends StatelessWidget {
),
),

Dimens.boxHeight16,

Column(
children: StringValues.verificationProcess
.map(
Expand All @@ -127,7 +124,7 @@ class VerifiedAccountSettingView extends StatelessWidget {
Dimens.boxHeight16,

NxFilledButton(
label: StringValues.applyForBlueTick.toTitleCase(),
label: StringValues.apply.toUpperCase(),
onTap: () {
RouteManagement.goToBack();
RouteManagement.goToBlueTickVerificationView();
Expand Down Expand Up @@ -156,32 +153,44 @@ class VerificationProcess extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Padding(
padding: Dimens.edgeInsets8_0,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
padding: Dimens.edgeInsets16_0,
child: Stack(
children: [
/// Verification Process Icon
CircleAvatar(
radius: Dimens.twentyFour,
backgroundColor: Theme.of(context).textTheme.bodyText1!.color,
child: Text(
index,
style: AppStyles.style16Bold.copyWith(
color: Theme.of(context).scaffoldBackgroundColor,
Positioned(
left: Dimens.zero,
top: Dimens.zero,
bottom: Dimens.zero,
child: Container(
width: Dimens.eight,
decoration: BoxDecoration(
color: Theme.of(context).textTheme.bodyText1!.color,
),
),
),

Dimens.boxWidth16,

/// Verification Process Text
Expanded(
flex: 1,
Padding(
padding: Dimens.edgeInsetsOnlyLeft24,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
/// Verification Process Index
Container(
decoration: BoxDecoration(
color: Theme.of(context).textTheme.bodyText1!.color,
shape: BoxShape.circle,
),
padding: Dimens.edgeInsets8,
child: Text(
index,
style: AppStyles.style16Bold.copyWith(
color: Theme.of(context).scaffoldBackgroundColor,
),
),
),
Dimens.boxHeight8,
Text(
title,
style: AppStyles.style18Bold,
Expand Down
Loading

0 comments on commit 6bb2083

Please sign in to comment.