comicRaisedSurface function
The menu's raised face around design-kit rows, fading in on presence and scrolling past maxSize.
Implementation
Widget comicRaisedSurface(
BuildContext context,
Animation<double> presence,
Size maxSize,
List<Widget> items, {
double width = 320,
}) => AnimatedBuilder(
// Drawn, not faded (law 6): the panel pops in from .92 at full ink and is gone the moment it has closed.
animation: presence,
builder: (context, child) => presence.isDismissed
? const SizedBox.shrink()
: Transform.scale(
scale: .92 + .08 * Curves.easeOutBack.transform(presence.value),
alignment: Alignment.topCenter,
child: child,
),
child: ConstrainedBox(
constraints: BoxConstraints(
maxHeight: maxSize.height,
maxWidth: math.min(width, maxSize.width),
),
child: ComicRaisedFrame(
child: SingleChildScrollView(
child: IntrinsicWidth(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: items,
),
),
),
),
),
);