Skip to content

Commit

Permalink
updated to version 1.0.1+01
Browse files Browse the repository at this point in the history
  • Loading branch information
nixrajput committed Oct 1, 2022
1 parent 395c822 commit 5e6f004
Show file tree
Hide file tree
Showing 20 changed files with 855 additions and 676 deletions.
3 changes: 3 additions & 0 deletions lib/apis/services/auth_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class AuthService extends GetxService {
setAuthToken = decodedData[StringValues.token];
token = decodedData[StringValues.token];
await getDeviceId();
await getChannelInfo();
}
return token;
}
Expand All @@ -56,6 +57,8 @@ class AuthService extends GetxService {
setChannelId = decodedData[StringValues.channelId];
setAgoraUid = decodedData[StringValues.agoraUid].toString();
}
AppUtility.printLog("channelId: $_channelId");
AppUtility.printLog("agoraUid: $_agoraUid");
}

String generateDeviceId() {
Expand Down
8 changes: 4 additions & 4 deletions lib/common/primary_filled_btn.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:video_calling_app/constants/colors.dart';
import 'package:video_calling_app/constants/dimens.dart';
import 'package:video_calling_app/constants/styles.dart';

Expand Down Expand Up @@ -42,8 +43,8 @@ class NxFilledButton extends StatelessWidget {
padding: padding,
constraints: BoxConstraints(maxWidth: Dimens.screenWidth),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius ?? Dimens.eight),
color: bgColor ?? Theme.of(context).textTheme.bodyText1!.color,
borderRadius: BorderRadius.circular(borderRadius ?? Dimens.four),
color: bgColor ?? ColorValues.primaryColor,
),
child: Row(
mainAxisSize: MainAxisSize.min,
Expand All @@ -55,8 +56,7 @@ class NxFilledButton extends StatelessWidget {
label,
style: labelStyle ??
AppStyles.style16Bold.copyWith(
color:
labelColor ?? Theme.of(context).scaffoldBackgroundColor,
color: labelColor ?? ColorValues.whiteColor,
fontSize: fontSize ?? Dimens.sixTeen,
),
),
Expand Down
10 changes: 5 additions & 5 deletions lib/common/primary_outlined_btn.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:video_calling_app/constants/colors.dart';
import 'package:video_calling_app/constants/dimens.dart';
import 'package:video_calling_app/constants/styles.dart';

Expand Down Expand Up @@ -54,11 +55,11 @@ class NxOutlinedButton extends StatelessWidget {
),
decoration: BoxDecoration(
border: Border.all(
color: borderColor ?? Theme.of(context).textTheme.bodyText1!.color!,
width: borderWidth ?? Dimens.one * 1.5,
color: borderColor ?? ColorValues.primaryColor,
width: borderWidth ?? Dimens.two,
style: borderStyle ?? BorderStyle.solid,
),
borderRadius: BorderRadius.circular(borderRadius ?? Dimens.eight),
borderRadius: BorderRadius.circular(borderRadius ?? Dimens.four),
color: bgColor ?? Colors.transparent,
),
child: Row(
Expand All @@ -72,8 +73,7 @@ class NxOutlinedButton extends StatelessWidget {
label,
style: labelStyle ??
AppStyles.style16Bold.copyWith(
color: labelColor ??
Theme.of(context).textTheme.bodyText1!.color,
color: labelColor ?? ColorValues.primaryColor,
fontSize: fontSize ?? Dimens.sixTeen,
),
),
Expand Down
13 changes: 7 additions & 6 deletions lib/helpers/utility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@ abstract class AppUtility {
Get.showSnackbar(
GetSnackBar(
margin: EdgeInsets.only(
top: Dimens.sixTeen,
left: Dimens.sixTeen,
right: Dimens.sixTeen,
bottom: Dimens.thirtyTwo,
),
borderRadius: Dimens.four,
padding: Dimens.edgeInsets16,
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.TOP,
messageText: Text(
message,
style: TextStyle(
Expand All @@ -181,7 +182,7 @@ abstract class AppUtility {
),
shouldIconPulse: false,
backgroundColor: Theme.of(Get.context!).snackBarTheme.backgroundColor!,
duration: Duration(seconds: duration ?? 1),
duration: Duration(seconds: duration ?? 2),
),
);
}
Expand All @@ -207,8 +208,8 @@ abstract class AppUtility {
}
}

static Future<void> saveLoginDataToLocalStorage(token, expiresAt) async {
if (token!.isNotEmpty && expiresAt!.isNotEmpty) {
static Future<void> saveLoginDataToLocalStorage(token, int expiresAt) async {
if (token!.isNotEmpty && expiresAt > 0) {
final data = jsonEncode({
StringValues.token: token,
StringValues.expiresAt: expiresAt,
Expand Down Expand Up @@ -347,8 +348,8 @@ abstract class AppUtility {
}

/// Generates a random string of [length] with only numeric characters.
static String randomNumeric(int length) =>
randomString(length, from: numericStart, to: numericEnd);
static int randomNumeric(int length) =>
int.parse(randomString(length, from: numericStart, to: numericEnd));

static int randomIntNumeric(int length) =>
int.parse(randomString(length, from: numericStart, to: numericEnd));
Expand Down
3 changes: 2 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Future<void> initServices() async {
Get
..put(AppThemeController(), permanent: true)
..put(AuthService(), permanent: true)
..put(ProfileController(), permanent: true);
..put(ProfileController(), permanent: true)
..put(AppUpdateController(), permanent: true);

serverHealth = await Get.find<AuthService>().checkServerHealth();
AppUtility.printLog("ServerHealth: $serverHealth");
Expand Down
33 changes: 11 additions & 22 deletions lib/modules/auth/views/forgot_password_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ForgotPasswordView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Dimens.boxHeight8,
Dimens.boxHeight16,
_buildImageHeader(),
Dimens.boxHeight16,
_buildForgotPasswordFields(),
Expand Down Expand Up @@ -72,16 +72,16 @@ class ForgotPasswordView extends StatelessWidget {
children: [
Text(
StringValues.forgotPassword,
style: AppStyles.style24Bold,
style: AppStyles.style32Bold,
),
Dimens.boxHeight16,
Dimens.boxHeight8,
Text(
'We will send an OTP on this email address.',
style: AppStyles.style14Normal.copyWith(
color: ColorValues.darkGrayColor,
),
),
Dimens.boxHeight16,
Dimens.boxHeight32,
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder(),
Expand All @@ -92,7 +92,7 @@ class ForgotPasswordView extends StatelessWidget {
),
keyboardType: TextInputType.emailAddress,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -101,6 +101,11 @@ class ForgotPasswordView extends StatelessWidget {
controller: logic.emailTextController,
onEditingComplete: logic.focusNode.unfocus,
),
Dimens.boxHeight32,
const NxTextButton(
label: StringValues.loginToAccount,
onTap: RouteManagement.goToLoginView,
),
Dimens.boxHeight16,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
Expand All @@ -118,22 +123,6 @@ class ForgotPasswordView extends StatelessWidget {
],
),
Dimens.boxHeight16,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
StringValues.alreadyHaveAccount,
style: AppStyles.style16Normal,
),
Dimens.boxWidth4,
const NxTextButton(
label: StringValues.login,
onTap: RouteManagement.goToLoginView,
),
],
),
Dimens.boxHeight16,
],
),
),
Expand All @@ -145,7 +134,7 @@ class ForgotPasswordView extends StatelessWidget {
right: 0,
child: NxFilledButton(
onTap: () => logic.sendResetPasswordOTP(),
label: StringValues.getOtp,
label: StringValues.getOtp.toUpperCase(),
fontSize: Dimens.sixTeen,
borderRadius: 0.0,
),
Expand Down
16 changes: 8 additions & 8 deletions lib/modules/auth/views/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LoginView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Dimens.boxHeight8,
Dimens.boxHeight16,
_buildImageHeader(),
Dimens.boxHeight16,
_buildLoginFields(),
Expand Down Expand Up @@ -73,9 +73,9 @@ class LoginView extends StatelessWidget {
children: [
Text(
StringValues.login,
style: AppStyles.style24Bold,
style: AppStyles.style32Bold,
),
Dimens.boxHeight16,
Dimens.boxHeight32,
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder(),
Expand All @@ -86,7 +86,7 @@ class LoginView extends StatelessWidget {
),
keyboardType: TextInputType.emailAddress,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -95,7 +95,7 @@ class LoginView extends StatelessWidget {
controller: logic.emailUnameTextController,
onEditingComplete: logic.focusNode.nextFocus,
),
Dimens.boxHeight24,
Dimens.boxHeight16,
TextFormField(
obscureText: logic.showPassword,
decoration: InputDecoration(
Expand All @@ -115,7 +115,7 @@ class LoginView extends StatelessWidget {
),
keyboardType: TextInputType.visiblePassword,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -124,7 +124,7 @@ class LoginView extends StatelessWidget {
controller: logic.passwordTextController,
onEditingComplete: logic.focusNode.unfocus,
),
Dimens.boxHeight16,
Dimens.boxHeight32,
const NxTextButton(
label: StringValues.forgotPassword,
onTap: RouteManagement.goToForgotPasswordView,
Expand Down Expand Up @@ -162,7 +162,7 @@ class LoginView extends StatelessWidget {
right: 0,
child: NxFilledButton(
onTap: () => logic.login(),
label: StringValues.login,
label: StringValues.login.toUpperCase(),
fontSize: Dimens.sixTeen,
borderRadius: 0.0,
),
Expand Down
24 changes: 12 additions & 12 deletions lib/modules/auth/views/register_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RegisterView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Dimens.boxHeight8,
Dimens.boxHeight16,
_buildImageHeader(),
Dimens.boxHeight16,
_buildRegistrationFields(),
Expand Down Expand Up @@ -76,7 +76,7 @@ class RegisterView extends StatelessWidget {
StringValues.register,
style: AppStyles.style24Bold,
),
Dimens.boxHeight16,
Dimens.boxHeight32,
Row(
children: [
Expanded(
Expand All @@ -90,7 +90,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.name,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -112,7 +112,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.name,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -124,7 +124,7 @@ class RegisterView extends StatelessWidget {
),
],
),
Dimens.boxHeight24,
Dimens.boxHeight16,
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder(),
Expand All @@ -135,7 +135,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.emailAddress,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -144,7 +144,7 @@ class RegisterView extends StatelessWidget {
controller: logic.emailTextController,
onEditingComplete: logic.focusNode.nextFocus,
),
Dimens.boxHeight24,
Dimens.boxHeight16,
TextFormField(
decoration: const InputDecoration(
border: OutlineInputBorder(),
Expand All @@ -155,7 +155,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.text,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand Down Expand Up @@ -184,7 +184,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.visiblePassword,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand Down Expand Up @@ -213,7 +213,7 @@ class RegisterView extends StatelessWidget {
),
keyboardType: TextInputType.visiblePassword,
maxLines: 1,
style: AppStyles.style16Normal.copyWith(
style: AppStyles.style14Normal.copyWith(
color: Theme.of(Get.context!)
.textTheme
.bodyText1!
Expand All @@ -222,7 +222,7 @@ class RegisterView extends StatelessWidget {
controller: logic.confirmPasswordTextController,
onEditingComplete: logic.focusNode.unfocus,
),
Dimens.boxHeight16,
Dimens.boxHeight32,
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
Expand Down Expand Up @@ -250,7 +250,7 @@ class RegisterView extends StatelessWidget {
right: 0,
child: NxFilledButton(
onTap: () => logic.register(),
label: StringValues.register,
label: StringValues.register.toUpperCase(),
fontSize: Dimens.sixTeen,
borderRadius: 0.0,
),
Expand Down
Loading

0 comments on commit 5e6f004

Please sign in to comment.