Kerrinz的魔导书 - 序列化
type: channel
link: https://www.kerrinz.com/tag/%E5%BA%8F%E5%88%97%E5%8C%96/
items: Flutter调用JSON序列化出现type 'String' is not a subtype of type 'MapString, dynamic'
items: Flutter生成JSON序列化模板报错

Flutter调用JSON序列化出现type 'String' is not a subtype of type 'MapString, dynamic'
type: item
date: 2021-05-04T08:28:00+00:00
description: 问题情况本来按照书上的思路都封装好了Dio，半自动生成了Json Model，结果在实际应用上出现了以下异常：Unhandled Exception: type 'String' is not a subtype of type 'Map<String, dynamic>'[...]

Flutter生成JSON序列化模板报错
type: item
date: 2021-05-03T12:55:00+00:00
description: 问题详情：在执行flutter packages pub run build_runner build自动生成JSON序列化模板的时候出现了以下报错：Generator cannot target libraries that have not been migrated to null-safety. package:flutter_test2/model/recommender.dart:6:7 ╷ 6 │ class Recommender { │ ^^^^^^^^^^^ ╵ [INFO] Running build completed, took 1.0s [INFO] Caching finalized dependency graph... [INFO] Caching finalized dependency graph completed, took 41ms [SEVERE] Failed after 1.1s pub finished with exit code 1[...]