fluent2DialogRise function

Widget fluent2DialogRise(
  1. Animation<double> presence,
  2. Widget child
)

child as Fluent's dialog enters on presence: a fade from nothing and a scale from .95 to its size. Under Reduce Motion ui_core's dialog route holds presence at 1 and fades the page itself.

Implementation

Widget fluent2DialogRise(Animation<double> presence, Widget child) =>
    AnimatedBuilder(
      animation: presence,
      builder: (context, child) {
        final p = presence.value.clamp(0.0, 1.0);
        return Opacity(
          opacity: p,
          child: Transform.scale(scale: 0.95 + 0.05 * p, child: child),
        );
      },
      child: child,
    );