Skip to content

Commit

Permalink
体系名称修改structure
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixsky committed Aug 23, 2019
1 parent 9122c49 commit 97a450d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions lib/ui/page/article_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:fun_android/ui/widget/like_animation.dart';
import 'package:fun_android/provider/view_state_widget.dart';
import 'package:fun_android/ui/widget/article_list_Item.dart';
import 'package:fun_android/view_model/colletion_model.dart';
import 'package:fun_android/view_model/tree_model.dart';
import 'package:fun_android/view_model/structure_model.dart';


/// 文章列表页面
Expand Down Expand Up @@ -38,8 +38,8 @@ class _ArticleListPageState extends State<ArticleListPage>
builder: (context, collectionAnimationModel, child) => Stack(
children: <Widget>[child, LikeAnimatedWidget()],
),
child: ProviderWidget<TreeListModel>(
model: TreeListModel(widget.cid),
child: ProviderWidget<StructureListModel>(
model: StructureListModel(widget.cid),
onModelReady: (model) => model.initData(),
builder: (context, model, child) {
if (model.busy) {
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/page/tab/structure_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:fun_android/model/navigation_site.dart';
import 'package:fun_android/model/tree.dart';
import 'package:fun_android/provider/provider_widget.dart';
import 'package:fun_android/provider/view_state_widget.dart';
import 'package:fun_android/view_model/tree_model.dart';
import 'package:fun_android/view_model/structure_model.dart';

/// 体系
class StructurePage extends StatefulWidget {
Expand Down Expand Up @@ -56,8 +56,8 @@ class _TreeCategoryListState extends State<TreeCategoryList>
@override
Widget build(BuildContext context) {
super.build(context);
return ProviderWidget<TreeCategoryModel>(
model: TreeCategoryModel(),
return ProviderWidget<StructureCategoryModel>(
model: StructureCategoryModel(),
onModelReady: (model) {
model.initData();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@ import 'package:fun_android/provider/view_state_refresh_list_model.dart';
import 'package:fun_android/provider/view_state_list_model.dart';
import 'package:fun_android/service/wan_android_repository.dart';

class TreeCategoryModel extends ViewStateListModel {
class StructureCategoryModel extends ViewStateListModel {
@override
Future<List> loadData() async {
return await WanAndroidRepository.fetchTreeCategories();
}
}

class TreeListModel extends ViewStateRefreshListModel {
class StructureListModel extends ViewStateRefreshListModel {
final int cid;

TreeListModel(this.cid);
StructureListModel(this.cid);

@override
Future<List> loadData({int pageNum}) async {
return await WanAndroidRepository.fetchArticles(pageNum, cid: cid);
}

@override
void dispose() {
super.dispose();
}
}

/// 网址导航
Expand Down

0 comments on commit 97a450d

Please sign in to comment.