Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-5913: null error no such method error method not found get render object on null #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions lib/src/components/overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,30 @@ class _ArDriveDropdownState extends State<ArDriveDropdown> {

@override
void didChangeDependencies() {
if (mounted) {
WidgetsBinding.instance.addPostFrameCallback((_) {
final renderBox = context.findRenderObject() as RenderBox?;
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted) {
return;
}

final position = renderBox?.localToGlobal(Offset.zero);
final renderBox = context.findRenderObject() as RenderBox?;

if (position != null && widget.calculateVerticalAlignment != null) {
final y = position.dy;
final position = renderBox?.localToGlobal(Offset.zero);

final screenHeight = MediaQuery.of(context).size.height;
if (position != null && widget.calculateVerticalAlignment != null) {
final y = position.dy;

Alignment alignment;
final screenHeight = MediaQuery.of(context).size.height;

alignment =
widget.calculateVerticalAlignment!.call(y > screenHeight / 2);
Alignment alignment;

_anchor = Aligned(
follower: alignment,
target: Alignment.bottomLeft,
);
}
});
}
alignment = widget.calculateVerticalAlignment!(y > screenHeight / 2);

_anchor = Aligned(
follower: alignment,
target: Alignment.bottomLeft,
);
}
});

super.didChangeDependencies();
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ardrive_ui
description: UI Design Library for the ArDrive Design System

version: 1.18.0
version: 1.18.1

publish_to: "none"

Expand Down
Loading