Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
fix get size when build conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed May 16, 2024
2 parents 19ed631 + c84a482 commit fa69768
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1

- Fix bug: get size when build conflict.

## 0.5.0

- Widget size change listener.
Expand Down
6 changes: 5 additions & 1 deletion lib/src/size.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ extension WrapSize on Widget {
return NotificationListener(
onNotification: (notification) {
if (notification is SizeChangedLayoutNotification) {
listener(context.size ?? MediaQuery.of(context).size);
WidgetsBinding.instance.addPostFrameCallback(
(timestamp) => listener(
context.size ?? MediaQuery.of(context).size,
),
);
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: wrap
description: Chain style programming syntax sugar utilities for flutter widgets.
version: 0.5.0
version: 0.5.1
repository: https://github.com/aprosail/wrap
environment: {sdk: ">=3.3.4 <4.0.0", flutter: ">=3.19.6"}
topics:
Expand Down

0 comments on commit fa69768

Please sign in to comment.