Skip to content

Update for flutter 3.0.0 #3

@danjoemybro

Description

@danjoemybro

Flutter 3.0.0 issue

There is a current issue with Flutter 3 where the instance of scheduler binding has become non-nullable. Could a hot-fix be made to this package for the latest update?

The Error:

/usr/local/Caskroom/flutter/2.10.5/flutter/.pub-cache/hosted/pub.dartlang.org/autoscale_tabbarview-1.0.2/lib/src/size_detector_widget.dart:24:22: Warning: Operand of null-aware operation '?.' has type 'SchedulerBinding' which excludes null.
- 'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('/usr/local/Caskroom/flutter/2.10.5/flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
    SchedulerBinding.instance?.addPostFrameCallback((_) => _detectSize());
                     ^

The potential fix:

The line that needs to change is on line 24 within size_detector_widget.dart where the '?' just has to be removed.

From this:

SchedulerBinding.instance?.addPostFrameCallback((_) => _detectSize());

To this:

SchedulerBinding.instance.addPostFrameCallback((_) => _detectSize());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions