diff --git a/assets/svgs/change_language_icon.svg b/assets/svgs/change_language_icon.svg
new file mode 100644
index 0000000..99b4d15
--- /dev/null
+++ b/assets/svgs/change_language_icon.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/svgs/change_password_icon.svg b/assets/svgs/change_password_icon.svg
new file mode 100644
index 0000000..0e8ff3f
--- /dev/null
+++ b/assets/svgs/change_password_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/svgs/help_icon.svg b/assets/svgs/help_icon.svg
new file mode 100644
index 0000000..d0ca6bf
--- /dev/null
+++ b/assets/svgs/help_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/svgs/lock_settings_icon.svg b/assets/svgs/lock_settings_icon.svg
new file mode 100644
index 0000000..8fdb55f
--- /dev/null
+++ b/assets/svgs/lock_settings_icon.svg
@@ -0,0 +1,10 @@
+
diff --git a/assets/svgs/logout_icon.svg b/assets/svgs/logout_icon.svg
new file mode 100644
index 0000000..0b323cc
--- /dev/null
+++ b/assets/svgs/logout_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/svgs/security_warning_icon.svg b/assets/svgs/security_warning_icon.svg
new file mode 100644
index 0000000..6f27036
--- /dev/null
+++ b/assets/svgs/security_warning_icon.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/translations/en.json b/assets/translations/en.json
index 4d38970..01e57c9 100644
--- a/assets/translations/en.json
+++ b/assets/translations/en.json
@@ -96,7 +96,7 @@
"Logout": "Logout",
"PrivacyPolicy": "Privacy Policy",
"EditProfile": "Edit Profile",
- "AreYouSureToCloseTheApplication": "Are you sure to close the \napplication?",
+ "AreYouSureToCloseTheApplication": "Are You Sure To Close The \nApplication?",
"Yes": "Yes",
"No": "No",
"TapToEdit": "tap to edit",
diff --git a/lib/core/assets/app_icons.dart b/lib/core/assets/app_icons.dart
index 4a4d76c..5cd48d9 100644
--- a/lib/core/assets/app_icons.dart
+++ b/lib/core/assets/app_icons.dart
@@ -1,5 +1,6 @@
class AppIcons {
AppIcons._();
+
static const String fitnessOne = 'assets/svgs/fitness_1.svg';
static const String fitnessTwo = 'assets/svgs/fitness_2.svg';
static const String fitnessThree = 'assets/svgs/fitness_3.svg';
@@ -38,4 +39,13 @@ class AppIcons {
static const String profileIcon = 'assets/svgs/profile_icon.svg';
static const String chatIcon = 'assets/svgs/chat_icon.svg';
static const String workoutIcon = 'assets/svgs/workout_icon.svg';
+ static const String changePasswordIcon =
+ 'assets/svgs/change_password_icon.svg';
+ static const String logoutIcon = 'assets/svgs/logout_icon.svg';
+ static const String helpIcon = 'assets/svgs/help_icon.svg';
+ static const String lockSettingsIcon = 'assets/svgs/lock_settings_icon.svg';
+ static const String securityWarningIcon =
+ 'assets/svgs/security_warning_icon.svg';
+ static const String changeLanguageIcon =
+ 'assets/svgs/change_language_icon.svg';
}
diff --git a/lib/core/utils/di/di.config.dart b/lib/core/utils/di/di.config.dart
index 44435b9..95ae64e 100644
--- a/lib/core/utils/di/di.config.dart
+++ b/lib/core/utils/di/di.config.dart
@@ -37,8 +37,11 @@ import '../../../data/home/data_source/remote/home_remote_data_source_impl.dart'
import '../../../data/home/repo_impl/home_repo_impl.dart' as _i779;
import '../../../domain/auth/repo/auth_repo.dart' as _i1047;
import '../../../domain/auth/use_case/forget_password_use_case.dart' as _i728;
+import '../../../domain/auth/use_case/get_profile_data_use_case.dart' as _i336;
+import '../../../domain/auth/use_case/logout_use_case.dart' as _i1046;
import '../../../domain/auth/use_case/otp_verification_use_case.dart' as _i777;
import '../../../domain/auth/use_case/reset_password_use_case.dart' as _i55;
+import '../../../domain/auth/use_case/select_language_use_case.dart' as _i753;
import '../../../domain/home/repo/home_repo.dart' as _i81;
import '../../../domain/home/use_case/get_all_muscles_use_case.dart' as _i840;
import '../../../domain/home/use_case/get_daily_recommendation_exercise_use_case.dart'
@@ -59,6 +62,8 @@ import '../../../features/onBoarding/presentation/view_model/cubit/on_boarding_c
as _i485;
import '../../../features/otp_verification/presentation/view_model/cubit/otp_verification_cubit.dart'
as _i662;
+import '../../../features/profile/presentation/view_model/profile_cubit.dart'
+ as _i782;
import '../../../features/reset_password/presentation/view_model/cubit/reset_password_cubit.dart'
as _i893;
import '../../functions/inital_route_function.dart' as _i420;
@@ -97,15 +102,18 @@ extension GetItInjectableX on _i174.GetIt {
gh.singleton<_i649.BlocObserverService>(
() => _i649.BlocObserverService(gh<_i974.Logger>()),
);
- gh.factory<_i1063.AuthLocalDataSource>(
- () => _i757.AuthLocalDataSourceImpl(gh<_i558.FlutterSecureStorage>()),
- );
gh.factory<_i420.RouteInitializer>(
() => _i420.RouteInitializer(
flutterSecureStorage: gh<_i558.FlutterSecureStorage>(),
sharedPreferences: gh<_i460.SharedPreferences>(),
),
);
+ gh.factory<_i1063.AuthLocalDataSource>(
+ () => _i757.AuthLocalDataSourceImpl(
+ gh<_i460.SharedPreferences>(),
+ gh<_i558.FlutterSecureStorage>(),
+ ),
+ );
gh.factory<_i368.HomeLocalDataSource>(
() => _i410.HomeLocalDataSourceImpl(),
);
@@ -127,10 +135,28 @@ extension GetItInjectableX on _i174.GetIt {
gh.factory<_i1047.AuthRepo>(
() => _i15.AuthRepoImpl(
gh<_i28.ApiManager>(),
- gh<_i774.AuthRemoteDataSource>(),
gh<_i1063.AuthLocalDataSource>(),
+ gh<_i774.AuthRemoteDataSource>(),
),
);
+ gh.factory<_i728.ForgetPasswordUseCase>(
+ () => _i728.ForgetPasswordUseCase(gh<_i1047.AuthRepo>()),
+ );
+ gh.factory<_i336.GetProfileDataUseCase>(
+ () => _i336.GetProfileDataUseCase(gh<_i1047.AuthRepo>()),
+ );
+ gh.factory<_i1046.LogoutUseCase>(
+ () => _i1046.LogoutUseCase(gh<_i1047.AuthRepo>()),
+ );
+ gh.factory<_i777.OtpVerificationUseCase>(
+ () => _i777.OtpVerificationUseCase(gh<_i1047.AuthRepo>()),
+ );
+ gh.factory<_i55.ResetPasswordUseCase>(
+ () => _i55.ResetPasswordUseCase(gh<_i1047.AuthRepo>()),
+ );
+ gh.factory<_i753.SelectLanguageUseCase>(
+ () => _i753.SelectLanguageUseCase(gh<_i1047.AuthRepo>()),
+ );
gh.factory<_i81.HomeRepo>(
() => _i779.HomeRepoImpl(
gh<_i958.HomeRemoteDataSource>(),
@@ -138,14 +164,30 @@ extension GetItInjectableX on _i174.GetIt {
gh<_i28.ApiManager>(),
),
);
- gh.factory<_i728.ForgetPasswordUseCase>(
- () => _i728.ForgetPasswordUseCase(gh<_i1047.AuthRepo>()),
+ gh.factory<_i782.ProfileCubit>(
+ () => _i782.ProfileCubit(
+ gh<_i336.GetProfileDataUseCase>(),
+ gh<_i1046.LogoutUseCase>(),
+ gh<_i753.SelectLanguageUseCase>(),
+ ),
);
- gh.factory<_i777.OtpVerificationUseCase>(
- () => _i777.OtpVerificationUseCase(gh<_i1047.AuthRepo>()),
+ gh.factory<_i662.OtpVerificationCubit>(
+ () => _i662.OtpVerificationCubit(
+ gh<_i777.OtpVerificationUseCase>(),
+ gh<_i728.ForgetPasswordUseCase>(),
+ ),
);
- gh.factory<_i55.ResetPasswordUseCase>(
- () => _i55.ResetPasswordUseCase(gh<_i1047.AuthRepo>()),
+ gh.factory<_i893.ResetPasswordCubit>(
+ () => _i893.ResetPasswordCubit(
+ gh<_i55.ResetPasswordUseCase>(),
+ gh<_i468.Validator>(),
+ ),
+ );
+ gh.factory<_i70.ForgetPasswordCubit>(
+ () => _i70.ForgetPasswordCubit(
+ gh<_i728.ForgetPasswordUseCase>(),
+ gh<_i468.Validator>(),
+ ),
);
gh.factory<_i840.GetAllMusclesUseCase>(
() => _i840.GetAllMusclesUseCase(gh<_i81.HomeRepo>()),
@@ -171,24 +213,6 @@ extension GetItInjectableX on _i174.GetIt {
gh<_i840.GetAllMusclesUseCase>(),
),
);
- gh.factory<_i662.OtpVerificationCubit>(
- () => _i662.OtpVerificationCubit(
- gh<_i777.OtpVerificationUseCase>(),
- gh<_i728.ForgetPasswordUseCase>(),
- ),
- );
- gh.factory<_i893.ResetPasswordCubit>(
- () => _i893.ResetPasswordCubit(
- gh<_i55.ResetPasswordUseCase>(),
- gh<_i468.Validator>(),
- ),
- );
- gh.factory<_i70.ForgetPasswordCubit>(
- () => _i70.ForgetPasswordCubit(
- gh<_i728.ForgetPasswordUseCase>(),
- gh<_i468.Validator>(),
- ),
- );
return this;
}
}
diff --git a/lib/core/utils/dialogs/app_dialogs.dart b/lib/core/utils/dialogs/app_dialogs.dart
index 2513b0d..2d0808d 100644
--- a/lib/core/utils/dialogs/app_dialogs.dart
+++ b/lib/core/utils/dialogs/app_dialogs.dart
@@ -191,4 +191,77 @@ class AppDialogs {
),
);
}
+
+ // Show a confirmation dialog
+ static Future showConfirmationDialog(
+ BuildContext context, {
+ required String message,
+ String? description,
+ String? firstButtonText,
+ String? secondButtonText,
+ VoidCallback? firstButtonAction,
+ VoidCallback? secondButtonAction,
+ }) async {
+ await showDialog(
+ context: context,
+ builder: (context) => AlertDialog(
+ backgroundColor: AppColors.darkgrey,
+ titlePadding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0),
+ actionsPadding: const EdgeInsets.all(16.0),
+ titleTextStyle: Theme.of(context).textTheme.titleLarge?.copyWith(
+ fontWeight: FontWeight.w600,
+ fontSize: 20,
+ ),
+ content: description != null
+ ? Text(description, textAlign: TextAlign.center, maxLines: 2)
+ : null,
+ contentPadding: const EdgeInsets.only(
+ left: 55,
+ right: 55,
+ top: 20,
+ bottom: 35,
+ ),
+ contentTextStyle: Theme.of(context).textTheme.bodyLarge?.copyWith(
+ color: AppColors.white[AppColors.colorCode40],
+ fontWeight: FontWeight.w500,
+ ),
+ actions: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ if (firstButtonText != null)
+ ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: AppColors.darkgrey,
+ side: const BorderSide(color: AppColors.orange),
+ ),
+ onPressed: firstButtonAction ?? () => Navigator.pop(context),
+ child: Text(
+ firstButtonText,
+ style: Theme.of(context).textTheme.titleMedium?.copyWith(
+ fontWeight: FontWeight.w800,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: AppColors.orange,
+ ),
+ onPressed: secondButtonAction ?? () => Navigator.pop(context),
+ child: Text(
+ secondButtonText ?? LocaleKeys.Ok.tr(),
+ style: Theme.of(context).textTheme.titleMedium?.copyWith(
+ fontWeight: FontWeight.w800,
+ fontSize: 14,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ title: Text(message, textAlign: TextAlign.center),
+ ),
+ );
+ }
}
diff --git a/lib/core/utils/l10n/locale_keys.g.dart b/lib/core/utils/l10n/locale_keys.g.dart
index 50df9ae..bd81035 100644
--- a/lib/core/utils/l10n/locale_keys.g.dart
+++ b/lib/core/utils/l10n/locale_keys.g.dart
@@ -2,7 +2,7 @@
// ignore_for_file: constant_identifier_names
-abstract class LocaleKeys {
+abstract class LocaleKeys {
static const InvalidCredentials = 'InvalidCredentials';
static const Receive_timeout = 'Receive_timeout';
static const Timeout_occurred = 'Timeout_occurred';
@@ -23,10 +23,8 @@ abstract class LocaleKeys {
static const Service_unavailable = 'Service_unavailable';
static const DataParsingException = 'DataParsingException';
static const OtpCodeIsInvalidOrExpired = 'OtpCodeIsInvalidOrExpired';
- static const ThePriceOfExcellenceIsDiscipline =
- 'ThePriceOfExcellenceIsDiscipline';
- static const LoremIpsumDolorSitAmetConsecteturEuUrnaUtGravidaQuisIdPretiumPurusMaurIsMassa =
- 'LoremIpsumDolorSitAmetConsecteturEuUrnaUtGravidaQuisIdPretiumPurusMaurIsMassa';
+ static const ThePriceOfExcellenceIsDiscipline = 'ThePriceOfExcellenceIsDiscipline';
+ static const LoremIpsumDolorSitAmetConsecteturEuUrnaUtGravidaQuisIdPretiumPurusMaurIsMassa = 'LoremIpsumDolorSitAmetConsecteturEuUrnaUtGravidaQuisIdPretiumPurusMaurIsMassa';
static const FitnessHasNeverBeenSoMuchFun = 'FitnessHasNeverBeenSoMuchFun';
static const NOMOREEXCUSESDoItNow = 'NOMOREEXCUSESDoItNow';
static const Back = 'Back';
@@ -45,17 +43,14 @@ abstract class LocaleKeys {
static const FirstName = 'FirstName';
static const LastName = 'LastName';
static const AlreadyHaveAnAccount = 'AlreadyHaveAnAccount';
- static const TellUsAboutYourselfWeNeedToKnowYourGender =
- 'TellUsAboutYourselfWeNeedToKnowYourGender';
+ static const TellUsAboutYourselfWeNeedToKnowYourGender = 'TellUsAboutYourselfWeNeedToKnowYourGender';
static const Male = 'Male';
static const Female = 'Female';
static const Year = 'Year';
- static const HowOldAreYouThisHelpsUsCreateYourPersonalizedPlan =
- 'HowOldAreYouThisHelpsUsCreateYourPersonalizedPlan';
+ static const HowOldAreYouThisHelpsUsCreateYourPersonalizedPlan = 'HowOldAreYouThisHelpsUsCreateYourPersonalizedPlan';
static const Done = 'Done';
static const WhatIsYourWeight = 'WhatIsYourWeight';
- static const ThisHelpsUsCreateYourPersonalizedPlan =
- 'ThisHelpsUsCreateYourPersonalizedPlan';
+ static const ThisHelpsUsCreateYourPersonalizedPlan = 'ThisHelpsUsCreateYourPersonalizedPlan';
static const WhatIsYourHight = 'WhatIsYourHight';
static const whatIsYourGoal = 'whatIsYourGoal';
static const GainWeight = 'GainWeight';
@@ -68,8 +63,7 @@ abstract class LocaleKeys {
static const Intermediate = 'Intermediate';
static const Advanced = 'Advanced';
static const TrueBeast = 'TrueBeast';
- static const YourRegularPhysicalActivityLevel =
- 'YourRegularPhysicalActivityLevel';
+ static const YourRegularPhysicalActivityLevel = 'YourRegularPhysicalActivityLevel';
static const EnterYourEmail = 'EnterYourEmail';
static const EnterYourPassword = 'EnterYourPassword';
static const SendOTP = 'SendOTP';
@@ -104,8 +98,7 @@ abstract class LocaleKeys {
static const Logout = 'Logout';
static const PrivacyPolicy = 'PrivacyPolicy';
static const EditProfile = 'EditProfile';
- static const AreYouSureToCloseTheApplication =
- 'AreYouSureToCloseTheApplication';
+ static const AreYouSureToCloseTheApplication = 'AreYouSureToCloseTheApplication';
static const Yes = 'Yes';
static const No = 'No';
static const TapToEdit = 'TapToEdit';
@@ -122,8 +115,7 @@ abstract class LocaleKeys {
static const PasswordCannotBeEmpty = 'PasswordCannotBeEmpty';
static const InvalidPassword = 'InvalidPassword';
static const InvalidEmailFormat = 'InvalidEmailFormat';
- static const PasswordMustBeAtLeast8Characters =
- 'PasswordMustBeAtLeast8Characters';
+ static const PasswordMustBeAtLeast8Characters = 'PasswordMustBeAtLeast8Characters';
static const NameCannotBeEmpty = 'NameCannotBeEmpty';
static const InvalidName = 'InvalidName';
static const EnterAValidEmail = 'EnterAValidEmail';
@@ -138,9 +130,9 @@ abstract class LocaleKeys {
static const ResetPasswordSuccessfully = 'ResetPasswordSuccessfully';
static const ConfirmPassword = 'ConfirmPassword';
static const OtpVerificationSuccessfully = 'OtpVerificationSuccessfully';
- static const SomethingWentWrongPleaseTryAgainLater =
- 'SomethingWentWrongPleaseTryAgainLater';
+ static const SomethingWentWrongPleaseTryAgainLater = 'SomethingWentWrongPleaseTryAgainLater';
static const Home = 'Home';
static const FitnessAI = 'FitnessAI';
static const DoIt = 'DoIt';
+
}
diff --git a/lib/core/utils/routes/app_routes.dart b/lib/core/utils/routes/app_routes.dart
index 21a772d..b24723a 100644
--- a/lib/core/utils/routes/app_routes.dart
+++ b/lib/core/utils/routes/app_routes.dart
@@ -9,7 +9,7 @@ import '../../../features/home/presentation/view/home_screen.dart';
import '../../../features/chat_bot/presentation/view/chat_bot_screen.dart';
import '../../../features/main_layout/presentation/view/main_layout_screen.dart';
-import '../../../features/profile/presentation/view/profile_screen.dart';
+import '../../../features/profile/presentation/view/screens/profile_screen.dart';
import '../../../features/workouts/presentation/view/workouts_screen.dart';
class AppRoutes {
@@ -23,17 +23,17 @@ class AppRoutes {
static const String profileRoute = '/profile';
static const String editProfileRoute = '/edit-profile';
static const String onBoardingRoute = '/on-boarding';
+ static const String workoutsRoute = '/workouts';
static const String otpVerificationRoute = '/otp-verification';
static const String resetPasswordRoute = '/reset-password';
- static const String workoutRoute = '/workout';
static const String chatBotRoute = 'chat-bot';
static Map routes = {
onBoardingRoute: (context) => const OnBoardingScreen(),
homeRoute: (context) => const HomeScreen(),
mainLayoutRoute: (context) => const MainLayoutScreen(),
- profileRoute: (context) => const ProfileScreen(),
- workoutRoute: (context) => const WorkoutsScreen(),
+ profileRoute: (context) => ProfileScreen(),
+ workoutsRoute: (context) => const WorkoutsScreen(),
chatBotRoute: (context) => const ChatBotScreen(),
forgetPasswordRoute: (context) => const ForgetPasswordScreen(),
otpVerificationRoute: (context) {
diff --git a/lib/core/utils/shared_widgets/blured_container.dart b/lib/core/utils/shared_widgets/blured_container.dart
index 0a6acc7..aa4868d 100644
--- a/lib/core/utils/shared_widgets/blured_container.dart
+++ b/lib/core/utils/shared_widgets/blured_container.dart
@@ -1,12 +1,14 @@
import 'dart:ui';
-import 'package:fitness_app/core/assets/app_colors.dart';
import 'package:flutter/material.dart';
+import '../../assets/app_colors.dart';
+
class BluredContainer extends StatelessWidget {
- const BluredContainer({super.key, required this.child});
+ const BluredContainer({super.key, required this.child, this.padding});
final Widget child;
+ final EdgeInsets? padding;
@override
Widget build(BuildContext context) {
@@ -15,8 +17,10 @@ class BluredContainer extends StatelessWidget {
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
child: AnimatedContainer(
- padding: const EdgeInsets.symmetric(vertical: 24, horizontal: 16),
- color: AppColors.containerBackGround,
+ padding:
+ padding ??
+ const EdgeInsets.symmetric(vertical: 24, horizontal: 16),
+ color: AppColors.darkgrey.withAlpha(150),
duration: const Duration(milliseconds: 3000),
child: child,
),
diff --git a/lib/data/auth/api/auth_retrofit_client.dart b/lib/data/auth/api/auth_retrofit_client.dart
index 941f07f..1698207 100644
--- a/lib/data/auth/api/auth_retrofit_client.dart
+++ b/lib/data/auth/api/auth_retrofit_client.dart
@@ -1,4 +1,6 @@
import 'package:dio/dio.dart';
+import 'package:fitness_app/data/auth/models/logout_response_dto.dart';
+import 'package:fitness_app/data/auth/models/user_data_response_dto.dart';
import 'package:injectable/injectable.dart';
import 'package:retrofit/retrofit.dart';
@@ -18,6 +20,12 @@ abstract class AuthRetrofitClient {
@factoryMethod
factory AuthRetrofitClient(Dio dio) = _AuthRetrofitClient;
+ @GET(ApiConstants.logoutRoute)
+ Future logout();
+
+ @GET(ApiConstants.profileDataRoute)
+ Future getProfileData();
+
@POST(ApiConstants.forgetPasswordRoute)
Future forgetPassword(
@Body() ForgetPasswordRequestDto request,
diff --git a/lib/data/auth/api/auth_retrofit_client.g.dart b/lib/data/auth/api/auth_retrofit_client.g.dart
index 92a048e..a56799e 100644
--- a/lib/data/auth/api/auth_retrofit_client.g.dart
+++ b/lib/data/auth/api/auth_retrofit_client.g.dart
@@ -19,6 +19,60 @@ class _AuthRetrofitClient implements AuthRetrofitClient {
final ParseErrorLogger? errorLogger;
+ @override
+ Future logout() async {
+ final _extra = {};
+ final queryParameters = {};
+ final _headers = {};
+ const Map? _data = null;
+ final _options = _setStreamType(
+ Options(method: 'GET', headers: _headers, extra: _extra)
+ .compose(
+ _dio.options,
+ 'auth/logout',
+ queryParameters: queryParameters,
+ data: _data,
+ )
+ .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
+ );
+ final _result = await _dio.fetch