cost 205 ms
錯誤:Android studio Flutter BlocBuilder 構建器未檢測到來自 switch case 語句的返回語句

[英]Error: Android studio Flutter BlocBuilder builder not detecting return statement from a switch case statement

來自 flutter blocbuilder 的 switch-case 語句無法識別 return 語句。 我不明白為什么會這樣。 The body might complete normally, causing 'null' to be returned, but the return typ ...

Flutter 應用程序的 BLoC、MVVM、MVC 之間的最佳設計模式是什么?

[英]What is the best design pattern between BLoC, MVVM, MVC for Flutter app?

我打算在 Flutter 為一家公司開發一個管理應用程序,因為我從未使用過這個框架,所以我一直在尋找最佳實踐和設計模式來使用。 該應用程序將與公司的員工管理有關。 主要特點是: 員工資料的管理; 直接在應用程序中上傳文件的可能性; 為參加培訓的員工創建在線測驗; 我正在努力選擇正確的設計模式。 通 ...

如何使 BLoC 實例持久化?

[英]How to make BLoC instance persistent?

我正在使用電影數據庫 API 開發一個應用程序。我想閱讀電影列表,然后選擇一部電影並向用戶顯示詳細信息。 MovieDetailsBloc代碼: 電影列表頁面代碼: MovieDetails頁面代碼: 我將 BLoC 的一個實例從 MovieListPage 傳遞到 MovieDetailsP ...

2023-01-31 13:16:29   1   14    flutter / bloc  
使用 bloc 在 flutter 中發出並行和並發的 SignalR 請求

[英]Making parallel and concurrent SignalR requests in flutter using bloc

使用最新的 flutter bloc 版本,事件是並發處理的。 這是場景。 如何發出並發信號 R 請求並顯示每毫秒所有請求的結果,直到達到特定條件。 這是我所做的。 能夠執行單個信號 R 請求並使用 bloc 獲得結果。 一旦先前的請求完成處理,也能夠執行多個 Signal R 請求。 我需要的在處 ...

使用 Auto_Route 和 BlocListener 顯示對話框

[英]Showing Dialog with Auto_Route and BlocListener

我正在開發一個應用程序,每次用戶關閉設備的 Wifi 和移動數據時都會顯示警報。 我還使用 Auto_Route 進行導航。 到目前為止,這是代碼: 我收到此錯誤: E/flutter ( 9910): [ERROR:flutter/runtime/dart_vm_initializer.cc(4 ...

我可以在 flutter_bloc 構建器中聲明一個 function 嗎?

[英]Can I declare a function inside a flutter_bloc builder?

我正在使用table_calendar flutter package 添加帶有事件的日歷。 我需要聲明一個 function,它使用來自 bloc 的 state。 他的做法有什么問題嗎? 現在它正在工作,但我覺得有一個我想不到的更好的解決方案。class TableView extends S ...

Flutter Hydrated Bloc 總是替換為最初的 state 而不是持續存在

[英]Flutter Hydrated Bloc always replaced with the initial state and not persisting

我正在嘗試使用水合塊來保持我的肘部。 但是經過一番試錯,發現加載的state總是會被初始的state替換 “從 json 獲取”確實獲取了我之前保存的最后一個 state,但它很快就會被初始的 state 替換,因此 state 無法保留。 output 將是: 你可以看到 fromJson 將 ...

Flutter 改變狀態的區塊會移除其他屬性

[英]Flutter bloc changing states will remove other properties

我有一個表單,其中包含 header,用戶可以從圖庫中獲取照片 select 以及具有相同功能的頭像。 然后在下面我有一個用戶名字段,每次用戶寫入時都會觸發 TextfieldChange 事件,如果該字段有錯誤,它將發出 FormError state 如果用戶名有效,它將發出 UsernameL ...

使用 go_router 和 bloc 在 context.pop() 之后刷新視圖

[英]Refreshing a view after context.pop() with go_router and bloc

我對兩個不同的集團有兩種不同的看法。 一頁顯示在第二頁上編輯的數據。 當我在第二頁上從我的 bloc 上傳值並執行 context.pop 返回到第一頁時,第一頁不會重新加載,因為它們是單獨的 bloc,所以沒有注意到任何變化我正在使用 go_router(我不能使用導航器進行導航)我試圖在它返回后 ...

在父集團上收聽多個集團

[英]Listen to multiple blocs on parent bloc

我有一個 MainFormBloc 負責提交表單。 我有一個用戶名和密碼塊,每個都有各自的邏輯。 一旦用戶名有效,用戶名塊將具有 UsernameValid state,密碼一旦有效將具有 PasswordValid state。 我不知道如何實現當用戶名和密碼 bloc 發出有效狀態時 MainF ...

如何在兩個不同的路由(屏幕)之間正確設置 BlocProvider?

[英]How to set correctly the BlocProvider between two different routes (screens)?

我正在為我的應用程序使用Bloc ,但是我做錯了什么,也就是說,提供了在MaterialApp中創建的所有 BlocProvider,我不想遵循這種不好的做法。 假設當我導航到ScreenA時,我們按如下方式創建Bloc : case PageNames.screenA: ...

Flutter 帶 BLOC 和存儲庫模式的工作管理器

[英]Flutter workmanager with BLOC and repository pattern

賞金將在 6 天后到期。 此問題的答案有資格獲得+400聲望賞金。 Александр Инженер想提請更多人關注這個問題。 我使用bloc和repository pattern 。 有一個需要按照調度在后台執行代碼,為此我使用了workmanager問題是workmanager是在一個單獨 ...

FLUTTER - 即使使用 copyWith() 和 equatable,BLOC 也不會更新 state

[英]FLUTTER -BLOC is not updating state even with copyWith() and equatable

我為類似功能的單選按鈕創建了一個事件,用戶一次只能 select 一個元素。 但是當我將事件觸發到 select 的值時,它不會更新 state,但是列表會更新。 這是我的塊文件 這是事件 class 這是 state class 這是我在 UI 中調用 bloc 的方式。 每當我點擊單選按鈕時, ...

如何在 Flutter Cubit 架構中管理 state 大小?

[英]How do I manage state size in Flutter Cubit architecture?

我有一個屏幕顯示資產的股票價值資產選擇下拉菜單現在,我將所有這些值放在一個 State class 中: 我應該將這個 State class 分成幾個較小的 State Cubit 架構中的類嗎? 例如,資產列表似乎與選擇信息無關。 我應該將屏幕使用的所有變量都保留在一個 state 中,還是應 ...

在 cubit (Flutter) 中訪問構建上下文

[英]Access the build context in a cubit (Flutter)

主要問題您好,在 Flutter 中,我使用的是 BLoC,更具體地說是 cubits。 管理我的應用程序的 state。 我的weather_state.dart文件中有幾個州: 天氣初始天氣加載天氣預報天氣錯誤對於后者,我想在發出 state 時傳遞一條錯誤消息,正如您在此方法中看到的那樣,來自 ...

Flutter:根據父BLOC的state重置子BLOC的state

[英]Flutter: Reset state of child BLOC depending of state of parent BLOC

當父 BLOC 的 state 更改時,我需要重置子 BLOC 的 state。 假設我有一個由ChildBloc管理的圖像,它具有圖像縮放方法(因此ChildBloc.state具有scale屬性)。 當用戶縮放圖像時,當前scale保存在ChildBloc state 中並持久存在。 當用戶離 ...

如何依賴父BLOC保留子BLOC的state?

[英]How to keep state of child BLOC depending on parent BLOC?

如果一個 BLOC 可以與其他相關的 BLOC 一起工作,我需要一個建議或魔法踢。 我有這個結構building -> floors -> floorplan 。 所以我有三個 BLOCclass BuildingBloc extends Bloc { // .. exposes ...

Flutter BLoC 我需要主題作為初始值

[英]Flutter BLoC I need Theme for init value

在我的 app.dart 里面,我有我的 BlocProviders: 在我的 BlocProviders 之后,我有了 MaterialApp。 問題是:對於 SysUiCubit,我需要當前主題的 state,就像我試圖在引號內可視化一樣。 最簡單的方法是在我的 BlocProvider 之前使 ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM