[ERROR:flutter/lib/ui/ui_dart_state.cc(177] Unhandled Exception: type '_Type' is not a subtype of type 'String' in type cast

报错原因

在写SharedPreferences工具类时使用泛型失误报错

Flutter 报错[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type ‘_Type‘ is not a su
这个地方不能传入泛型,必须传入T的值,

解决办法

Flutter 报错[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: type ‘_Type‘ is not a su
修改为T的值value即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
猜你喜欢
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-09-21
相关资源
相似解决方案