overlay: fixed border width for low density screens
This commit is contained in:
parent
8b4b88e077
commit
ac1dc99cba
3 changed files with 18 additions and 5 deletions
|
@ -8,6 +8,7 @@ import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/utils/geo_utils.dart';
|
import 'package:aves/utils/geo_utils.dart';
|
||||||
import 'package:aves/widgets/common/fx/blurred.dart';
|
import 'package:aves/widgets/common/fx/blurred.dart';
|
||||||
import 'package:aves/widgets/common/icons.dart';
|
import 'package:aves/widgets/common/icons.dart';
|
||||||
|
import 'package:aves/widgets/fullscreen/overlay/common.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -79,7 +80,7 @@ class _FullscreenBottomOverlayState extends State<FullscreenBottomOverlay> {
|
||||||
final overlayContentMaxWidth = mqWidth - viewPadding.horizontal - innerPadding.horizontal;
|
final overlayContentMaxWidth = mqWidth - viewPadding.horizontal - innerPadding.horizontal;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
color: Colors.black26,
|
color: FullscreenOverlay.backgroundColor,
|
||||||
padding: viewInsets + viewPadding.copyWith(top: 0),
|
padding: viewInsets + viewPadding.copyWith(top: 0),
|
||||||
child: FutureBuilder(
|
child: FutureBuilder(
|
||||||
future: _detailLoader,
|
future: _detailLoader,
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
import 'package:aves/widgets/common/fx/blurred.dart';
|
import 'package:aves/widgets/common/fx/blurred.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class FullscreenOverlay {
|
||||||
|
static const backgroundColor = Colors.black26;
|
||||||
|
|
||||||
|
static BoxBorder buildBorder(BuildContext context) {
|
||||||
|
final subPixel = MediaQuery.of(context).devicePixelRatio > 2;
|
||||||
|
return Border.all(
|
||||||
|
color: Colors.white30,
|
||||||
|
width: subPixel ? 0.5 : 1.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class OverlayButton extends StatelessWidget {
|
class OverlayButton extends StatelessWidget {
|
||||||
final Animation<double> scale;
|
final Animation<double> scale;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
@ -14,10 +26,10 @@ class OverlayButton extends StatelessWidget {
|
||||||
child: BlurredOval(
|
child: BlurredOval(
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.circle,
|
type: MaterialType.circle,
|
||||||
color: Colors.black26,
|
color: FullscreenOverlay.backgroundColor,
|
||||||
child: Ink(
|
child: Ink(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Colors.white30, width: 0.5),
|
border: FullscreenOverlay.buildBorder(context),
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
),
|
),
|
||||||
child: child,
|
child: child,
|
||||||
|
|
|
@ -179,8 +179,8 @@ class VideoControlOverlayState extends State<VideoControlOverlay> with SingleTic
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16) + const EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16) + const EdgeInsets.only(bottom: 16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.black26,
|
color: FullscreenOverlay.backgroundColor,
|
||||||
border: Border.all(color: Colors.white30, width: 0.5),
|
border: FullscreenOverlay.buildBorder(context),
|
||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(progressBarBorderRadius),
|
Radius.circular(progressBarBorderRadius),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue