Skip to content

Conversation

@ymback
Copy link

@ymback ymback commented Apr 3, 2019

Description

Avoid to throw 'not a subtype of type' exception when use custom error widget and sliver.

Related Issues

No issues involved.

Tests

I have not added any tests!

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read [Handling breaking changes]). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

If we use `ErrorWidget.builder` to set a custom error widget, the `_createErrorWidget` function in **sliver.dart** will throw

>Another exception was thrown: type 'AnzongErrorWidget' is not a subtype of type 'ErrorWidget'

because `_createErrorWidget` needs to return `ErrorWidget`, which now is `Widget`, maybe `Center` or any other widgets, and this leads to an empty view instand of our custom error widget.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@ymback
Copy link
Author

ymback commented Apr 3, 2019

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Apr 3, 2019
@Piinks Piinks added the framework flutter/packages/flutter repository. See also f: labels. label Apr 3, 2019
@goderbauer
Copy link
Member

Good catch. Thanks for the contribution.

In order for us to accept the PR, you will have to add a test to ensure that we never break this again. Can you please do that?

@goderbauer goderbauer changed the title Update sliver.dart Fix return type of _createErrorWidget in sliver.dart Apr 3, 2019
@Piinks Piinks added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Apr 4, 2019
@goderbauer
Copy link
Member

@dnfield volunteered to add a test.

dnfield added a commit to dnfield/flutter that referenced this pull request Apr 10, 2019
@dnfield
Copy link
Contributor

dnfield commented Apr 10, 2019

Continued in #30880

@dnfield dnfield closed this Apr 10, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants