From ca296040f2e7e821f9b2911e95b7886308f5a631 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Wed, 18 Jun 2025 09:55:33 +0300 Subject: [PATCH] fix: Issue-514 and Issue-497 --- .../repositories/service_repository.dart | 32 +++++++++++++++++++ .../settings/services/settings_service.dart | 10 ++++++ .../presentation/update_screen.dart | 2 ++ .../presentation/pages/welcome_screen.dart | 2 ++ 4 files changed, 46 insertions(+) diff --git a/lib/features/settings/repositories/service_repository.dart b/lib/features/settings/repositories/service_repository.dart index eb462de3..e1e71f09 100644 --- a/lib/features/settings/repositories/service_repository.dart +++ b/lib/features/settings/repositories/service_repository.dart @@ -38,4 +38,36 @@ class SettingsRepository { rethrow; } } + + Future sendEmailCodeForPasswordChange(String email) async { + try { + return await settingsService.sendEmailCodeForPasswordChange( + data: { + 'email': email, + }, + ); + } catch (e) { + rethrow; + } + } + + Future confirmPasswordChange( + String code, + String password, + String passwordConfirmation, + String email, + ) async { + try { + return await settingsService.confirmPasswordChange( + data: { + 'code': code, + 'password': password, + 'password_confirmation': passwordConfirmation, + 'email': email, + }, + ); + } catch (e) { + rethrow; + } + } } diff --git a/lib/features/settings/services/settings_service.dart b/lib/features/settings/services/settings_service.dart index d17b5842..e4cdb6b7 100644 --- a/lib/features/settings/services/settings_service.dart +++ b/lib/features/settings/services/settings_service.dart @@ -21,4 +21,14 @@ abstract class SettingsService { Future updateProfileDetails({ @Body() required Map data, }); + + @POST('/api/send_password_reset_code') + Future sendEmailCodeForPasswordChange({ + @Body() required Map data, + }); + + @POST('/api/confirm_password_reset_code') + Future confirmPasswordChange({ + @Body() required Map data, + }); } diff --git a/lib/features/update_screen/presentation/update_screen.dart b/lib/features/update_screen/presentation/update_screen.dart index 99e9e880..186987c2 100644 --- a/lib/features/update_screen/presentation/update_screen.dart +++ b/lib/features/update_screen/presentation/update_screen.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -11,6 +12,7 @@ class UpdateScreen extends StatelessWidget { @override Widget build(BuildContext context) { + FlutterNativeSplash.remove(); return Scaffold( body: Stack( clipBehavior: Clip.none, diff --git a/lib/features/welcome/presentation/pages/welcome_screen.dart b/lib/features/welcome/presentation/pages/welcome_screen.dart index 70a5904e..25922a10 100644 --- a/lib/features/welcome/presentation/pages/welcome_screen.dart +++ b/lib/features/welcome/presentation/pages/welcome_screen.dart @@ -4,6 +4,7 @@ import 'package:go_router/go_router.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../../../../core/theme/theme_helper.dart'; +import 'package:flutter_native_splash/flutter_native_splash.dart'; class WelcomeScreen extends StatefulWidget { const WelcomeScreen({super.key}); @@ -23,6 +24,7 @@ class _WelcomeScreenState extends State { @override Widget build(BuildContext context) { + FlutterNativeSplash.remove(); return Scaffold( body: Stack( clipBehavior: Clip.none,