1010// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
1111//.title~
1212
13- import 'dart:async' show Timer, FutureOr;
14- import 'package:df_log/df_log.dart' show Log;
15- import 'package:df_safer_dart/df_safer_dart.dart' ;
16- import 'package:flutter/foundation.dart' show ValueListenable;
17- import 'package:flutter/widgets.dart' ;
18-
19- import '/src/_src.g.dart' ;
13+ import '/_common.dart' ;
2014
2115// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
2216
@@ -66,6 +60,7 @@ class ResolvablePodListBuilder<T extends Object> extends StatelessWidget {
6660 @override
6761 Widget build (BuildContext context) {
6862 final isSync = podList.every ((e) => e.isSync ());
63+ UNSAFE :
6964 if (isSync) {
7065 return SyncPodListBuilder (
7166 key: key,
@@ -173,9 +168,7 @@ class ForcedAsyncPodListBuilder<T extends Object> extends StatelessWidget {
173168 return FutureBuilder (
174169 future: () async {
175170 return await Future .wait (
176- podList
177- .map ((e) => e.toAsync ().value)
178- .map (
171+ podList.map ((e) => e.toAsync ().value).map (
179172 (e) => () async {
180173 return e;
181174 }(),
@@ -246,8 +239,7 @@ final class PodResultListBuilder<T extends Object> extends StatefulWidget {
246239
247240// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
248241
249- final class PodResultListBuilderState <T extends Object >
250- extends State <PodResultListBuilder <T >> {
242+ final class PodResultListBuilderState <T extends Object > extends State <PodResultListBuilder <T >> {
251243 //
252244 //
253245 //
@@ -289,8 +281,7 @@ final class PodResultListBuilderState<T extends Object>
289281 final key = widget.key;
290282 if (key != null ) {
291283 final cachedValue =
292- PodBuilderCacheManager .i.cacheManager.get (key.toString ())
293- as Iterable <Result <T >>? ;
284+ PodBuilderCacheManager .i.cacheManager.get (key.toString ()) as Iterable <Result <T >>? ;
294285 if (cachedValue != null ) {
295286 _valueList = cachedValue;
296287 return ;
@@ -322,6 +313,7 @@ final class PodResultListBuilderState<T extends Object>
322313 void _addListenerToPods (Iterable <Result <ValueListenable <T >>> pods) {
323314 for (final pod in pods) {
324315 if (pod.isErr ()) continue ;
316+ UNSAFE :
325317 pod.unwrap ().addListener (_valueChanged);
326318 }
327319 }
@@ -333,6 +325,7 @@ final class PodResultListBuilderState<T extends Object>
333325 void _removeListenerFromPods (Iterable <Result <ValueListenable <T >>> pods) {
334326 for (final pod in pods) {
335327 if (pod.isErr ()) continue ;
328+ UNSAFE :
336329 pod.unwrap ().removeListener (_valueChanged);
337330 }
338331 }
@@ -391,8 +384,11 @@ final class PodResultListBuilderState<T extends Object>
391384 Log .err ('Tried to dispose Err<ValueListenable<T>>!' , {#df_pod});
392385 continue ;
393386 }
394- pod.unwrap ().removeListener (_valueChanged);
395- temp.add (pod.unwrap ());
387+ UNSAFE :
388+ {
389+ pod.unwrap ().removeListener (_valueChanged);
390+ temp.add (pod.unwrap ());
391+ }
396392 }
397393 widget.onDispose? .call (temp);
398394 super .dispose ();
@@ -401,8 +397,7 @@ final class PodResultListBuilderState<T extends Object>
401397
402398// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
403399
404- final class PodListBuilderSnapshot <T extends Object >
405- extends OnOptionListSnapshot <T > {
400+ final class PodListBuilderSnapshot <T extends Object > extends OnOptionListSnapshot <T > {
406401 final Option <Iterable <Result <ValueListenable <T >>>> podList;
407402
408403 const PodListBuilderSnapshot ({
@@ -412,10 +407,8 @@ final class PodListBuilderSnapshot<T extends Object>
412407 });
413408}
414409
415- typedef TOnOptionListBuilder <
416- T extends Object ,
417- TSnapshot extends OnOptionListSnapshot <T >
418- > = Widget Function (BuildContext context, TSnapshot snapshot);
410+ typedef TOnOptionListBuilder <T extends Object , TSnapshot extends OnOptionListSnapshot <T >> = Widget
411+ Function (BuildContext context, TSnapshot snapshot);
419412
420413class OnOptionListSnapshot <T extends Object > extends BuilderSnapshot {
421414 final Option <Iterable <Option <Result <T >>>> value;
0 commit comments