Skip to content
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

#449 feat/ add fullscreen mode for photos in detail views #488

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jakubbaldyga
Copy link
Contributor

Okay so, generally this works pretty nice. Although I have a problem that when the zoomable image will be shown in fullscreen, in some cases the Scaffold will only contain the image leaving black areas around it. I tried many approaches but i can't get it to work...

Correct scafold coverage:
image

Incorrect scaffold coverage (there are black areas above and under the image):
image
Notice that here there is an image with transparency, there is a greyLight color underneath it.

Copy link
Member

@mikolaj-jalocha mikolaj-jalocha left a comment

Choose a reason for hiding this comment

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

Really god work here! Nice and clean. I left few suggestions and questions of mine.

Regarding problem you described in PR description, maybe it has sth to do with image size?

@simon-the-shark if you have free time please look at it as well. Especially on part where navigator comes to play.

Comment on lines +92 to 93
static const heightImage = 254.0;
static const double spacerHeight = 16;
Copy link
Member

Choose a reason for hiding this comment

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

please specify the type of heightImage, imo better to rename it to: imageHeight (just to follow convention)

Comment on lines +56 to +61
const SizedBox(height: DetailViewsConfig.heightImage),
SizedBox(
height: DetailViewsConfig.heightImage,
child: ZoomableOptimizedDirectusImage(
digitalGuideResponseExtended.imageUrl,
),
Copy link
Member

Choose a reason for hiding this comment

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

Is SizedBox declared twice needed here?

@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.bottomCenter,
child: SizedBox.square(
child: ListView(
child: SingleChildScrollView(
Copy link
Member

Choose a reason for hiding this comment

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

why SingleChildScrollView here?

Comment on lines +46 to +52
Size _getImagesSize(BuildContext context, BoxConstraints constraints) {
final pixelsDensity = MediaQuery.devicePixelRatioOf(context);
return Size(
constraints.maxWidth * pixelsDensity,
constraints.maxHeight * pixelsDensity,
);
}
Copy link
Member

Choose a reason for hiding this comment

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

imo an overkill here. I'd live it as I was before

Copy link
Member

@simon-the-shark simon-the-shark left a comment

Choose a reason for hiding this comment

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

Could we make the background semi-transparent (black with some opacity) to stil see what's underneath a bit??

Future<void> _showFullScreenImage(BuildContext context) async {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (newContext) => Scaffold(
Copy link
Member

Choose a reason for hiding this comment

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

using newContext instead of just context can lead to mistakes

Copy link
Member

Choose a reason for hiding this comment

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

the convention is just to use context always

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (7)
  • lib/config/ui_config.dart: Language not supported
  • lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart: Language not supported
  • lib/features/guide_detail_view/guide_detail_view.dart: Language not supported
  • lib/widgets/detail_views/sliver_header_section.dart: Language not supported
  • lib/widgets/detail_views/sliver_logo.dart: Language not supported
  • lib/widgets/optimized_directus_image.dart: Language not supported
  • lib/widgets/zoomable_optimized_directus_image.dart: Language not supported
@simon-the-shark simon-the-shark added the enhancement New feature or request label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat/ add fullscreen mode for photos in detail views
3 participants