在 Flutter 使用 LinearProgressIndicator 表示進(jìn)度條組件。
// 條形進(jìn)度條
new LinearProgressIndicator(
backgroundColor: Colors.blue,
// value: 0.2,
valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
),
new Container(padding: const EdgeInsets.all(20.0)),
// 圓形進(jìn)度條
new CircularProgressIndicator(
strokeWidth: 4.0,
backgroundColor: Colors.blue,
// value: 0.2,
valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
),
如果 value 為 null 或空,則顯示一個(gè)動(dòng)畫(huà),否則顯示一個(gè)定值。Progress 的值只能設(shè)置 0 ~ 1.0,如果大于 1,則表示已經(jīng)結(jié)束。
