-
Notifications
You must be signed in to change notification settings - Fork 0
π :: (#174) MatchList Page Connect Api #179
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
Open
iloveuhyeon
wants to merge
26
commits into
develop
Choose a base branch
from
feature/#174-matchlistpage-battingModal-api-connaction
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e65b092
:recycle: :: MatchListEvent μ μνλ₯Ό LoadItemsλ‘ λ³κ²½
answad c68d1da
:sparkles: :: item Loading κΈ°λ₯μ΄ μλ MatchListBloc μμ±
answad 87fe2f0
:recycle: :: MatchListScreen μ΄ stageId, λ
λ, λ¬, μΌ, μ λ°λλ‘ μμ
answad 53a8b0f
:recycle: :: MatchListScreenμ blocκ³Ό μ°κ²°
answad 74e588f
:recycle: :: matchList λΌμ°ν
μ€μ
answad 8f4f865
Merge branch 'develop' of https://github.com/team-gogo/GOGO-App into β¦
iloveuhyeon 86ffa72
:recycle: :: Match Participant widget μμ
iloveuhyeon 24cf4f8
:recycle: :: Community main screen, match list screenμ λ‘λ© μΈλκ²μ΄ν° μΆκ°
iloveuhyeon a3d8425
:sparkles: :: batting state μΆκ°
answad 0820ec9
:sparkles: :: batting event μΆκ°
answad d111c1e
:recycle: :: _onBettingMatch ν¨μ μΆκ°
answad 90b2717
:recycle: :: MatchBattingStatusDialogκ° μΈλΆμμ bettingControllerλ₯Ό λ°μμ μ¬μ©β¦
answad eed6a9b
:recycle: :: showDialogMatchBatting ν¨μμμ μ€μ λ‘ λ°°ν
μ ν μ μλλ‘ μμ
answad 42077cd
:recycle: :: BettingMatch event μ _onBettingMatch ν¨μλ₯Ό μ°κ²°
answad 46ea73f
:recycle: :: batting νμ μλμΌλ‘ λ‘컬μμ λ°°ν
κΈμ‘μ μ¬λ¦¬λλ‘ μμ
answad 637e238
Merge remote-tracking branch 'origin/develop' into feature/#174-matchβ¦
answad 8c258d7
Merge remote-tracking branch 'origin/feature/#174-matchlistpage-battiβ¦
answad 1f3bf09
:recycle: :: BettingRepositoryμ get instanceμ μΆκ°
answad 6fba73d
:recycle: :: BettingDataSourceλ₯Ό get instanceμ μΆκ°
answad 5583368
:recycle: :: selectedTeamμ μμ μμ ―μμ κ΄λ¦¬νλλ‘ λ³κ²½νκ³ μ νλ μμ ―μ λ°λΌμ μμ΄ λ³νκ² λ³κ²½
answad 6f139a3
:recycle: :: λ°°ν
μ΄ λ‘컬μμ λ°λ‘λ°λ‘ μ μ©λλλ‘ μμ
answad 15c1831
:recycle: :: λ°°ν
λͺ¨λ¬μμ λ°°ν
νμ λ°°ν
λͺ¨λ¬μ΄ λ«νμ§ μλλ‘ μμ
answad 71b92b3
:recycle: :: home screenμμ λ°°ν
μ΄ κ°λ₯νλλ‘ λ°°ν
λͺ¨λ¬ μΆκ°
answad b9bc804
:recycle: :: μλ¬ μμ λ° νΌλΈλ¦¬μ± μμ
iloveuhyeon 3742d02
:recycle: :: λ‘컬 ν¬μΈνΈ 볡ꡬ
answad 5b3c33b
:recycle: :: μμΈμ²λ¦¬ ν μ€νΈ μΆκ°
answad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import 'package:flutter_bloc/flutter_bloc.dart'; | ||
| import 'package:get_it/get_it.dart'; | ||
| import 'package:gogo_app/data/models/stage/enum_type/game_type.dart'; | ||
| import '../../../data/repositories/stage/stage_repository.dart'; | ||
| import 'match_list_event.dart'; | ||
| import 'match_list_state.dart'; | ||
| import '../../../data/models/common/match_dto.dart'; | ||
|
|
||
| class MatchListBloc extends Bloc<MatchListEvent, MatchListState> { | ||
| final StageRepository _stageRepository = GetIt.instance<StageRepository>(); | ||
|
|
||
| final int stageId; | ||
| final int year; | ||
| final int month; | ||
| final int day; | ||
| GameType? gameType; | ||
|
|
||
| MatchListBloc({ | ||
| required this.stageId, | ||
| required this.year, | ||
| required this.month, | ||
| required this.day, | ||
| }) : super(InitMatchList()) { | ||
| on<LoadItems>(_onLoadItems); | ||
| } | ||
|
|
||
| Future<void> _onLoadItems( | ||
| LoadItems event, Emitter<MatchListState> emit) async { | ||
| emit(LoadingMatchList()); | ||
|
|
||
| try { | ||
| final matchesResponse = await _stageRepository.searchMatch( | ||
| stageId, | ||
| year, | ||
| month, | ||
| day, | ||
| ); | ||
| List<MatchDto> filtered = matchesResponse.matches; | ||
|
|
||
| if (event.gameType != null) { | ||
| filtered = | ||
| filtered.where((e) => event.gameType == event.gameType).toList(); | ||
| } | ||
| if (event.sortOrder != null) { | ||
| filtered.sort((a, b) { | ||
| return event.sortOrder == SortOrder.ascending | ||
| ? a.startDate.compareTo(b.startDate) | ||
| : b.startDate.compareTo(a.startDate); | ||
| }); | ||
| } | ||
|
|
||
| emit(LoadedMatchList(matchList: filtered, hasReachedMax: true)); | ||
| } catch (e) { | ||
| emit(InitMatchList()); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| import 'package:gogo_app/data/models/stage/enum_type/game_type.dart'; | ||
|
|
||
| abstract class MatchListEvent {} | ||
|
|
||
| class GetMatchList extends MatchListEvent { | ||
| final int page; | ||
| final int pageSize; | ||
| class LoadItems extends MatchListEvent { | ||
| final GameType? gameType; | ||
| final SortOrder? sortOrder; | ||
|
|
||
| LoadItems({this.gameType, this.sortOrder}); | ||
| } | ||
|
|
||
| GetMatchList({ | ||
| required this.page, | ||
| required this.pageSize, | ||
| }); | ||
| } | ||
| enum SortOrder { ascending, descending } |
164 changes: 115 additions & 49 deletions
164
lib/presentation/match_list/screen/match_list_screen.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter predicate compares
event.gameTypeto itself, which is always true. It should compare each item'sgameType, e.g.,e.gameType == event.gameType.