flutter_state_view 0.0.9 copy "flutter_state_view: ^0.0.9" to clipboard
flutter_state_view: ^0.0.9 copied to clipboard

flutter state view with loading,empty,error show

flutter_state_view #

flutter state view with loading,empty,error show

使用方法:

    StateView(
      state: state,
      loadingLabel:'加载中...',
      emptyLabel: '空空如也',
      errorLabel: '我错了',
      onRetry: this.onRetry,
      child: Text('成功页面!'),
    ),

快捷使用方法:
//初始化

StateView page;

page = Column(
  mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
  Text(
    'You have pushed the button this many times11:',
  ),
  Text(
    '$_counter',
    style: Theme.of(context).textTheme.headline4,
  ),
],
).center().pageState();

//改变状态:

page.pageStateLoading("加载中...");
Future.delayed(Duration(seconds: 3)).then((value) {
  page.configErrorImage('imgs/empty.png');
  page.pageStateErrorWithRetry("出错了!",(iserror)=>{
    this._incrementCounter()
  });
}); 

效果图如下:
image image image

Getting Started #

2
likes
20
pub points
0%
popularity

Publisher

unverified uploader

flutter state view with loading,empty,error show

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_state_view