Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

use WidgetsBindingObserver as a mixin #797

Merged
merged 1 commit into from
Sep 26, 2018
Merged

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Sep 26, 2018

This change is fully backwards-compatible. The reason I'm doing it is that Flutter is converting to the new mixin syntax, which forbids extending mixins.

See also: flutter/flutter#22290

@Hixie
Copy link
Contributor

Hixie commented Sep 26, 2018

Hm, this is sad. That class was meant to be usable as a superclass too.

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yjbanov
Copy link
Contributor Author

yjbanov commented Sep 26, 2018

I'm going to submit this PR because it's non-breaking but will unblock the move to mixin syntax if we decide to use it for non-super-mixins too.

@yjbanov
Copy link
Contributor Author

yjbanov commented Sep 26, 2018

I filed dart-lang/language#31 for discussion.

@yjbanov yjbanov merged commit 46b5486 into master Sep 26, 2018
@Hixie
Copy link
Contributor

Hixie commented Sep 27, 2018

I really would rather we didn't do this.

@yjbanov
Copy link
Contributor Author

yjbanov commented Sep 27, 2018

Why not?

@yjbanov
Copy link
Contributor Author

yjbanov commented Sep 27, 2018

(I'm assuming you are referring to this PR and not flutter/flutter#22290 or dart-lang/language#31)

@Hixie
Copy link
Contributor

Hixie commented Sep 27, 2018

Because it's ugly. :-)

We have an ordinary class, and we want to use it as an ordinary superclass... why would we want to use it as a mixin in this case?

WidgetsBindingObserver was intended to be a regular class that in some more advanced cases might be used as a mixin or an interface, something that Dart supports out of the box and is idiomatic. Why would we shy away from that?

@yjbanov
Copy link
Contributor Author

yjbanov commented Sep 27, 2018

I think dart-lang/language#31 (comment) would solve this issue if accepted.

andreidiaconu pushed a commit to andreidiaconu/plugins that referenced this pull request Feb 17, 2019
andreidiaconu added a commit to andreidiaconu/plugins that referenced this pull request Feb 17, 2019
@dnfield dnfield deleted the mixin-WidgetsBindingObserver branch March 23, 2019 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants