controller top-level property

ServiceWorker? controller

Returns a ServiceWorker object if its state is activated (the same object returned by ServiceWorkerRegistration.active). This property returns null if the request is a force refresh (Shift + refresh) or if there is no active worker.

Implementation

ServiceWorker? get controller => _self!.controller;