fullscreen: fixed overlay layout
This commit is contained in:
parent
82b875e591
commit
b9cc2c076c
1 changed files with 36 additions and 21 deletions
|
@ -6,6 +6,24 @@ import 'package:aves/model/image_fetcher.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
const kOverlayBackground = Colors.black26;
|
||||||
|
|
||||||
|
class Blurred extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
const Blurred({Key key, this.child}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ClipRect(
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 4, sigmaY: 4),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FullscreenTopOverlay extends StatelessWidget {
|
class FullscreenTopOverlay extends StatelessWidget {
|
||||||
final List<Map> entries;
|
final List<Map> entries;
|
||||||
final int index;
|
final int index;
|
||||||
|
@ -16,21 +34,18 @@ class FullscreenTopOverlay extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ClipRect(
|
return Blurred(
|
||||||
child: BackdropFilter(
|
child: SafeArea(
|
||||||
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
child: Container(
|
||||||
child: SafeArea(
|
height: kToolbarHeight,
|
||||||
child: Container(
|
child: AppBar(
|
||||||
height: kToolbarHeight,
|
title: Text('${index + 1}/${entries.length}'),
|
||||||
child: AppBar(
|
actions: [
|
||||||
title: Text('${index + 1}/${entries.length}'),
|
|
||||||
actions: [
|
|
||||||
// IconButton(icon: Icon(Icons.delete), onPressed: delete),
|
// IconButton(icon: Icon(Icons.delete), onPressed: delete),
|
||||||
IconButton(icon: Icon(Icons.share), onPressed: share),
|
IconButton(icon: Icon(Icons.share), onPressed: share),
|
||||||
],
|
],
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
backgroundColor: Colors.black26,
|
backgroundColor: kOverlayBackground,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -83,13 +98,13 @@ class _FullscreenBottomOverlayState extends State<FullscreenBottomOverlay> {
|
||||||
final viewInsets = mediaQuery.viewInsets;
|
final viewInsets = mediaQuery.viewInsets;
|
||||||
final date = ImageEntry.getBestDate(entry);
|
final date = ImageEntry.getBestDate(entry);
|
||||||
final subRowWidth = min(400.0, screenWidth);
|
final subRowWidth = min(400.0, screenWidth);
|
||||||
return ClipRect(
|
return Blurred(
|
||||||
child: BackdropFilter(
|
child: IgnorePointer(
|
||||||
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
child: Padding(
|
||||||
child: IgnorePointer(
|
padding: EdgeInsets.only(bottom: viewInsets.bottom),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(8.0).add(EdgeInsets.only(bottom: viewInsets.bottom)),
|
padding: EdgeInsets.all(8.0),
|
||||||
color: Colors.black26,
|
color: kOverlayBackground,
|
||||||
child: DefaultTextStyle(
|
child: DefaultTextStyle(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
shadows: [
|
shadows: [
|
||||||
|
@ -130,7 +145,7 @@ class _FullscreenBottomOverlayState extends State<FullscreenBottomOverlay> {
|
||||||
_lastDetails = snapshot.data;
|
_lastDetails = snapshot.data;
|
||||||
}
|
}
|
||||||
return (_lastDetails == null || _lastDetails.isEmpty)
|
return (_lastDetails == null || _lastDetails.isEmpty)
|
||||||
? Text('')
|
? SizedBox.shrink()
|
||||||
: SizedBox(
|
: SizedBox(
|
||||||
width: subRowWidth,
|
width: subRowWidth,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
Loading…
Reference in a new issue