-
-
Notifications
You must be signed in to change notification settings - Fork 325
screen to be on if playing game or watching game #1835
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
base: main
Are you sure you want to change the base?
Conversation
|
There is already a WakeLock widget. You should use it, no need to create one. Also game screen is already keeping screen on (contrary to what the issue says...), so no need to modify game screen. mobile/lib/src/view/game/game_body.dart Line 215 in cd0d627
(admitedly it would be better if it was on game screen, it could be changed); |
|
Removed the services created and used the already-made widget. |
lib/src/view/game/game_screen.dart
Outdated
|
|
||
| actions: [if (loadedGame != null) _GameMenu(gameId: loadedGame.gameId)], | ||
| return WakelockWidget( | ||
| shouldEnableOnFocusGained: () => loadedGame != null, |
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 problem is that it is not the condition we want.
Before it was:
shouldEnableOnFocusGained: () => gameState.game.playable,So I think you should revert the changes on game_body.dart and game_screen.dart.
veloce
left a comment
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.
Code formatting is wrong for game_screen.dart; you can fix it by running dart format lib/src
lib/src/view/watch/tv_screen.dart
Outdated
| final _whiteClockKey = GlobalKey(debugLabel: 'whiteClockOnTvScreen'); | ||
| final _blackClockKey = GlobalKey(debugLabel: 'blackClockOnTvScreen'); | ||
|
|
||
| @override |
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.
This code does nothing, it can be removed.
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.
Sorry if the comment was not placed on the good line.
This is useful:
final _whiteClockKey = GlobalKey(debugLabel: 'whiteClockOnTvScreen');
final _blackClockKey = GlobalKey(debugLabel: 'blackClockOnTvScreen');This is useless:
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
lib/src/view/game/game_screen.dart
Outdated
| final _blackClockKey = GlobalKey(debugLabel: 'blackClockOnGameScreen'); | ||
| final _boardKey = GlobalKey(debugLabel: 'boardOnGameScreen'); | ||
|
|
||
| @override |
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.
please remove that
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.
They are being used in GameBody where the comments says that these variables are being used to preserve state if orientation changes.
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.
I meant the empty initState and dispose; they are useless here.
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.
Got it, removing it now :)
|
@veloce any update on this? |
|
@veloce removed the code in both files |
| userId: widget.user?.id, | ||
| ); | ||
|
|
||
| final _whiteClockKey = GlobalKey(debugLabel: 'whiteClockOnTvScreen'); |
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.
Sorry for the delay.
I still cannot accept the PR because these keys are removed where they should be kept.
#1835