removed unused overlay position options and renamed OverlayEnum to OverlayPositionEnum

This commit is contained in:
ggurdin 2024-08-29 14:36:42 -04:00
parent bf29a324e4
commit 6976c0575d
No known key found for this signature in database
GPG key ID: A01CB41737CBB478
2 changed files with 8 additions and 30 deletions

View file

@ -1617,7 +1617,7 @@ class ChatController extends State<ChatPageWithRoom>
backgroundColor: const Color.fromRGBO(0, 0, 0, 1).withAlpha(200),
closePrevOverlay:
MatrixState.pangeaController.subscriptionController.isSubscribed,
position: OverlayEnum.centered,
position: OverlayPositionEnum.centered,
onDismiss: clearSelectedEvents,
);
}

View file

@ -11,11 +11,9 @@ import '../../config/themes.dart';
import '../../widgets/matrix.dart';
import 'error_handler.dart';
enum OverlayEnum {
enum OverlayPositionEnum {
transform,
centered,
topRight,
bottom,
}
class OverlayUtil {
@ -34,7 +32,7 @@ class OverlayUtil {
Alignment? followerAnchor,
bool closePrevOverlay = true,
Function? onDismiss,
OverlayEnum position = OverlayEnum.transform,
OverlayPositionEnum position = OverlayPositionEnum.transform,
}) {
try {
if (closePrevOverlay) {
@ -53,33 +51,13 @@ class OverlayUtil {
onDismiss: onDismiss,
),
Positioned(
top: (position == OverlayEnum.topRight)
? FluffyThemes.isColumnMode(context)
? 20
: 65
: (position == OverlayEnum.centered)
? 0
: null,
right: (position == OverlayEnum.topRight)
? FluffyThemes.isColumnMode(context)
? 20
: 15
: (position == OverlayEnum.bottom ||
position == OverlayEnum.centered)
? 0
: null,
left: (position == OverlayEnum.bottom)
? 0
: (position == OverlayEnum.centered)
? 0
: null,
bottom: (position == OverlayEnum.bottom ||
position == OverlayEnum.centered)
? 0
: null,
top: (position == OverlayPositionEnum.centered) ? 0 : null,
right: (position == OverlayPositionEnum.centered) ? 0 : null,
left: (position == OverlayPositionEnum.centered) ? 0 : null,
bottom: (position == OverlayPositionEnum.centered) ? 0 : null,
width: width,
height: height,
child: (position != OverlayEnum.transform)
child: (position != OverlayPositionEnum.transform)
? child
: CompositedTransformFollower(
targetAnchor: targetAnchor ?? Alignment.topLeft,