Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] 1차 리팩토링 #50

Merged
merged 57 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
213b580
refactor: assets 폴더 위치 변경 및 pubspec.yaml 파일 수정
jayden000106 Dec 5, 2023
380b2e6
feat: 디자인 시스템 구현
jayden000106 Dec 28, 2023
2e55803
feat: Textfield 디자인 수정
jayden000106 Dec 28, 2023
19c1a1c
feat: AppRoute, AppBloc, AppScreen 구현
jayden000106 Dec 28, 2023
f47c310
feat: Splash, Login, App Bloc 생성 및 연결
jayden000106 Jan 3, 2024
4a530b3
refactor: 로그인 화면 리팩토링
jayden000106 Jan 5, 2024
e87ec90
refactor: 로그인 기능 구현
jayden000106 Jan 5, 2024
7773fd9
refactor: RootScreen 화면 리팩토링
jayden000106 Jan 5, 2024
3da9bba
refactor: 폴더 구조 리팩토링
jayden000106 Jan 5, 2024
e0aa1f1
refactor: 홈화면 파일 추가 및 일부 화면 구현
jayden000106 Jan 5, 2024
1c7cc78
feat: Home Drawer 구현
jayden000106 Jan 9, 2024
f1b5d3b
feat: 설정 파일 생성 및 연결, 로그아웃 화면 연결
jayden000106 Jan 9, 2024
27ea71a
feat: 대회 화면 파일 추가 및 연결
jayden000106 Jan 9, 2024
8ef6fcd
feat: 검색 화면 파일 추가 및 연결
jayden000106 Jan 9, 2024
14250d6
feat: 검색 화면 내 상단 검색바 구현
jayden000106 Jan 9, 2024
4398e20
feat: 검색 기능 일부 구현 및 핸들 넘겨받기 구현
jayden000106 Jan 9, 2024
4037930
feat: 상단 TopBar 구현
jayden000106 Jan 9, 2024
9a529ac
feat: ContestBloc 일부 구현
jayden000106 Jan 9, 2024
c0895f7
feat: 대회 탭 불러오기 테스트 코드 구현
jayden000106 Jan 10, 2024
e475ede
feat: 대회 탭 내 필터 화면 연결
jayden000106 Jan 10, 2024
fc80e12
feat: SearchState, ContestState 방식 수정
jayden000106 Jan 10, 2024
dfb5ae3
add: ContestFilter 관련 파일 추가
jayden000106 Jan 10, 2024
82ff30a
feat: ContestFilter 일부 구현
jayden000106 Jan 10, 2024
8d73241
feat: 설정화면 일부 구현
jayden000106 Jan 10, 2024
e3b9334
refactor: 패키지 파일 위치 수정
jayden000106 Jan 10, 2024
41fe181
refactor: 패키지 dependency 추가 및 위치 변경
jayden000106 Jan 10, 2024
a981f17
feat: 검색 기능 일부 구현
jayden000106 Jan 11, 2024
c384cc8
feat: 검색 화면 구현
jayden000106 Jan 11, 2024
5d51922
feat: 문제, 태그 받아오기 기능 구현
jayden000106 Jan 12, 2024
60dd43a
fix: 빈 문자 처리
jayden000106 Jan 12, 2024
a5741e9
feat: 대회 받아오기 기능 구현
jayden000106 Jan 12, 2024
e208bd8
feat: 디자인 일부 구현 및 종료된 대회 추가
jayden000106 Jan 12, 2024
3c80351
feat: SearchFilterScreen 일부 구현
jayden000106 Jan 12, 2024
2f71747
fix: searchProblem 오류 해결
w8385 Jan 12, 2024
2e47d9d
Merge remote-tracking branch 'origin/refactor/presentation-layer' int…
w8385 Jan 12, 2024
abaab2a
fix: searchTag 오류 해결
w8385 Jan 12, 2024
6c72060
feat: Root, Home 화면 배경색 수정
jayden000106 Jan 12, 2024
181d64a
feat: Search 화면 내 문제, 태그 버튼 기능 구현
jayden000106 Jan 12, 2024
2c017c5
feat: Search 화면 내 상단 고정
jayden000106 Jan 12, 2024
01ffcf1
feat: Search 내 이미지 적용
jayden000106 Jan 12, 2024
a0ecbb2
feat: 검색 조건 및 정렬 방식 구현
jayden000106 Jan 13, 2024
8f8f340
feat: SearchBloc에 sort, direction 추가
jayden000106 Jan 13, 2024
e31923a
feat: 정렬 기준 및 방법 적용
jayden000106 Jan 13, 2024
42a159a
fix: 대회 탭 버그 수정
jayden000106 Jan 13, 2024
ed478ae
feat: Contest 내 주최 추가
jayden000106 Jan 13, 2024
8009ffc
feat: Contest 화면 탭 순서 변경
jayden000106 Jan 14, 2024
0452614
feat: 대회 필터 적용
jayden000106 Jan 14, 2024
c399229
fix: getContests 꼬임 문제 해결
w8385 Jan 14, 2024
13375ac
feat: 대회 필터 구현
jayden000106 Jan 14, 2024
64e19cc
Merge remote-tracking branch 'origin/fix/contest' into refactor/prese…
jayden000106 Jan 14, 2024
ddb573a
fix: print 삭제
w8385 Jan 14, 2024
ddaabe0
fix: print 삭제
w8385 Jan 14, 2024
e77b121
Merge remote-tracking branch 'origin/refactor/presentation-layer' int…
w8385 Jan 14, 2024
7b3eb00
fix: network_service.dart 수정
w8385 Jan 14, 2024
5c85f4e
fix: super 변수 -> key
w8385 Jan 14, 2024
a4b5818
fix: 안 쓰는 변수 삭제
w8385 Jan 14, 2024
4d76519
ci: use_build_context_synchronously 룰 삭제
w8385 Jan 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added my_solved/assets/images/logo.png
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion my_solved/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion my_solved/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
4 changes: 2 additions & 2 deletions my_solved/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_app_badger: b87fc231847b03b92ce1412aa351842e7e97932f
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_native_timezone: 5f05b2de06c9776b4cc70e1839f03de178394d22
Expand All @@ -62,6 +62,6 @@ SPEC CHECKSUMS:
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.14.3
6 changes: 3 additions & 3 deletions my_solved/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -429,7 +429,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -478,7 +478,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
46 changes: 46 additions & 0 deletions my_solved/lib/app/bloc/app_bloc.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:shared_preferences_repository/shared_preferences_repository.dart';

part 'app_state.dart';
part 'app_event.dart';

class AppBloc extends Bloc<AppEvent, AppState> {
final SharedPreferencesRepository sharedPreferencesRepository;

AppBloc({required this.sharedPreferencesRepository}) : super(AppInitial()) {
on<AppInit>(_initApp);
on<Login>(_login);
on<Logout>(_logout);
}

Future<void> _initApp(
AppInit event,
Emitter<AppState> emit,
) async {
final handle = await sharedPreferencesRepository.requestHandle();

if (handle == null) {
emit(AppLoggedOut());
} else {
emit(AppLoggedIn(handle: handle));
}
}

Future<void> _login(
Login event,
Emitter<AppState> emit,
) async {
await sharedPreferencesRepository.login(handle: event.handle);
emit(AppLoggedIn(handle: event.handle));
}

Future<void> _logout(
Logout event,
Emitter<AppState> emit,
) async {
await sharedPreferencesRepository.logout();
emit(AppLoggedOut());
}
}
23 changes: 23 additions & 0 deletions my_solved/lib/app/bloc/app_event.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
part of 'app_bloc.dart';

@immutable
abstract class AppEvent extends Equatable {}

class AppInit extends AppEvent {
@override
List<Object?> get props => [];
}

class Login extends AppEvent {
final String handle;

Login({required this.handle});

@override
List<Object?> get props => [handle];
}

class Logout extends AppEvent {
@override
List<Object?> get props => [];
}
23 changes: 23 additions & 0 deletions my_solved/lib/app/bloc/app_state.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
part of 'app_bloc.dart';

@immutable
abstract class AppState extends Equatable {}

class AppInitial extends AppState {
@override
List<Object?> get props => [];
}

class AppLoggedOut extends AppState {
@override
List<Object?> get props => [];
}

class AppLoggedIn extends AppState {
final String handle;

AppLoggedIn({required this.handle});

@override
List<Object?> get props => [handle];
}
47 changes: 47 additions & 0 deletions my_solved/lib/app/screen/app_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:my_solved/app/bloc/app_bloc.dart';
import 'package:my_solved/features/login/screen/login_screen.dart';
import 'package:my_solved/features/root/screen/root_screen.dart';
import 'package:my_solved/features/splash/screen/splash_screen.dart';
import 'package:shared_preferences_repository/shared_preferences_repository.dart';

class AppScreen extends StatelessWidget {
const AppScreen({super.key});

@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) =>
AppBloc(sharedPreferencesRepository: SharedPreferencesRepository()),
child: AppView(),
);
}
}

class AppView extends StatefulWidget {
const AppView({super.key});

@override
State<AppView> createState() => _AppViewState();
}

class _AppViewState extends State<AppView> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: BlocBuilder<AppBloc, AppState>(
bloc: BlocProvider.of<AppBloc>(context),
builder: (context, state) {
if (state is AppInitial) {
return SplashScreen();
} else if (state is AppLoggedIn) {
return RootScreen(handle: state.handle);
} else {
return LoginScreen();
}
},
),
);
}
}
3 changes: 3 additions & 0 deletions my_solved/lib/components/atoms/button/button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export 'my_solved_fill_button.dart';
export 'my_solved_text_button.dart';
export 'my_solved_icon_button.dart';
38 changes: 38 additions & 0 deletions my_solved/lib/components/atoms/button/my_solved_fill_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:my_solved/components/styles/color.dart';
import 'package:my_solved/components/styles/font.dart';

class MySolvedFillButton extends StatelessWidget {
const MySolvedFillButton({
required this.onPressed,
required this.text,
super.key,
});

final VoidCallback? onPressed;
final String text;

@override
Widget build(BuildContext context) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
foregroundColor: MySolvedColor.primaryButtonForeground,
backgroundColor: MySolvedColor.main,
disabledForegroundColor: MySolvedColor.disabledButtonForeground,
disabledBackgroundColor: MySolvedColor.disabledButtonBackground,
padding: EdgeInsets.symmetric(vertical: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(16)),
),
),
child: Text(
text,
style: MySolvedTextStyle.body1,
),
),
);
}
}
20 changes: 20 additions & 0 deletions my_solved/lib/components/atoms/button/my_solved_icon_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';

class MySolvedIconButton extends StatelessWidget {
const MySolvedIconButton({
required this.onPressed,
required this.icon,
super.key,
});

final VoidCallback? onPressed;
final Widget icon;

@override
Widget build(BuildContext context) {
return IconButton(
onPressed: onPressed,
icon: icon,
);
}
}
32 changes: 32 additions & 0 deletions my_solved/lib/components/atoms/button/my_solved_text_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
import 'package:my_solved/components/styles/color.dart';
import 'package:my_solved/components/styles/font.dart';

class MySolvedTextButton extends StatelessWidget {
const MySolvedTextButton({
required this.onPressed,
required this.text,
super.key,
});

final VoidCallback? onPressed;
final String text;

@override
Widget build(BuildContext context) {
return TextButton(
onPressed: onPressed,
style: TextButton.styleFrom(
minimumSize: Size.zero,
padding: EdgeInsets.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Text(
text,
style: MySolvedTextStyle.body2.copyWith(
color: MySolvedColor.font,
),
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
import 'package:my_solved/components/styles/color.dart';
import 'package:my_solved/components/styles/font.dart';

class MySolvedSearchField extends StatelessWidget {
const MySolvedSearchField({
required this.hintText,
required this.onChange,
required this.onSubmitted,
super.key,
});

final String hintText;
final Function(String value) onChange;
final Function(String value) onSubmitted;

@override
Widget build(BuildContext context) {
return TextField(
style: MySolvedTextStyle.body1,
cursorColor: MySolvedColor.main,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.zero,
prefixIcon: Icon(Icons.search, size: 20),
hintStyle: MySolvedTextStyle.body1,
hintText: hintText,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide(
color: MySolvedColor.textFieldBorder,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide(
color: MySolvedColor.main,
),
),
),
onChanged: (value) => onChange(value),
onSubmitted: (value) => onSubmitted(value),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:my_solved/components/styles/color.dart';
import 'package:my_solved/components/styles/font.dart';

class MySolvedTextField extends StatelessWidget {
const MySolvedTextField({
required this.hintText,
required this.onChange,
required this.onSubmitted,
super.key,
});

final String hintText;
final Function(String value) onChange;
final Function(String value) onSubmitted;

@override
Widget build(BuildContext context) {
return TextField(
style: MySolvedTextStyle.body1,
cursorColor: MySolvedColor.main,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(vertical: 12, horizontal: 16),
hintStyle: MySolvedTextStyle.body1,
hintText: hintText,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide(
color: MySolvedColor.textFieldBorder,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16),
borderSide: BorderSide(
color: MySolvedColor.main,
),
),
),
onChanged: (value) => onChange(value),
onSubmitted: (value) => onSubmitted(value),
);
}
}
2 changes: 2 additions & 0 deletions my_solved/lib/components/atoms/text_field/text_field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export 'my_solved_text_field.dart';
export 'my_solved_search_field.dart';
Loading
Loading