import 'package:flutter_tracker/model/submit_model.dart'; import 'package:flutter_tracker/model/user_model.dart'; /// Description: /// Time : 2021年12月03日 Friday /// Author : liuyuqi.gov@msncn class EntityFactory { static T geneerateObj(dynamic json) { switch (T.toString()) { case "UserModel": return UserModel.fromJson(json) as T; break; case "SubmitModel": return SubmitModel.fromJson(json) as T; break; default: return null; } } }