国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

Flutter質(zhì)感設(shè)計之進度條

2019-10-21 21:40:19
字體:
供稿:網(wǎng)友

LinearProgressIndicator控件是質(zhì)感設(shè)計中的線性進度指示器,具體內(nèi)容如下

import 'package:flutter/material.dart';class ActionViewEcology extends StatelessWidget { /*  * 構(gòu)建函數(shù),傳遞參數(shù)  * 最大能量值  * 最大饑餓值  * 最大情緒值  * 當(dāng)前能量值  * 當(dāng)前饑餓值  * 當(dāng)前情緒值  */ ActionViewEcology({  this.maximumEmergy,  this.maximumHunger,  this.maximumMood,  this.currentEmergy,  this.currentHunger,  this.currentMood, }); int maximumEmergy; int maximumHunger; int maximumMood; int currentEmergy; int currentHunger; int currentMood; // 獲取進度條描述文本 Align _getNameText(BuildContext context, String text) {  return new Align(   alignment: FractionalOffset.topLeft,   child: new Text(    text,    style: new TextStyle(     fontSize: 15.0,     color: Colors.black,     height: 1.5,    )   )  ); } @override Widget build(BuildContext context) {  return new Container(   margin: const EdgeInsets.fromLTRB(17.0, 0.0, 17.0, 10.0),   child: new Column(    children: <Widget> [     _getNameText(context, '能量($currentEmergy/$maximumEmergy)'),     new LinearProgressIndicator(value: currentEmergy/maximumEmergy),     _getNameText(context, '饑餓($currentHunger/$maximumHunger)'),     new LinearProgressIndicator(value: currentHunger/maximumHunger),     _getNameText(context, '心情($currentMood/$maximumMood)'),     new LinearProgressIndicator(value: currentMood/maximumMood),    ]   )  ); }}

在main.dart中調(diào)用上面的ActionViewEcology類,傳入相關(guān)參數(shù),效果如下:

Flutter,進度條

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持VEVB武林網(wǎng)。


注:相關(guān)教程知識閱讀請移步到Android開發(fā)頻道。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 南川市| 黎城县| 台东市| 安宁市| 呼图壁县| 吴旗县| 中卫市| 南部县| 菏泽市| 东港市| 潼南县| 洛隆县| 吕梁市| 洪泽县| 拉萨市| 七台河市| 芒康县| 伊宁县| 娱乐| 平潭县| 碌曲县| 山东| 南京市| 微博| 吴旗县| 南汇区| 雅安市| 偏关县| 南丹县| 张家口市| 横峰县| 新竹市| 塔河县| 上栗县| 田东县| 固镇县| 禄丰县| 紫阳县| 崇义县| 盐源县| 会泽县|