fix issue with opening media
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2026-07-29 16:33:30 +02:00
parent 0e06a21948
commit 3171541b6a
4 changed files with 3 additions and 32 deletions

View file

@ -4,6 +4,7 @@
## 0.4.3
- New: Contact labels
- Fix: Multiple black screens
## 0.4.0

View file

@ -706,18 +706,7 @@ class _CameraPreviewViewState extends State<CameraPreviewView> {
_checkAndInitCamera();
});
}
// Show a loader instead of an empty container to prevent a black screen
// while the camera is initializing or if initialization failed.
return Center(
child: SizedBox(
height: 60,
width: 60,
child: ThreeRotatingDots(
size: 40,
color: context.color.primary,
),
),
);
return Container();
}
return StreamBuilder(
stream: userService.onUserUpdated,

View file

@ -671,25 +671,6 @@ class _MediaViewerViewState extends State<MediaViewerView> {
child: Stack(
fit: StackFit.expand,
children: [
// Fallback: when no content is visible (no media, no loader,
// no twonly-present overlay), show a loader to prevent a
// black screen. If there are truly no files left, exit.
if (!_showDownloadingLoader &&
currentMedia == null &&
videoController == null &&
!displayTwonlyPresent)
Builder(builder: (context) {
// Schedule exit on the next frame if there is nothing
// left to display, so we don't trap the user.
if (allMediaFiles.isEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && currentMedia == null) {
Navigator.of(context).maybePop();
}
});
}
return _loader();
}),
if (_showDownloadingLoader) _loader(),
if ((currentMedia != null || videoController != null) &&
(canBeSeenUntil == null || progress.value >= 0))

View file

@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec
publish_to: 'none'
version: 0.4.3+162
version: 0.4.3+163
environment:
sdk: ^3.11.0