fluttercandies / FlutterJsonBeanFactory

What I do is generate dart beans based on json, as well as generics parameters and json build instances
Apache License 2.0
566 stars 56 forks source link
dart flutter flutterjson json

FlutterJsonBeanFactory

Hi,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)

打扰:我想找份flutter开发的工作,请问有没有大佬可以帮忙推荐一下,谢谢了,我的邮箱:157418979@qq.com,安卓ios都会撸,不接受做马甲包的工作 打扰:顺便接flutter外包

Easy Use 插件交流群qq(963752388)

image

Known issue

Template ToDo list

Usage

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"));
}

custom generated path->(pubspec.yaml)

flutter_json:
  generated_path: src/json/**

开源不易,觉得有用的话可以请作者喝杯冰可乐🥤

打赏

赞助列表(非常非常的感谢,仅记录此插件收到的打赏,承诺将收到的所有赞助用于购买可乐和赞助其他开源作者)

名称
金额
时间
微信:大熊猫🐱
20元
2024年4月3日
qq:sunny
10元
2023年12月21日
微信:未知
10元
2023年11月17日
QQ:郭嘉
10元 2023年09月12日
QQ:初一
100元 2023年08月15日
Github:cr1992
6.66元 2023年08月4日
QQ:余军
200元 2022年12月

Find me useful ? :heart:


Thanks to JetBrains for allocating free open-source licenses for IDEs such as IntelliJ IDEA.