flutter BlocProvider context that does not contain a Cubit of type #### 錯誤

BlocProvider.of() called with a context that does not contain a Cubit of type ####. 從字面翻譯 可以看到 Cubit 沒有context 上下文調用BlocProvider.of() 官方解決 之後看文檔發現少了個返回值。加個return 就好了 如果還是不行的話,可以嘗試在子類的外面在套個Builder 這樣的話
相關文章
相關標籤/搜索