Flutterやろうよ!!! 5 (536レス)
Flutterやろうよ!!! 5 http://mevius.5ch.net/test/read.cgi/tech/1714961291/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
145: デフォルトの名無しさん (ワッチョイ 9767-1+BE) [] 2024/06/16(日) 08:39:19.15 ID:u7far7aY0 >>139 import 'dart:async'; class A { A(this.str){ sc.add(str); } String str; StreamController sc = StreamController()..stream.listen((newValue){ print(newValue); }); void setAndNotify(String str){ this.str = str; sc.add(str); } } Future<void> wait() async { await Future.delayed(Duration(seconds: 1)); } void main() async { final a = A('test'); await wait(); a.setAndNotify('test2'); await wait(); a.setAndNotify('test3'); await wait(); a.setAndNotify('test4'); } Dart標準機能のStreamControllerで変更通知してますよね? UI側はStreamBuilderが用意されているのでそれで変更検知できますよね。 Dart自体に用意されてないのにDartのサードパーティパッケージでできました、とか無いじゃん。 中を覗いたらDartでやってるんでしょ? http://mevius.5ch.net/test/read.cgi/tech/1714961291/145
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 391 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.012s