1 Star 0 Fork 0

郝杰 / CircleIndicateWithScale

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

circle_indicate_with_scale

带刻度的圆形进度条

example

import 'dart:async';

import 'package:circle_indicate_with_scale/custom.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int progress = 0;
  Timer? timer;
  bool isPlay = false;

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

  void _incrementCounter() {
    setState(() {
      isPlay = !isPlay;
    });
    if (isPlay) {
      timer = Timer.periodic(Duration(milliseconds: 200), (timer) {
        setState(() {
          progress += 1;
          if (progress > 100) {
            progress = 0;
          }
          print(progress);
        });
      });
    } else {
      timer?.cancel();
    }
  }

  @override
  void dispose() {
    timer!.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: CircleIndicateWithScale(
        width: 300,
        progress: progress,
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: isPlay ? Icon(Icons.stop) : Icon(Icons.play_arrow),
      ), 
    );
  }
}

空文件

简介

带有刻度的圆形进度条 展开 收起
Dart 等 3 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/haojie_xuexi/circle-indicate-with-scale.git
git@gitee.com:haojie_xuexi/circle-indicate-with-scale.git
haojie_xuexi
circle-indicate-with-scale
CircleIndicateWithScale
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891