Skip to content

Commit

Permalink
fix: SchedulerBinding.instance is now null-safe (#124)
Browse files Browse the repository at this point in the history
* fix: SchedulerBinding.instance is now null-safe

Closes #122.

* sdk: bump flutter version

* fix: github action

Co-authored-by: mockturtl <mockturtl@gmail.com>
  • Loading branch information
daadu and mockturtl authored May 3, 2022
1 parent 949a265 commit fffadfa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
uses: actions/checkout@v2
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
channel: 'beta'
- name: "Install dependencies"
run: flutter pub get && (cd demo && flutter pub get)
- name: "Analyze Dart code"
Expand All @@ -24,10 +26,12 @@ jobs:
uses: actions/checkout@v2
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
channel: 'beta'
- name: "Install dependencies"
run: flutter pub get && (cd demo && flutter pub get)
- name: "Pub Check"
run: pub publish --dry-run
run: dart pub publish --dry-run

check_formatting:
name: "Check code formatting"
Expand All @@ -37,6 +41,8 @@ jobs:
uses: actions/checkout@v2
- name: "Install Flutter"
uses: subosito/flutter-action@v1
with:
channel: 'beta'
- name: "Install dependencies"
run: flutter pub get && (cd demo && flutter pub get)
- name: "Validate Dart formatting"
Expand Down
4 changes: 2 additions & 2 deletions lib/src/scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -710,10 +710,10 @@ class _MeasureSizeState extends State<_MeasureSize> {

@override
Widget build(BuildContext context) {
SchedulerBinding.instance!.addPostFrameCallback((_) => _notify());
SchedulerBinding.instance.addPostFrameCallback((_) => _notify());
return NotificationListener<SizeChangedLayoutNotification>(
onNotification: (_) {
SchedulerBinding.instance!.addPostFrameCallback((_) => _notify());
SchedulerBinding.instance.addPostFrameCallback((_) => _notify());
return true;
},
child: SizeChangedLayoutNotifier(
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ maintainer: Harsh Bhikadia (@daadu)

environment:
sdk: '>=2.12.0 <3.0.0'
flutter: '>=2.12.0-4.0.pre'

dependencies:
flutter:
Expand Down

0 comments on commit fffadfa

Please sign in to comment.