123456789101112131415161718 |
- 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<T>(dynamic json) {
- switch (T.toString()) {
- case "UserModel":
- return UserModel.fromJson(json) as T;
- case "SubmitModel":
- return SubmitModel.fromJson(json) as T;
- default:
- return null;
- }
- }
- }
|