screen to be on if playing game or watching game#1835
screen to be on if playing game or watching game#1835MunibullahShah wants to merge 16 commits intolichess-org:mainfrom
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. |
|
|
||
| actions: [if (loadedGame != null) _GameMenu(gameId: loadedGame.gameId)], | ||
| return WakelockWidget( | ||
| shouldEnableOnFocusGained: () => loadedGame != null, |
There was a problem hiding this comment.
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.
Code formatting is wrong for game_screen.dart; you can fix it by running dart format lib/src
| final _whiteClockKey = GlobalKey(debugLabel: 'whiteClockOnTvScreen'); | ||
| final _blackClockKey = GlobalKey(debugLabel: 'blackClockOnTvScreen'); | ||
|
|
||
| @override |
There was a problem hiding this comment.
This code does nothing, it can be removed.
There was a problem hiding this comment.
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();
}| final _blackClockKey = GlobalKey(debugLabel: 'blackClockOnGameScreen'); | ||
| final _boardKey = GlobalKey(debugLabel: 'boardOnGameScreen'); | ||
|
|
||
| @override |
There was a problem hiding this comment.
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.
I meant the empty initState and dispose; they are useless here.
There was a problem hiding this comment.
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.
Sorry for the delay.
I still cannot accept the PR because these keys are removed where they should be kept.
|
Closing due to inactivity. |
#1835