• Ian Hickson's avatar
    Refactor service extensions (#3397) · 261923e5
    Ian Hickson authored
    Bindings now have a debugRegisterServiceExtensions() method that is
    invoked in debug mode (only). (Once we have a profile mode, there'll be
    a registerProfileServiceExtensions() method that gets called in that
    mode only to register extensions that apply then.)
    
    The BindingBase class provides convenience methods for registering
    service extensions that do the equivalent of:
    
    ```dart
    void extension() { ... }
    bool extension([bool enabled]) { ... }
    double extension([double extension])  { ... }
    Map<String, String> extension([Map<String, String> parameters]) { ... }
    ```
    
    The BindingBase class also itself registers ext.flutter.reassemble,
    which it has call a function on the binding called
    reassembleApplication().
    
    The Scheduler binding now exposes the preexisting
    ext.flutter.timeDilation.
    
    The Renderer binding now exposes the preexisting ext.flutter.debugPaint.
    
    The Renderer binding hooks reassembleApplication to trigger the
    rendering tree to be reprocessed (in particular, to fix up the
    optimisation closures).
    
    All the logic from rendering/debug.dart about service extensions is
    replaced by the above.
    
    I moved basic_types to foundation.
    
    The FlutterWidgets binding hooks reassembleApplication to trigger the
    widget tree to be entirely rebuilt.
    
    Flutter Driver now uses ext.flutter.driver instead of
    ext.flutter_driver, and is hooked using the same binding mechanism.
    Eventually we'll probably move the logic into the Flutter library so
    that you just get it without having to invoke a special method first.
    261923e5
foundation.dart 542 Bytes