@@ -12,6 +12,7 @@ import 'package:gsy_github_app_flutter/widget/base_person_state.dart';
1212import 'package:gsy_github_app_flutter/widget/gsy_common_option_widget.dart' ;
1313import 'package:gsy_github_app_flutter/widget/gsy_pull_load_widget.dart' ;
1414import 'package:gsy_github_app_flutter/widget/gsy_title_bar.dart' ;
15+ import 'package:gsy_github_app_flutter/widget/nested/gsy_nested_pull_load_widget.dart' ;
1516
1617/**
1718 * 个人详情
@@ -99,27 +100,28 @@ class _PersonState extends BasePersonState<PersonPage> {
99100 var focusRes = await UserDao .checkFollowDao (userName);
100101 if (isShow) {
101102 setState (() {
102- focus = (focusRes != null && focusRes.result) ? CommonUtils .getLocale (context).user_focus : CommonUtils .getLocale (context).user_un_focus;
103+ focus = (focusRes != null && focusRes.result)
104+ ? CommonUtils .getLocale (context).user_focus
105+ : CommonUtils .getLocale (context).user_un_focus;
103106 focusStatus = (focusRes != null && focusRes.result);
104107 });
105108 }
106109 }
107110
108-
109111 _getUserName () {
110112 if (userInfo == null ) {
111113 return new User .empty ();
112114 }
113115 return userInfo.login;
114116 }
115117
116-
117118 _getDataLogic () async {
118119 if (userInfo.type == "Organization" ) {
119120 return await UserDao .getMemberDao (_getUserName (), page);
120121 }
121122 getUserOrg (_getUserName ());
122- return await EventDao .getEventDao (_getUserName (), page: page, needDb: page <= 1 );
123+ return await EventDao .getEventDao (_getUserName (),
124+ page: page, needDb: page <= 1 );
123125 }
124126
125127 @override
@@ -137,10 +139,11 @@ class _PersonState extends BasePersonState<PersonPage> {
137139 bool get isRefreshFirst => true ;
138140
139141 @override
140- bool get needHeader => true ;
142+ bool get needHeader => false ;
141143
142144 @override
143145 Widget build (BuildContext context) {
146+ super .build (context);
144147 return new Scaffold (
145148 appBar: new AppBar (
146149 title: GSYTitleBar (
@@ -154,7 +157,8 @@ class _PersonState extends BasePersonState<PersonPage> {
154157 return ;
155158 }
156159 if (userInfo.type == "Organization" ) {
157- Fluttertoast .showToast (msg: CommonUtils .getLocale (context).user_focus_no_support);
160+ Fluttertoast .showToast (
161+ msg: CommonUtils .getLocale (context).user_focus_no_support);
158162 return ;
159163 }
160164 CommonUtils .showLoadingDialog (context);
@@ -163,12 +167,17 @@ class _PersonState extends BasePersonState<PersonPage> {
163167 _getFocusStatus ();
164168 });
165169 }),
166- body: GSYPullLoadWidget (
170+ body: GSYNestedPullLoadWidget (
167171 pullLoadWidgetControl,
168- (BuildContext context, int index) => renderItem (index, userInfo, beStaredCount, null , null , orgList),
172+ (BuildContext context, int index) =>
173+ renderItem (index, userInfo, beStaredCount, null , null , orgList),
169174 handleRefresh,
170175 onLoadMore,
171- refreshKey: refreshIndicatorKey,
176+ refreshKey: refreshIKey,
177+ headerSliverBuilder: (context, _) {
178+ return sliverBuilder (
179+ context, _, userInfo, null , beStaredCount, null );
180+ },
172181 ));
173182 }
174183}
0 commit comments