Skip to content

Conversation

@BAW2501
Copy link
Contributor

@BAW2501 BAW2501 commented Feb 3, 2024

Closes #470
Note that in lib/src/utils/layout.dart i changed
final appBarHeight = Theme.of(context).platform == TargetPlatform.iOS ? 44.0 : 56.0;
to inside double estimateRemainingHeightLeftBoard(BuildContext context)
to use the context for Theme.of(context).platform


Future<void> _setImmersiveMode() async {
if (defaultTargetPlatform == TargetPlatform.android) {
if (Theme.of(context).platform == TargetPlatform.android) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that context I'd not use the Theme.of(context).platform because we're about to make a system call which is only in android. This is not for styling purposes.
Here the docs says is ok to even use dart:io.Platform but I guess we can also use defaultTargetPlatform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch! will revert in latest commit

@BAW2501 BAW2501 requested a review from veloce February 6, 2024 07:40
@veloce veloce merged commit 6345caa into lichess-org:main Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace defaultTargetPlatform with Theme.of(context).platform

2 participants