@@ -6,13 +6,14 @@ import 'package:fluttertoast/fluttertoast.dart';
66import 'package:get_version/get_version.dart' ;
77import 'package:gsy_github_app_flutter/common/config/Config.dart' ;
88import 'package:gsy_github_app_flutter/common/dao/DaoResult.dart' ;
9+ import 'package:gsy_github_app_flutter/common/model/Event.dart' ;
10+ import 'package:gsy_github_app_flutter/common/model/RepoCommit.dart' ;
911import 'package:gsy_github_app_flutter/common/net/Address.dart' ;
1012import 'package:gsy_github_app_flutter/common/net/Api.dart' ;
1113import 'package:gsy_github_app_flutter/common/net/trending/GithubTrending.dart' ;
1214import 'package:gsy_github_app_flutter/common/style/GSYStyle.dart' ;
1315import 'package:gsy_github_app_flutter/common/utils/CommonUtils.dart' ;
1416import 'package:gsy_github_app_flutter/page/RepositoryFileListPage.dart' ;
15- import 'package:gsy_github_app_flutter/widget/EventItem.dart' ;
1617import 'package:gsy_github_app_flutter/widget/PushCoedItem.dart' ;
1718import 'package:gsy_github_app_flutter/widget/PushHeader.dart' ;
1819import 'package:gsy_github_app_flutter/widget/ReleaseItem.dart' ;
@@ -85,13 +86,13 @@ class ReposDao {
8586 String url = Address .getReposEvent (userName, reposName) + Address .getPageParams ("?" , page);
8687 var res = await HttpManager .netFetch (url, null , null , null );
8788 if (res != null && res.result) {
88- List <EventViewModel > list = new List ();
89+ List <Event > list = new List ();
8990 var data = res.data;
9091 if (data == null || data.length == 0 ) {
9192 return new DataResult (null , false );
9293 }
9394 for (int i = 0 ; i < data.length; i++ ) {
94- list.add (EventViewModel . fromEventMap (data[i]));
95+ list.add (Event . fromJson (data[i]));
9596 }
9697 return new DataResult (list, true );
9798 } else {
@@ -118,13 +119,13 @@ class ReposDao {
118119 String url = Address .getReposCommits (userName, reposName) + Address .getPageParams ("?" , page) + "&sha=" + branch;
119120 var res = await HttpManager .netFetch (url, null , null , null );
120121 if (res != null && res.result) {
121- List <EventViewModel > list = new List ();
122+ List <RepoCommit > list = new List ();
122123 var data = res.data;
123124 if (data == null || data.length == 0 ) {
124125 return new DataResult (null , false );
125126 }
126127 for (int i = 0 ; i < data.length; i++ ) {
127- list.add (EventViewModel . fromCommitMap (data[i]));
128+ list.add (RepoCommit . fromJson (data[i]));
128129 }
129130 return new DataResult (list, true );
130131 } else {
0 commit comments