Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert bindings dependency workaround #54286

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 1 addition & 24 deletions packages/flutter/lib/src/foundation/binding.dart
Expand Up @@ -6,7 +6,7 @@ import 'dart:async';
import 'dart:convert' show json;
import 'dart:developer' as developer;
import 'dart:io' show exit;
import 'dart:ui' as ui show AppLifecycleState, saveCompilationTrace, Window, window;
import 'dart:ui' as ui show saveCompilationTrace, Window, window;
// Before adding any more dart:ui imports, please read the README.

import 'package:meta/meta.dart';
Expand Down Expand Up @@ -552,29 +552,6 @@ abstract class BindingBase {
});
}

// TODO(goderbauer): Remove the next two members after the service/scheduler dependencies
// have been turned around.

/// Whether the application is visible, and if so, whether it is currently
/// interactive.
///
/// This is set by [handleAppLifecycleStateChanged] when the
/// [SystemChannels.lifecycle] notification is dispatched.
///
/// The preferred way to watch for changes to this value is using
/// [WidgetsBindingObserver.didChangeAppLifecycleState].
ui.AppLifecycleState get lifecycleState => null;

/// Called when the application lifecycle state changes.
///
/// Notifies all the observers using
/// [WidgetsBindingObserver.didChangeAppLifecycleState].
///
/// This method exposes notifications from [SystemChannels.lifecycle].
@protected
@mustCallSuper
void handleAppLifecycleStateChanged(ui.AppLifecycleState state) { }

@override
String toString() => '<${objectRuntimeType(this, 'BindingBase')}>';
}
Expand Down
5 changes: 2 additions & 3 deletions packages/flutter/lib/src/scheduler/binding.dart
Expand Up @@ -299,7 +299,6 @@ mixin SchedulerBinding on BindingBase {
///
/// The preferred way to watch for changes to this value is using
/// [WidgetsBindingObserver.didChangeAppLifecycleState].
@override
AppLifecycleState get lifecycleState => _lifecycleState;
AppLifecycleState _lifecycleState;

Expand All @@ -309,9 +308,9 @@ mixin SchedulerBinding on BindingBase {
/// [WidgetsBindingObserver.didChangeAppLifecycleState].
///
/// This method exposes notifications from [SystemChannels.lifecycle].
@override
@protected
@mustCallSuper
void handleAppLifecycleStateChanged(AppLifecycleState state) {
super.handleAppLifecycleStateChanged(state);
assert(state != null);
_lifecycleState = state;
switch (state) {
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/services/binding.dart
Expand Up @@ -19,7 +19,7 @@ import 'system_channels.dart';
/// the licenses found in the `LICENSE` file stored at the root of the asset
/// bundle, and implements the `ext.flutter.evict` service extension (see
/// [evict]).
mixin ServicesBinding on BindingBase {
mixin ServicesBinding on BindingBase, SchedulerBinding {
@override
void initInstances() {
super.initInstances();
Expand Down
6 changes: 0 additions & 6 deletions packages/flutter/test/painting/binding_test.dart
Expand Up @@ -86,12 +86,6 @@ class TestBindingBase implements BindingBase {

@override
ui.Window get window => throw UnimplementedError();

@override
ui.AppLifecycleState get lifecycleState => null;

@override
void handleAppLifecycleStateChanged(ui.AppLifecycleState state) { }
}

class TestPaintingBinding extends TestBindingBase with SchedulerBinding, ServicesBinding, PaintingBinding {
Expand Down