diff --git a/front/lib/app/config/routes.dart b/front/lib/app/config/routes.dart index c2a7f1a..465e6ed 100644 --- a/front/lib/app/config/routes.dart +++ b/front/lib/app/config/routes.dart @@ -7,11 +7,9 @@ import 'package:front/features/team/presentation/pages/team/team_create.dart'; import 'package:front/features/team/presentation/pages/team/team_datail.dart'; import 'package:front/features/team/presentation/pages/team/teams_list.dart'; import 'package:front/features/user/presentation/component/change_info_list.dart'; -import 'package:front/features/user/presentation/screens/email_singin.dart'; -import 'package:front/features/user/presentation/screens/login.dart'; -import 'package:front/features/user/presentation/screens/main_screen.dart'; + import 'package:front/features/user/presentation/screens/my_info_screen.dart'; -import 'package:front/features/user/presentation/screens/signin.dart'; + import 'package:front/features/user/presentation/screens/social_login_info_screen.dart'; import 'package:go_router/go_router.dart'; @@ -22,21 +20,8 @@ final router = GoRouter(initialLocation: '/', routes: [ name: 'example', builder: (context, state) => const FormDemoScreen2(), ), - GoRoute( - path: 'login', - name: 'login', - builder: (context, state) => const LoginScreen(), - ), - GoRoute( - path: 'signup', - name: 'signup', - builder: (context, state) => const SignInScreen(), - ), - GoRoute( - path: 'emailSignup', - name: 'emailSignup', - builder: (context, state) => const EmailSignInScreen(), - ), + + GoRoute( path: 'teamsList', name: 'teamsList', @@ -69,11 +54,7 @@ final router = GoRouter(initialLocation: '/', routes: [ name: 'projectUpdate', builder: (context, state) => ProjectUpdateScreen(), ), - GoRoute( - path: 'main', - name: 'main', - builder: (context, state) => const MainScreen(), - ), + ShellRoute( builder: (context, state, child) => ScaffoldWithMyInfo(child: child), routes: [ diff --git a/front/lib/core/network_handling/exceptions/exception_handler.dart b/front/lib/core/network_handling/exceptions/exception_handler.dart index 8b6633c..cdf8b41 100644 --- a/front/lib/core/network_handling/exceptions/exception_handler.dart +++ b/front/lib/core/network_handling/exceptions/exception_handler.dart @@ -1,10 +1,9 @@ - import 'package:front/core/network_handling/exceptions/custom_exception.dart'; class ExceptionHandler { static showToast(Exception e) { if (Exception is CustomException) { - final exception = e as CustomException; + var exception = e as CustomException; // ToastService.show(NormalToast(message: '${exception.message}')); } else { // ToastService.show(NormalToast(message: '$e')); diff --git a/front/lib/features/project/presentaion/component/project_manager_selector.dart b/front/lib/features/project/presentaion/component/project_manager_selector.dart index 6cbef0c..4dc6173 100644 --- a/front/lib/features/project/presentaion/component/project_manager_selector.dart +++ b/front/lib/features/project/presentaion/component/project_manager_selector.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:front/features/user/models/user.dart'; +import 'package:front/features/user/data/models/user.dart'; import 'package:front/features/team/presentation/pages/team/widgets/dialog.dart'; typedef VoidCallback = void Function(UserModel user); @@ -37,7 +37,7 @@ class ProjectManagerSelector extends StatelessWidget { backgroundColor: Colors.grey[300], child: const Text('⭐'), ), - Text(administrator.nickname ?? ''), + Text(administrator.nickName ?? ''), ], ); } @@ -87,7 +87,7 @@ class ProjectManagerSelector extends StatelessWidget { const SizedBox( width: 5, ), - Text(user.nickname ?? ''), + Text(user.nickName ?? ''), ], ), ), @@ -104,7 +104,7 @@ class ProjectManagerSelector extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Text('프로젝트 담당자 ${user.nickname}'), + Text('프로젝트 담당자 ${user.nickName}'), const Text('으로 변경하시겠습니까?'), const SizedBox(height: 16), Row( @@ -114,7 +114,7 @@ class ProjectManagerSelector extends StatelessWidget { onPressed: () { Navigator.pop(context); onChanged(user); - _showConfirmationDialog(user.nickname ?? '', context); + _showConfirmationDialog(user.nickName ?? '', context); }, child: const Text('확인'), ), diff --git a/front/lib/features/project/presentaion/screen/project_creation.dart b/front/lib/features/project/presentaion/screen/project_creation.dart index 40bca81..c910450 100644 --- a/front/lib/features/project/presentaion/screen/project_creation.dart +++ b/front/lib/features/project/presentaion/screen/project_creation.dart @@ -1,7 +1,7 @@ // ignore_for_file: public_member_api_docs, sort_constructors_first import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:front/features/user/models/user.dart'; +import 'package:front/features/user/data/models/user.dart'; import 'package:front/features/project/data/models/project_request.dart'; import 'package:front/features/project/presentaion/component/project_from.dart'; import 'package:front/features/project/presentaion/component/project_manager_selector.dart'; @@ -54,13 +54,13 @@ class _BodyState extends ConsumerState<_Body> { final _formKey = GlobalKey(); late CustomFormState? currentState; var manager = - UserModel(id: 1, nickname: 'user1', email: 'email', type: 'type'); + UserModel(id: 1, nickName: 'user1', email: 'email', type: 'type'); final List teamMembers = [ - UserModel(id: 1, email: 'email', nickname: 'user1', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user2', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user3', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user4', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user5', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user1', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user2', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user3', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user4', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user5', type: 'MEMBER'), ]; @override diff --git a/front/lib/features/project/presentaion/screen/project_update.dart b/front/lib/features/project/presentaion/screen/project_update.dart index 185ef13..dc317f4 100644 --- a/front/lib/features/project/presentaion/screen/project_update.dart +++ b/front/lib/features/project/presentaion/screen/project_update.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:front/core/const/enum.dart'; -import 'package:front/features/user/models/user.dart'; +import 'package:front/features/user/data/models/user.dart'; import 'package:front/features/project/data/models/project_request.dart'; import 'package:front/features/project/entities/project.dart'; import 'package:front/features/project/presentaion/component/project_from.dart'; @@ -66,13 +66,13 @@ class _BodyState extends ConsumerState<_Body> { final _formKey = GlobalKey(); late CustomFormState? currentState; var manager = - UserModel(id: 1, nickname: 'user1', email: 'email', type: 'type'); + UserModel(id: 1, nickName: 'user1', email: 'email', type: 'type'); final List teamMembers = [ - UserModel(id: 1, email: 'email', nickname: 'user1', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user2', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user3', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user4', type: 'MEMBER'), - UserModel(id: 1, email: 'email', nickname: 'user5', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user1', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user2', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user3', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user4', type: 'MEMBER'), + UserModel(id: 1, email: 'email', nickName: 'user5', type: 'MEMBER'), ]; @override diff --git a/front/lib/features/user/data/models/user.dart b/front/lib/features/user/data/models/user.dart index 0ff9ccc..94ba70f 100644 --- a/front/lib/features/user/data/models/user.dart +++ b/front/lib/features/user/data/models/user.dart @@ -23,7 +23,7 @@ class UserModel with _$UserModel { id: user.id, email: user.email, nickName: user.nickName, - imageUrl: user.imageUrl, + imageUrl: user.imageUrl, type: user.type, ); } } diff --git a/front/lib/features/user/presentation/screens/social_login_info_screen.dart b/front/lib/features/user/presentation/screens/social_login_info_screen.dart index ce42042..b101e59 100644 --- a/front/lib/features/user/presentation/screens/social_login_info_screen.dart +++ b/front/lib/features/user/presentation/screens/social_login_info_screen.dart @@ -12,13 +12,13 @@ class SocialLoginInfoScreen extends StatelessWidget { onPressed: () { context.push('/changeMyInfoList'); }, - child: Text('⚙ 개인정보 수정')), - Expanded( + child: const Text('⚙ 개인정보 수정')), + const Expanded( child: SizedBox(), ), Padding( padding: const EdgeInsets.all(80.0), - child: TextButton(onPressed: () {}, child: Text('로그아웃')), + child: TextButton(onPressed: () {}, child: const Text('로그아웃')), ) ], ); diff --git a/front/lib/features/user/usecase/auto_sign_in_check_usecase.dart b/front/lib/features/user/usecase/auto_sign_in_check_usecase.dart index e69de29..8857bcc 100644 --- a/front/lib/features/user/usecase/auto_sign_in_check_usecase.dart +++ b/front/lib/features/user/usecase/auto_sign_in_check_usecase.dart @@ -0,0 +1,11 @@ +import 'package:front/core/utils/result.dart'; +import 'package:front/features/user/repositories/user_repositories.dart'; + +final class AutoSignInCheckUseCase { + const AutoSignInCheckUseCase(this._userRepository); + final UserRepository _userRepository; + + Future> call() async { + return _userRepository.autoSignInCheck(); + } +} \ No newline at end of file diff --git a/front/lib/features/user/usecase/set_auto_sign_in_true.dart b/front/lib/features/user/usecase/set_auto_sign_in_true.dart index 1c90d58..aaf3f2d 100644 --- a/front/lib/features/user/usecase/set_auto_sign_in_true.dart +++ b/front/lib/features/user/usecase/set_auto_sign_in_true.dart @@ -1,11 +1,11 @@ import 'package:front/core/utils/result.dart'; import 'package:front/features/user/repositories/user_repositories.dart'; -final class SetAutoSignInFalse { - const SetAutoSignInFalse(this._userRepository); +final class SetAutoSignInTrue { + const SetAutoSignInTrue(this._userRepository); final UserRepository _userRepository; Future call() async { - return _userRepository.setAutoSignInFalse(); + return _userRepository.setAutoSignInTrue(); } } diff --git a/front/lib/features/user/usecase/sign_out_usecase.dart b/front/lib/features/user/usecase/sign_out_usecase.dart index e69de29..54a5a1b 100644 --- a/front/lib/features/user/usecase/sign_out_usecase.dart +++ b/front/lib/features/user/usecase/sign_out_usecase.dart @@ -0,0 +1,12 @@ +import 'package:front/core/utils/api_response.dart'; +import 'package:front/core/utils/result.dart'; +import 'package:front/features/user/repositories/user_repositories.dart'; + +final class SignOutUseCase { + const SignOutUseCase(this._userRepository); + final UserRepository _userRepository; + + Future> call() async { + return _userRepository.signOut(); + } +} \ No newline at end of file diff --git a/front/lib/main/main.dart b/front/lib/main/main.dart index 327413a..9fb194d 100644 --- a/front/lib/main/main.dart +++ b/front/lib/main/main.dart @@ -32,7 +32,6 @@ class _EagerInitialization extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - ref.watch(sharedPrefProvider); ref.watch(secureStorageProvider); return child;