[Flutter 實(shí)戰(zhàn)] 自定義加載對話框

在此記錄項(xiàng)目中所遇到問題及解決方案

自定義加載對話框源碼

import 'package:flutter/material.dart';

class LoadingDialog extends Dialog {

  @override
  Widget build(BuildContext context) {
    return new Material(
      type: MaterialType.transparency,
      child: new Center(
        child: new SizedBox(
          width: 100.0,
          height: 100.0,
          child: new Container(
            decoration: ShapeDecoration(
              color: Color(0xffffffff),
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(
                  Radius.circular(8.0),
                ),
              ),
            ),
            child: new Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                new CircularProgressIndicator(),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

調(diào)用

showDialog(context: context,
          builder: (BuildContext context){
            return LoadingDialog();
          });
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Swift1> Swift和OC的區(qū)別1.1> Swift沒有地址/指針的概念1.2> 泛型1.3> 類型嚴(yán)謹(jǐn) 對...
    cosWriter閱讀 11,621評(píng)論 1 32
  • 計(jì)算屬性和監(jiān)視1.4.1. 計(jì)算屬性1)在 computed 屬性對象中定義計(jì)算屬性的方法 2)在頁面中使用{{方...
    咻咻咻滴趙大妞閱讀 287評(píng)論 0 0
  • 1、環(huán)境配置: 平臺(tái)版本:CDH 5.15.1 服務(wù)器資源:VM虛擬機(jī)三臺(tái)(規(guī)格:CPU 2核,內(nèi)存8G,硬盤30...
    芒果布丁Mark閱讀 3,751評(píng)論 0 0
  • 遠(yuǎn)山如霧 淙淙河水 揣著寫給春的情書 匆匆上路 氤氳水汽 與岸邊樹邂逅 將濃濃淡淡的心事 掛滿枝頭 天藍(lán)得耀眼 讓...
    有云心更閑閱讀 503評(píng)論 8 9
  • 悶熱難耐,秋老虎肆虐。 這是“上樂佑尚高中”開學(xué)后的第二個(gè)月。 在校長室里,校長陸清宇看著坐在沙發(fā)上,戴著金邊眼鏡...
    mcy炎閱讀 1,617評(píng)論 0 1

友情鏈接更多精彩內(nèi)容