|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
import 'package:ansu_ui/utils/screen_adapter.dart';
|
|
|
|
|
import 'package:ansu_ui/extension/num_extension.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
@ -17,15 +16,17 @@ Future<T> showASPopUpMenu<T>({
|
|
|
|
|
T initValue,
|
|
|
|
|
}) async {
|
|
|
|
|
final RenderBox renderBox = context.findRenderObject();
|
|
|
|
|
Offset offset = renderBox.localToGlobal(Offset.zero);
|
|
|
|
|
Size size = renderBox.size;
|
|
|
|
|
return await showMenu(
|
|
|
|
|
context: context,
|
|
|
|
|
initialValue: initValue,
|
|
|
|
|
position: RelativeRect.fromLTRB(
|
|
|
|
|
offset.dx,
|
|
|
|
|
offset.dy,
|
|
|
|
|
screenWidth,
|
|
|
|
|
screenHeight,
|
|
|
|
|
position: RelativeRect.fromRect(
|
|
|
|
|
Rect.fromPoints(
|
|
|
|
|
renderBox.localToGlobal(Offset.zero,
|
|
|
|
|
ancestor: Overlay.of(context).context.findRenderObject()),
|
|
|
|
|
renderBox.localToGlobal(size.bottomRight(Offset.zero)),
|
|
|
|
|
),
|
|
|
|
|
Offset.zero & Overlay.of(context).context.size,
|
|
|
|
|
),
|
|
|
|
|
items: items,
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: 10.radius),
|
|
|
|
|