Tensegritics / ClojureDart

Clojure dialect for Flutter and Dart
1.38k stars 88 forks source link

`:keep-alive` on `f/widget` #291

Closed cgrand closed 7 months ago

cgrand commented 7 months ago

Ad support for https://api.flutter.dev/flutter/widgets/AutomaticKeepAliveClientMixin-mixin.html or direct notiification of https://api.flutter.dev/flutter/widgets/AutomaticKeepAlive-class.html, whatever is simpler

dupuchba commented 7 months ago
(reify :extends m/StatefulWidget
    :no-meta true
    (createState [_]
      (reify :extends m/State
        :no-meta true
        (build [this ctx]
          (.build ^super this ctx)
          (m/Text "hey"))
        ^:mixin m/AutomaticKeepAliveClientMixin
        (^:getter wantKeepAlive [this] true))))

TODO: handle state and notifications