sync AnimatedDialog insets with material

This commit is contained in:
Vadim 2023-02-01 00:13:43 +03:00
parent 31b7528e64
commit 6c08a3d47f
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,5 @@
import 'package:flutter/material.dart';
/// `valueM` represents the base value.
/// All other values differs by 8dp.
class Dimens {
@ -32,4 +34,8 @@ class Dimens {
static const double cameraSliderTrackRadius = cameraSliderTrackHeight / 2;
static const double cameraSliderHandleSize = 32;
static const double cameraSliderHandleIconSize = cameraSliderHandleSize * 2 / 3;
// Dialog
// Taken from `Dialog` documentation
static const EdgeInsets dialogMargin = EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0);
}

View file

@ -93,8 +93,10 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
begin: _closedSize,
end: widget.openedSize ??
Size(
mediaQuery.size.width - mediaQuery.padding.horizontal - Dimens.paddingM * 2,
mediaQuery.size.height - mediaQuery.padding.vertical - Dimens.paddingM * 2,
mediaQuery.size.width -
mediaQuery.padding.horizontal -
Dimens.dialogMargin.horizontal,
mediaQuery.size.height - mediaQuery.padding.vertical - Dimens.dialogMargin.vertical,
),
);
_sizeAnimation = _sizeTween.animate(_defaultCurvedAnimation);