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