# Reversing the dependency between the scheduler and services layer

> The services layer now depends on the scheduler layer.




:::important
These breaking change docs are accurate, as of the release
under which they are published. Over time, the
workarounds described here might become inaccurate.
We don't, in general, keep these breaking change docs up
to date as of each release.

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.
:::


## Summary

The services layer now depends on the scheduler layer.
Previously, the opposite was true. This may affect you
if you have defined custom bindings overriding
Flutter's `SchedulerBinding` or `ServicesBinding`.

## Context

Prior to this change, the scheduler layer was dependent
on the services layer. This change reverses the dependency
chain and allows the services layer to make use of the
scheduling primitives in the scheduler layer. For example,
services in the services layer can now schedule tasks by using
`SchedulerBinding.scheduleTask`.

## Description of change

The change only affects users who are defining their own
custom bindings based on Flutter's `SchedulerBinding`
and `ServicesBinding`.

## Migration guide

Prior to this change, the `ServiceBinding` had to be defined before the
`SchedulerBinding`. With this change, it is the other way around:

Code before migration:

```dart
class FooBinding extends BindingBase with ServicesBinding, SchedulerBinding {
 // ...
}
```

Code after migration:

```dart
class FooBinding extends BindingBase with SchedulerBinding, ServicesBinding {
 // ...
}
```

## Timeline

Landed in version: 1.18.0<br>
In stable release: 1.20

## References

API documentation:

* [`ServicesBinding`][]
* [`SchedulerBinding`][]

Relevant PRs:

* [Reverse dependency between services and scheduler][]
* [Revert bindings dependency workaround][]

[Reverse dependency between services and scheduler]: https://github.com/flutter/flutter/pull/54212
[Revert bindings dependency workaround]: https://github.com/flutter/flutter/pull/54286
[`SchedulerBinding`]: https://api.flutter.dev/flutter/scheduler/SchedulerBinding-mixin.html
[`ServicesBinding`]: https://api.flutter.dev/flutter/scheduler/ServicesBinding-mixin.html

