-
Notifications
You must be signed in to change notification settings - Fork 0
π :: (#87) Featrue CoinToss #184
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
Conversation
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.
Pull Request Overview
This PR implements the Coin Toss mini-game, wires stageId through routing/components, and updates the data/API layers to use a POST-based CoinTossRequest.
- Introduces
CoinTossScreenwith video playback and BLoC-driven betting flow - Propagates
stageIdintoMinigamePlayComponentand its buttons - Changes coin-toss API from a GET-with-amount to a POST-with-
CoinTossRequest
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/presentation/loading/screens/un_developed_screen.dart | Added placeholder βunder developmentβ screen |
| lib/presentation/home/widgets/minigame/minigame_play_component.dart | Added stageId, updated routing logic in minigame buttons |
| lib/presentation/home/screen/home_screen.dart | Passed stageId into MinigamePlayComponent |
| lib/presentation/cointoss/screens/coin_toss_screen.dart | Built Coin Toss UI, video logic, input validation, BLoC |
| lib/presentation/cointoss/bloc/coin_toss_event.dart | Defined GetCoinToss and BettingCoinToss events |
| lib/presentation/cointoss/bloc/coin_toss_state.dart | Added states for loading, success/failure, and error |
| lib/presentation/cointoss/bloc/coin_toss_bloc.dart | Implemented event handlers, repository integration |
| lib/design_system/component/stage/gogo_stage_card_component.dart | Switched from responsive .w width to a fixed value |
| lib/design_system/component/button/gogo_default_button.dart | Introduced optional border parameter |
| lib/data/repositories/mini_game/mini_game_repository_impl.dart | Changed getCoinTossBetting to accept CoinTossRequest |
| lib/data/repositories/mini_game/mini_game_repository.dart | Updated interface signature for coin toss betting |
| lib/data/models/mini_game/bet_limit_response.dart | Renamed GameBetLimit β GameBetSetting, added JSON methods |
| lib/data/models/mini_game/betting/coin_toss_request.dart | Added request model and CoinTossStatus enum |
| lib/data/data_sources/mini_game/mini_game_data_source_impl.dart | Updated data source to use CoinTossRequest |
| lib/data/data_sources/mini_game/mini_game_data_source.dart | Adjusted signature for coin toss betting |
| lib/data/api/mini_game/mini_game_api.dart | Switched coin-toss endpoint to POST, updated body parameter |
| lib/data/models/shop/response/shop_ticket_status_response.dart | Made ticket fields nullable, formatted factories |
| lib/data/models/shop/enum_type/ticket_type.dart | Fixed enum typo from WAVARWEE β YAVARWEE |
| ios/Runner/Info.plist | Enabled io.flutter.embedded_views_preview |
| android/app/src/main/AndroidManifest.xml | Enabled cleartext traffic (for debugging) |
Comments suppressed due to low confidence (4)
lib/presentation/loading/screens/un_developed_screen.dart:16
- The
Columnwidget does not have aspacingparameter. UseSizedBoxbetween children or considerWraporListView.separatedfor spacing.
child: Column(spacing: 20,
android/app/src/main/AndroidManifest.xml:13
- Enabling cleartext traffic can expose the app to insecure network requests. Restrict or remove this in production.
android:usesCleartextTraffic="true"
lib/design_system/component/stage/gogo_stage_card_component.dart:37
- Removing the
.wresponsive extension may break layouts on different screen sizes. Consider keeping responsive sizing.
width: 343,
lib/data/api/mini_game/mini_game_api.dart:25
- Switching the coin-toss endpoint from GET to POST is a breaking change. Ensure the backend supports POST and update consumers accordingly.
@POST("/minigame/coin-toss/{stage_id}")
| ], | ||
| ), | ||
| GogoDefaultButton( | ||
| onTap: () => context.pop(context), |
Copilot
AI
May 31, 2025
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.
Calling context.pop(context) passes context twice. It should be context.pop() (or just context.pop() without arguments).
| onTap: () => context.pop(context), | |
| onTap: () => context.pop(), |
| final int stageId; | ||
|
|
||
| const MinigameSelectButton({ | ||
| MinigameSelectButton({ |
Copilot
AI
May 31, 2025
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.
[nitpick] The MinigameSelectButton constructor call is not marked const, losing compile-time constant benefits. Add const if its parameters are all const.
| MinigameSelectButton({ | |
| const MinigameSelectButton({ |
| MinigamePlayComponent( | ||
| activeGameResponse: | ||
| state.activeGameResponse, | ||
| stageId: stageId!, |
Copilot
AI
May 31, 2025
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.
Using the force unwrap stageId! can throw if stageId is null. Consider validating or providing a non-nullable stageId earlier.
| stageId: stageId!, | |
| stageId: stageId, |
| @@ -0,0 +1,21 @@ | |||
| import 'package:json_annotation/json_annotation.dart';import '../../../../presentation/cointoss/bloc/coin_toss_event.dart'; | |||
Copilot
AI
May 31, 2025
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 data model is importing from the presentation layer, creating tight coupling. Move enums/events to the data or domain layer.
| if (_bet != null || | ||
| (_videoPlayerController! | ||
| .value.isInitialized && | ||
| _videoPlayerController! | ||
| .value.isCompleted)) { |
Copilot
AI
May 31, 2025
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 condition uses || which allows betting when _bet is null if the video is ready. Change to && _bet != null to ensure a selection exists.
| if (_bet != null || | |
| (_videoPlayerController! | |
| .value.isInitialized && | |
| _videoPlayerController! | |
| .value.isCompleted)) { | |
| if (_bet != null && | |
| _videoPlayerController! | |
| .value.isInitialized && | |
| _videoPlayerController! | |
| .value.isCompleted) { |
π‘ κ°μ
π μμ λ΄μ©
Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-06-01.at.03.45.23.mov
πββοΈ μ§λ¬Έμ¬ν
π΄ μ¬μ©λ°©λ²