@@ -55,6 +55,9 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
5555 if (control.needHeader) {
5656 return (control.dataList.length > 0 ) ? control.dataList.length + 2 : control.dataList.length + 1 ;
5757 } else {
58+ if (control.dataList.length == 0 ) {
59+ return 1 ;
60+ }
5861 return (control.dataList.length > 0 ) ? control.dataList.length + 1 : control.dataList.length;
5962 }
6063 }
@@ -71,6 +74,8 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
7174 return _buildProgressIndicator ();
7275 } else if (control.needHeader && index == _getListCount () - 1 && control.dataList.length != 0 ) {
7376 return _buildProgressIndicator ();
77+ } else if (! control.needHeader && control.dataList.length == 0 ) {
78+ return _buildEmpty ();
7479 } else {
7580 return itemBuilder (context, index);
7681 }
@@ -81,11 +86,31 @@ class _GSYPullLoadWidgetState extends State<GSYPullLoadWidget> {
8186 );
8287 }
8388
89+ Widget _buildEmpty () {
90+ return new Container (
91+ height: MediaQuery .of (context).size.height - 100 ,
92+ child: new Column (
93+ mainAxisAlignment: MainAxisAlignment .center,
94+ children: < Widget > [
95+ FlatButton (
96+ onPressed: () {},
97+ child: new Image (image: new AssetImage ('static/images/logo.png' ), width: 70.0 , height: 70.0 ),
98+ ),
99+ Container (
100+ child: Text (GSYStrings .app_empty, style: GSYConstant .normalText),
101+ ),
102+ ],
103+ ),
104+ );
105+ }
106+
84107 Widget _buildProgressIndicator () {
85108 Widget bottomWidget = (control.needLoadMore)
86109 ? new Row (mainAxisAlignment: MainAxisAlignment .center, children: < Widget > [
87110 new SpinKitRotatingCircle (color: Color (GSYColors .primaryValue)),
88- new Container (width: 5.0 ,),
111+ new Container (
112+ width: 5.0 ,
113+ ),
89114 new Text (
90115 GSYStrings .load_more_text,
91116 style: GSYConstant .smallTextBold,
0 commit comments