在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:fluttercandies/FlutterJsonBeanFactory开源软件地址:https://github.com/fluttercandies/FlutterJsonBeanFactory开源编程语言:Kotlin 100.0%开源软件介绍:FlutterJsonBeanFactoryHi,Welcome to come to see me! What I do is generate dart beans based on json, as well as generics parameters and json build instances Language: English | 中文(qq群963752388) Easy UseKnown issue
Template ToDo list
Usage
before:
after modification:
import 'generated/json/base/json_convert_content.dart';
class MyJsonConvert extends JsonConvert {
T? asT<T extends Object?>(dynamic value) {
try {
String type = T.toString();
if (type == "DateTime") {
return DateFormat("dd.MM.yyyy").parse(value) as T;
}else{
return super.asT<T>(value);
}
} catch (e, stackTrace) {
print('asT<$T> $e $stackTrace');
return null;
}
}
}
Future<void> main() async {
jsonConvert = MyJsonConvert();
runApp(Text("OK"));
}
Find me useful ? |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论