Skip to content

Commit

Permalink
fixes build warning while supporting Flutter 2
Browse files Browse the repository at this point in the history
  • Loading branch information
letsar committed May 15, 2022
1 parent 7c126c4 commit c01651f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.1
### Fixed
* Build warning

## 1.2.0
### Added
* A way to automatically close other Slidables within the same group by tapping on them.
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
7 changes: 6 additions & 1 deletion lib/src/auto_close_behavior.dart
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,12 @@ class _SlidableAutoCloseBarrierNotificationSenderState
// while the barrier was still enabled for this group.
// We need to release the barrier.

SchedulerBinding.instance.addPostFrameCallback((Duration _) {
// In Flutter 3, [SchedulerBinding.instance] is not nullable, but since
// we want to support Flutter 2, this is a simple way to do it without
// having a build warning.
// ignore: unnecessary_nullable_for_final_variable_declarations
final SchedulerBinding? schedulerBinding = SchedulerBinding.instance;
schedulerBinding?.addPostFrameCallback((Duration _) {
// We call it in the next frame to avoid to rebuild a widget that is
// already rebuilding.
dispatchSlidableAutoCloseBarrierNotification(enabled: 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: flutter_slidable
description: A Flutter implementation of slidable list item with directional slide actions that can be dismissed.
version: 1.2.0
version: 1.2.1
homepage: https://github.com/letsar/flutter_slidable

environment:
Expand Down

0 comments on commit c01651f

Please sign in to comment.