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

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

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

2019-12-12 00:33:44
字體:
供稿:網(wǎng)友

LinearProgressIndicator控件是質(zhì)感設(shè)計(jì)中的線性進(jìn)度指示器,具體內(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; // 獲取進(jìn)度條描述文本 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ù),效果如下:

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

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 景德镇市| 南乐县| 英吉沙县| 安丘市| 无棣县| 崇文区| 淳化县| 萝北县| 包头市| 扶风县| 泌阳县| 洱源县| 承德市| 团风县| 邯郸县| 白水县| 蓬莱市| 高安市| 衡水市| 大连市| 台东县| 黎平县| 山东省| 青川县| 龙游县| 南投县| 南丰县| 西乌珠穆沁旗| 临猗县| 永宁县| 封丘县| 巫溪县| 综艺| 涿鹿县| 山东省| 华宁县| 阿拉善右旗| 阿鲁科尔沁旗| 关岭| 新兴县| 巴青县|