eitanliu / dart_mappable_plugin

DartMappable(Flutter Json To Dart Converter)
https://plugins.jetbrains.com/plugin/21845
GNU General Public License v3.0
1 stars 1 forks source link

When generating beans using the dart mappable mixin method, the output content of json. encode (bean) includes "\" #1

Closed Clearlove2015 closed 1 week ago

Clearlove2015 commented 2 weeks ago

{ "code": 0, "desc": "success", "data": { "uuid": "7acf6364-ea13-49ee-9c8a-63a231de2608", "username": "jklove", } }

var str = login.toJson(); var bean = LoginMappableMixinBean.fromJson(str); logTAG("===>out: ${json.encode(bean)}");

out content: "{\"code\":0,\"desc\":\"dd\",\"data\":{\"uuid\":\"7acf6364-ea13-49ee-9c8a-63a231de2608\",\"username\":\"jklove\"}}"

eitanliu commented 1 week ago

Can you provide a sample project? I need to know which dependencies are used.

Clearlove2015 commented 1 week ago

Can you provide a sample project? I need to know which dependencies are used.

mappable_mixin.zip

The project is too large to upload, I have compiled the main code of the problem

eitanliu commented 1 week ago

The generated beans determined by dart_mappable, for related issues see https://github.com/schultek/dart_mappable/issues/82.

Other alternatives is use toMap()

logTAG("===>login2 Json: ${json.encode(login2.toMap())}");
Clearlove2015 commented 1 week ago

The generated beans determined by dart_mappable, for related issues see schultek/dart_mappable#82.

Other alternatives is use toMap()

logTAG("===>login2 Json: ${json.encode(login2.toMap())}");

I have read this issue before and think that toMap is not very good, such as the List\<Item> scene