fullscreen: fixed overlay layout
This commit is contained in:
parent
beb31f1f98
commit
4de4664f7c
1 changed files with 71 additions and 58 deletions
|
@ -1,3 +1,6 @@
|
|||
import 'dart:math';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aves/model/image_entry.dart';
|
||||
import 'package:aves/model/image_fetcher.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -39,13 +42,18 @@ class _FullscreenOverlayState extends State<FullscreenOverlay> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final viewInsets = MediaQuery.of(context).viewInsets;
|
||||
var mediaQuery = MediaQuery.of(context);
|
||||
final screenWidth = mediaQuery.size.width;
|
||||
final viewInsets = mediaQuery.viewInsets;
|
||||
final date = ImageEntry.getBestDate(entry);
|
||||
final subRowConstraints = BoxConstraints(maxWidth: 400);
|
||||
return IgnorePointer(
|
||||
final subRowWidth = min(400.0, screenWidth);
|
||||
return ClipRect(
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
||||
child: IgnorePointer(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8.0).add(EdgeInsets.only(bottom: viewInsets.bottom)),
|
||||
color: Colors.black45,
|
||||
color: Colors.black26,
|
||||
child: DefaultTextStyle(
|
||||
style: TextStyle(
|
||||
shadows: [
|
||||
|
@ -59,13 +67,16 @@ class _FullscreenOverlayState extends State<FullscreenOverlay> {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
SizedBox(
|
||||
width: screenWidth,
|
||||
child: Text(
|
||||
'${widget.index + 1}/$total – ${entry['title']}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ConstrainedBox(
|
||||
constraints: subRowConstraints,
|
||||
SizedBox(
|
||||
width: subRowWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.calendar_today, size: 16),
|
||||
|
@ -84,8 +95,8 @@ class _FullscreenOverlayState extends State<FullscreenOverlay> {
|
|||
}
|
||||
return (_lastDetails == null || _lastDetails.isEmpty)
|
||||
? Text('')
|
||||
: ConstrainedBox(
|
||||
constraints: subRowConstraints,
|
||||
: SizedBox(
|
||||
width: subRowWidth,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.camera, size: 16),
|
||||
|
@ -103,6 +114,8 @@ class _FullscreenOverlayState extends State<FullscreenOverlay> {
|
|||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue