![](/img/trans.png)
[英]How to change variable value in flutter with bloc?
想問的是如何用stream flutter改變變量值? 你認為我的問題很基礎,我可以在 inte.net 上到處搜索。 但是在 stream 的這種情況下,我無法使用方法更改變量值。 我需要怎么做? 請指導我。 我將舉例說明。 在這里,這是帶有 rxDart 的 bloc class 代碼。 上面 ...
[英]How to change variable value in flutter with bloc?
想問的是如何用stream flutter改變變量值? 你認為我的問題很基礎,我可以在 inte.net 上到處搜索。 但是在 stream 的這種情況下,我無法使用方法更改變量值。 我需要怎么做? 請指導我。 我將舉例說明。 在這里,這是帶有 rxDart 的 bloc class 代碼。 上面 ...
[英]In which method, should call state management methods of the class in Flutter bloc with rxdart?
首先我想問一下state管理方法應該從Stateful widget的哪個方法調用。 我需要選擇兩個地方init()方法或build() 。 我不完全知道調用 state 管理方法哪種方法合適。 讓我試着用例子來解釋我的問題。 我使用rxdart進行依賴注入,使用Stream並使用bloc模式構建 ...
[英]TextFormField value resets back to initialValue inside a StreamBuilder in a scrollable ListView
我在可滾動 ListView 的 StreamBuilder 中使用 TextFormField 時遇到問題。 當 ListView 上下滾動時,它會銷毀並重建一些孩子。 當 StreamBuilder 小部件由於流的異步特性而自行重建時,它會啟動兩次 StreamBuilder 構建函數調用。 ...
[英]Flutter Bloc: How to implement bloc to bloc communication
在項目中,我有一個帶有 HomeBloc 的主頁(包含電影數據列表)。 單擊單個電影單元格后,我導航到具有 MovieDetailsBloc 的電影詳細信息頁面。 現在在詳細信息頁面中我可以編輯名稱或將電影設為收藏等,這需要反映在主頁中。 要在電影詳細信息頁面更改后更新主頁,我將 HomeBloc ...
[英]flutter missing stream events, but dart cli receives all events
我有一個有點復雜的工作處理 stream 我沒有得到 flutter 中的所有事件,但我在 cli 中做到了。 我有一個復制品,在那里我模擬了這項工作。 基本上,工作項是分批下載的。 每個項目大約需要一秒鍾的時間來處理,但 dart 將所有異步工作卸載到操作系統; 因此,我使用 rxdart fla ...
[英]How can I do contextless navigation in order to move to a maintenance screen in Flutter?
我有一個維護 controller,它初始化了一個可觀察變量,只要該變量為true ,它就會導航到維護屏幕,當變量設置為 false 時,它會按如下方式導航回來: 一切正常,但我在日志中得到以下異常: app.dart: 我嘗試添加navigatorKey: Get.key並使用navigato ...
[英]The event I am dispatching is not called in the Bloc
我是 Flutter 中的 Bloc 模式的新手。 我開始將它與freezed的 package 結合使用。 但是我的事件不是從集團內部調用的(或者根本沒有調度) 以下是我所擁有的, State 事件 集團 語言 Model 我如何提供集團 我如何調度事件 ** 無論我多么努力,我使用行cont ...
[英]Execute a method if stream has the right value in it | Flutter | RxDart
假設我有一個 stream (A),它可以得到:SuccessModel 或 FailureModel。 我使用 StreamBuilder 訂閱了這個 stream A,如果這個 stream 包含 SuccessModel,我只想路由到下一頁,如果它包含 FailureModel,則留在同一頁 ...
[英]CombineLatestStream.combine2 combiner never gets called
我正在嘗試合並我的實體的兩個流Category和Menu 。 我嘗試過這種方式,但似乎組合器永遠不會被執行(注意里面有print語句,它從不打印)。 我很確定我正確地遵循了rxdart 的 API 文檔上的示例片段。 並且能夠通過將stream() function 直接綁定到 observable ...
[英]Fetch all the values ever passed to sink.add in Flutter stream
假設我們要創建一個包含 Map<String, String> 的流。 現在要注意的是,我想創建一個函數,將新的鍵值對添加到這個 Map<String, String> 流中。 例如, 現在調用 sink addConfigMap 將只接受一個新的地圖。 但我在這里的要 ...
[英]rxdart BehaviorSubject unpredictable behavior
我開始使用BehaviorSubject 類 因為我需要廣播流和 一個特殊的 StreamController 捕獲已添加到控制器的最新項目,並將其作為第一個項目發送給任何新的偵聽器。 下面的測試代碼: 結果: 雖然我需要即時偵聽流的存儲值的行為,但結果順序對我來說是不可預測的。 ...
[英]Assert all the items emitted by a Stream in order until it is canceled in Dart?
有什么方便的方法可以斷言Stream發出的所有項目,直到它被取消? 如果我使用: expectLater( stream, emitsInOrder(<String>[ 'item1', 'item2', ]), ); 並且Stream發出['item1 ...
[英]rxdart BehaviorSubject emits previous events and not only last value
我對 rxdart BehaviorSubject有一個奇怪的問題。 通常 BehaviorSubject 應該只向 stream 發出最后一個值: 一個特殊的 StreamController 捕獲已添加到 controller 的最新項目,並將其作為第一個項目發送給任何新的偵聽器。 但在我的情況 ...
[英]Flutter stream value is not null while transformation should make it null when error happens
有一個可能不正確的流,因此我將在轉換過程中下沉添加 null。 但轉換變化不會影響 BehaviourSubject.value 或 BehaviourSubject.stream.value 當我從我的流中創建一個對象時,它的值是錯誤的。 顯然,該值在轉換函數中被設為 null 似乎並不感興趣 ...
[英]Remove Streams from CombineLatestStream - RxDart
我在用: 提供程序包 - StreamProvider RxDart 包 - CombineLatestStream Firebase 實時數據庫 - onValue Stream 代碼功能 我從應用程序開頭聲明的提供程序獲取所有FrediUserGroup數據。 ...
[英]StreamBuilder that waits for a stream on a future to emit
我需要上面的代碼保持在加載狀態,直到store.map$有一個發射(發生在提供程序類底部的findVgnItms()中)。 所以它本質上是一個 StreamBuilder 等待未來的流發出。 這是怎么做的? 我期待這個: ref.watch(findStoreProvider)被轉換為流並與st ...
[英]Flutter check if stream is empty before close end
我使用BehaviorSubject作為流控制器。 在我的一個函數中,我只想在.add沒有事件的情況下添加更多項目。 isEmpty屬性在 Stream 結束時返回一個值。 我想在 Stream 仍在運行時檢查它。 我怎么做? ...
[英]Combining flutter bloc forEach() with another await
想象一下,我有一個(設計的)state,看起來像這樣: name的來源來自單個(異步)API 調用,但address字段值來自 stream。從概念上講,該集團可能會發出以下內容: 接收這些狀態的屏幕完全能夠根據name和address的存在(或不存在)來呈現自己。 我可以看到有emit.forE ...
[英]Bloc Concurrency with restartable transformer does not cancel previous event
描述 具有可重新啟動變壓器的 Bloc 並發不會取消先前的事件 重現步驟 偵聽事件MerchantProductCartChanged並發出狀態MerchantProductCartChange的 bloc 文件merchant_product_bloc.dart class MerchantPro ...
[英]How to write RxJs Angular code into RxDart
我如何在 Flutter RxDart 中編寫以下 RxJs Angular 代碼。 } ...