mirror of
https://github.com/nini22P/iris.git
synced 2026-06-20 17:46:08 +08:00
25 lines
705 B
Dart
25 lines
705 B
Dart
import 'dart:math';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:popover/popover.dart';
|
|
|
|
Future<void> showCustomMenu(
|
|
BuildContext context, {
|
|
required List<Widget> items,
|
|
double? width = 128,
|
|
}) async =>
|
|
showPopover(
|
|
context: context,
|
|
bodyBuilder: (context) => SingleChildScrollView(
|
|
child: Column(children: items),
|
|
),
|
|
width: width,
|
|
height: min(MediaQuery.of(context).size.height * 0.75,
|
|
items.length * kMinInteractiveDimension),
|
|
radius: 16,
|
|
arrowHeight: 0,
|
|
arrowWidth: 0,
|
|
backgroundColor:
|
|
Theme.of(context).colorScheme.surfaceDim.withValues(alpha: 0.9),
|
|
barrierColor: Colors.transparent,
|
|
);
|