Skip to content

v0.17.0

Latest
Compare
Choose a tag to compare
@schultek schultek released this 12 Jan 12:16
· 2 commits to main since this release

jaspr v0.17.0

  • BREAKING Removed currentState from GlobalKey, use GlobalStateKey instead.

  • Added GlobalStateKey<T extends State> to access the state of a component using currentState.

    // Use any State type as the type parameter.
    final GlobalStateKey<MyComponentState> myComponentKey = GlobalStateKey();
    
    /* ... */
    
    // Access the state from the key.
    MyComponentState? state = myComponentKey.currentState;
  • Added GlobalNodeKey<T extends Node> to access native dom nodes using currentNode.

    import 'package:universal_web/web.dart';
    
    // Use any Node type (from package:universal_web) as the type parameter.
    final GlobalNodeKey<HTMLFormElement> myFormKey = GlobalNodeKey();
    
    /* ... */
    
    // Access the dom node from the key.
    HTMLFormElement? node = myFormKey.currentNode;
  • Migrated all web imports from package:web to package:universal_web.

  • Added prefersColorScheme parameter to MediaQuery.