Flutter(36):Cupertino组件之CupertinoActivityIndicator

Flutter教学目录持续更新中

Github源代码持续更新中

1.CupertinoActivityIndicator介绍

  • CupertinoActivityIndicator:ios风格的loading
  • CupertinoActivityIndicator.partiallyRevealed:ios loading 风格的进度指示器

2.CupertinoActivityIndicator属性

  • animating = true:是否执行动画
  • radius = _kDefaultIndicatorRadius:loading的大小

3.CupertinoActivityIndicator.partiallyRevealed

  • radius = _kDefaultIndicatorRadius:loading的大小
  • progress = 1.0:进度 0~1
1601870645(1).png
class _CupertinoActivityIndicatorPageState
    extends State {
  _myCupertinoActivityIndicator() {
    return CupertinoActivityIndicator(
      animating: true,
      radius: 20,
    );
  }

  _myCupertinoActivityIndicatorPartiallyRevealed() {
    return CupertinoActivityIndicator.partiallyRevealed(
      radius: 20,
      progress: 0.5,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('CupertinoActivityIndicator'),
      ),
      body: SingleChildScrollView(
        child: ListBody(
          children: [
            _myCupertinoActivityIndicator(),
            _myCupertinoActivityIndicatorPartiallyRevealed(),
          ],
        ),
      ),
    );
  }
}

下一节:Cupertino组件之CupertinoAlertDialog

Flutter(37):Cupertino组件之CupertinoAlertDialog

Flutter教学目录持续更新中

Github源代码持续更新中

你可能感兴趣的:(Flutter(36):Cupertino组件之CupertinoActivityIndicator)