精品欧美一区二区三区在线观看 _久久久久国色av免费观看性色_国产精品久久在线观看_亚洲第一综合网站_91精品又粗又猛又爽_小泽玛利亚一区二区免费_91亚洲精品国偷拍自产在线观看 _久久精品视频在线播放_美女精品久久久_欧美日韩国产成人在线

為前端工程師準備的Flutter入門指南

開發 前端 Android
在接下來的章節中,我們仔細來對比下平時用 HTML/CSS 代碼所實現的效果,如果替換為等價的 Flutter/Dart 代碼,會是什么樣子。

如果你恰好是一名前端工程師,且對 Flutter 抱有興趣,那么真的是太好了,這篇文章完全就是為你準備的。寫慣了 HTML、CSS 與 JavaScript,要不要來是試試 Dart?如果你不熟悉 Flutter 但仍對其感興趣,可以先看看「讓我們在2019年重新認識 Flutter」一文了解些 Flutter 基礎。

在接下來的章節中,我們仔細來對比下平時用 HTML/CSS 代碼所實現的效果,如果替換為等價的 Flutter/Dart 代碼,會是什么樣子。

為前端工程師準備的Flutter入門指南

本文結構如下:

  1. 基礎布局
  2. 位置與大小
  3. 圖形/形狀
  4. 文本

注:本文只摘錄 Web 到 Flutter 中一些特性的轉換介紹,詳細及完整的使用方法與語法請查閱 Flutter/Dart 官網 https://flutter.io, https://flutter.cn 與 https://www.dartlang.org.

本文示例中默認已包含如下假設:

HTML 文件均會以 開頭,且為了與 Flutter 模型保持一致,所有 HTML 元素的 CSS 盒模型被設置為 border-box。 

  1.   box-sizing: border-box; 

在 Flutter 中,為了保持語法簡潔,示例中所用的 “Lorem ipsum” 文本的默認樣式由如下 bold24Roboto 變量定義: 

  1. TextStyle bold24Roboto = TextStyle( 
  2.   color: Colors.white, 
  3.   fontSize: 24.0, 
  4.   fontWeight: FontWeight.w900, 
  5. ); 

Flutter UI 采用聲明式編程,欲了解其與傳統命令式風格的不同,請查閱聲明式 UI 介紹。

一、基礎布局

先來看看最常見的一些 UI 布局操作。

1.1 文本樣式與對齊

我們在 CSS 中設置的字體樣式、大小以及其他文本屬性,都是 Flutter 中一個 Text widget 子元素 TextStyle 中單獨的屬性。

In both HTML and Flutter, child elements or widgets are anchored at the top left, by default.

不論是 HTML 還是 Flutter,子元素或者 widget 都默認錨定在左上方。

Web 

  1. <div class="greybox"
  2.     Lorem ipsum 
  3. </div> 
  4.  
  5. .greybox { 
  6.   background-color: #e0e0e0; /* grey 300 */ 
  7.   width: 320px; 
  8.   height: 240px; 
  9.   font: 900 24px Georgia; 

Dart 

  1. var container = Container( // grey box 
  2.   child: Text( 
  3.     "Lorem ipsum"
  4.     style: TextStyle( 
  5.       fontSize: 24.0, 
  6.       fontWeight: FontWeight.w900, 
  7.       fontFamily: "Georgia"
  8.     ), 
  9.   ), 
  10.   width: 320.0, 
  11.   height: 240.0, 
  12.   color: Colors.grey[300], 
  13. ); 

1.2 背景顏色

在 Flutter 中,你可以通過 Container 的 decoration 屬性來設置背景顏色。

CSS 示例中我們使用等價的十六進制顏色表示。

Web 

  1. <div class="greybox"
  2.   Lorem ipsum 
  3. </div> 
  4.  
  5. .greybox { 
  6.   background-color: #e0e0e0;  /* grey 300 */ 
  7.   width: 320px; 
  8.   height: 240px; 
  9.   font: 900 24px Roboto; 

Dart 

  1. var container = Container( // grey box 
  2.     child: Text( 
  3.       "Lorem ipsum"
  4.       style: bold24Roboto, 
  5.     ), 
  6.     width: 320.0, 
  7.     height: 240.0, 
  8.     color: Colors.grey[300], 
  9.   ); 

1.3 居中元素

在 Flutter 中,Center widget 可以將它的子元素水平和垂直居中。

要用 CSS 實現相似的效果,其父元素則需要使用一個 flex 或者 table-cell 顯示布局。本節示例使用的是 flex 布局。

Web 

  1. <div class="greybox"
  2.   Lorem ipsum 
  3. </div> 
  4.  
  5. .greybox { 
  6.   background-color: #e0e0e0; /* grey 300 */ 
  7.   width: 320px; 
  8.   height: 240px; 
  9.   font: 900 24px Roboto; 
  10.   display: flex; 
  11.   align-items: center; 
  12.   justify-content: center;  

Dart 

  1. var container = Container( // grey box 
  2.   child:  Center( 
  3.     child:  Text( 
  4.       "Lorem ipsum"
  5.       style: bold24Roboto, 
  6.     ), 
  7.   ), 
  8.   width: 320.0, 
  9.   height: 240.0, 
  10.   color: Colors.grey[300], 
  11. ); 

1.4 設置容器寬度

Container widget 的寬度可以用它的 width 屬性指定,但需要注意的是,和 CSS 中的 max-width 屬性用于指定容器可調整的***寬度值不同的是,這里指定的是一個固定寬度。要在 Flutter 中模擬 max-width 的效果,可以使用 Container 的 constraints 屬性。新建一個帶有 minWidth 和 maxWidth 屬性的 BoxConstraints widget。 而對嵌套的 Container 來說,如果其父元素寬度小于子元素寬度,則子元素實際尺寸以父元素大小為準。

Web 

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px;  
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   width: 100%; 
  20.   max-width: 240px;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: bold24Roboto, 
  7.       ), 
  8.       decoration: BoxDecoration( 
  9.         color: Colors.red[400], 
  10.       ), 
  11.       padding: EdgeInsets.all(16.0), 
  12.       width: 240.0, //max-width is 240.0 
  13.     ), 
  14.   ), 
  15.   width: 320.0,  
  16.   height: 240.0, 
  17.   color: Colors.grey[300], 
  18. ); 

二、位置與大小

以下示例將展示如何對 widget 的位置、大小以及背景進行更復雜的操作。

2.1 絕對定位

默認情況下, widget 是相對于其父元素定位的。要通過 x-y 坐標指定一個 widget 的絕對位置,請把它嵌套在一個 Positioned widget 中,而該 widget 則需被嵌套在一個 Stack widget 中。

Web 

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   position: relative;  
  13. .redbox { 
  14.   background-color: #ef5350; /* red 400 */ 
  15.   padding: 16px; 
  16.   color: #ffffff; 
  17.   position: absolute
  18.   top: 24px; 
  19.   left: 24px;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Stack( 
  3.     children: [ 
  4.       Positioned( // red box 
  5.         child:  Container( 
  6.           child: Text( 
  7.             "Lorem ipsum"
  8.             style: bold24Roboto, 
  9.           ), 
  10.           decoration: BoxDecoration( 
  11.             color: Colors.red[400], 
  12.           ), 
  13.           padding: EdgeInsets.all(16.0), 
  14.         ), 
  15.         left: 24.0, 
  16.         top: 24.0, 
  17.       ), 
  18.     ], 
  19.   ),  
  20.   width: 320.0, 
  21.   height: 240.0, 
  22.   color: Colors.grey[300], 
  23. ); 

2.2 旋轉

要旋轉一個 widget,請將它嵌套在 Transform widget 中。其中,使用 Transform widget 的 alignment 和 origin 屬性分別來指定轉換原點的具體位置信息。

對于簡單的 2D 旋轉,widget 是依據弧度在 Z 軸上旋轉的。(角度 × π / 180)

Web  

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   transform: rotate(15deg);  

Dart 

  1. var container = Container( // gray box 
  2.   child: Center( 
  3.     child:  Transform( 
  4.       child:  Container( // red box 
  5.         child: Text( 
  6.           "Lorem ipsum"
  7.           style: bold24Roboto, 
  8.           textAlign: TextAlign.center, 
  9.         ), 
  10.         decoration: BoxDecoration( 
  11.           color: Colors.red[400], 
  12.         ), 
  13.         padding: EdgeInsets.all(16.0), 
  14.       ), 
  15.       alignment: Alignment.center, 
  16.       transform: Matrix4.identity() 
  17.         ..rotateZ(15 * 3.1415927 / 180), 
  18.     ),  
  19.   ), 
  20.   width: 320.0, 
  21.   height: 240.0, 
  22.   color: Colors.grey[300], 
  23. ); 

2.3 縮放元素

將元素嵌套在一個 Transform widget 中,可以實現縮放。使用 Transform widget 的 alignment 和 origin 屬性分別來指定縮放原點的具體位置信息。

對于沿 x 軸的簡單縮放操作,新建一個 Matrix4 標識對象并用它的 scale() 方法來指定縮放因系數。

當你縮放一個父 widget 時,它的子 widget 也會相應被縮放。

Web 

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   transform: scale(1.5);  

Dart 

  1. var container = Container( // gray box 
  2.   child: Center( 
  3.     child:  Transform( 
  4.       child:  Container( // red box 
  5.         child: Text( 
  6.           "Lorem ipsum"
  7.           style: bold24Roboto, 
  8.           textAlign: TextAlign.center, 
  9.         ), 
  10.         decoration: BoxDecoration( 
  11.           color: Colors.red[400], 
  12.         ), 
  13.         padding: EdgeInsets.all(16.0), 
  14.       ), 
  15.       alignment: Alignment.center, 
  16.       transform: Matrix4.identity() 
  17.         ..scale(1.5), 
  18.      ),  
  19.   width: 320.0, 
  20.   height: 240.0, 
  21.   color: Colors.grey[300], 
  22. ); 

2.4 線性變換

將元素嵌套在一個 Container widget 中,可以將線性變換應用在 widget 的背景上。之后,再用 Container widget 的 decoration 屬性生成一個 BoxDecoration 對象,然后使用 BoxDecoration 的 gradient 屬性來變換背景填充內容。

變換“角度”基于 Alignment (x, y) 取值來定:

  • 如果開始和結束的 x 值相同,變換將是垂直的(0°180°)。
  • 如果開始和結束的 y 值相同,變換將是水平的(90°270°)。

這里,只展示垂直變換的代碼差異:

Web  

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   padding: 16px; 
  17.   color: #ffffff; 
  18.   background: linear-gradient(180deg, #ef5350, rgba(0, 0, 0, 0) 80%);  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: bold24Roboto, 
  7.       ), 
  8.       decoration: BoxDecoration( 
  9.         gradient: LinearGradient( 
  10.           begin: const Alignment(0.0, -1.0), 
  11.           end: const Alignment(0.0, 0.6), 
  12.           colors: <Color>[ 
  13.             const Color(0xffef5350), 
  14.             const Color(0x00ef5350) 
  15.           ], 
  16.         ), 
  17.       ),  
  18.       padding: EdgeInsets.all(16.0), 
  19.     ), 
  20.   ), 
  21.   width: 320.0, 
  22.   height: 240.0, 
  23.   color: Colors.grey[300], 
  24. ); 

三、圖形/形狀

以下示例將展示如何新建和自定義圖形。

3.1 圓角

在矩形上實現圓角,可以用 BoxDecoration 對象的 borderRadius 屬性。新建一個 BorderRadius 對象來指定每個圓角的半徑大小。

Web 

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* gray 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   border-radius: 8px;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red circle 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: bold24Roboto, 
  7.       ), 
  8.       decoration: BoxDecoration( 
  9.         color: Colors.red[400], 
  10.         borderRadius: BorderRadius.all
  11.           const Radius.circular(8.0), 
  12.         ),  
  13.       ), 
  14.       padding: EdgeInsets.all(16.0), 
  15.     ), 
  16.   ), 
  17.   width: 320.0, 
  18.   height: 240.0, 
  19.   color: Colors.grey[300], 
  20. ); 

3.2 陰影

在 CSS 中你可以通過 box-shadow 屬性快速指定陰影偏移與模糊范圍。比如如下兩個盒陰影的屬性設置:

  • xOffset: 0px, yOffset: 2px, blur: 4px, color: black @80% alpha
  • xOffset: 0px, yOffset: 06x, blur: 20px, color: black @50% alpha

在 Flutter 中,每個屬性與其取值都是單獨指定的。請使用 BoxDecoration 的 boxShadow 屬性來生成一系列 BoxShadow widget。你可以定義一個或多個 BoxShadow widget,這些 widget 共同用于設置陰影深度、顏色等等。

Web 

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 
  20.               0 6px 20px rgba(0, 0, 0, 0.5); 

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: bold24Roboto, 
  7.       ), 
  8.       decoration: BoxDecoration( 
  9.         color: Colors.red[400], 
  10.         boxShadow: <BoxShadow>[ 
  11.           BoxShadow ( 
  12.             color: const Color(0xcc000000), 
  13.             offset: Offset(0.0, 2.0), 
  14.             blurRadius: 4.0, 
  15.           ), 
  16.           BoxShadow ( 
  17.             color: const Color(0x80000000), 
  18.             offset: Offset(0.0, 6.0), 
  19.             blurRadius: 20.0, 
  20.           ), 
  21.         ],  
  22.       ), 
  23.       padding: EdgeInsets.all(16.0), 
  24.     ), 
  25.   ), 
  26.   width: 320.0, 
  27.   height: 240.0, 
  28.   decoration: BoxDecoration( 
  29.     color: Colors.grey[300], 
  30.   ), 
  31.   margin: EdgeInsets.only(bottom: 16.0), 
  32. ); 

3.3 圓與橢圓

盡管 CSS 中有基礎圖形,CSS 中一個生成圓的變通方案是:將矩形的四邊 border-radius 均設成50%。

雖然 BoxDecoration 的 borderRadius 屬性支持這樣設置,Flutter 為 BoxShape enum 提供一個 shape 屬性也用于實現同樣的目的。

Web  

  1. <div class="greybox"
  2.   <div class="redcircle"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* gray 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redcircle { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   text-align: center; 
  20.   width: 160px; 
  21.   height: 160px; 
  22.   border-radius: 50%;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red circle 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: bold24Roboto, 
  7.         textAlign: TextAlign.center,  
  8.       ), 
  9.       decoration: BoxDecoration( 
  10.         color: Colors.red[400], 
  11.         shape: BoxShape.circle,  
  12.       ), 
  13.       padding: EdgeInsets.all(16.0), 
  14.       width: 160.0, 
  15.       height: 160.0,  
  16.     ), 
  17.   ), 
  18.   width: 320.0, 
  19.   height: 240.0, 
  20.   color: Colors.grey[300], 
  21. ); 

四、文本

以下示例展示了如何設置字體和其他文本屬性,除此外還包括一些特性比如如何變換文本字符、自定義間距以及生成摘錄。

4.1 文字間距

在 CSS 中你可以通過分別給 letter-spacing 和 word-spacing 屬性的長度賦值來指定每個字母以及每個單詞間的空白距離。距離的單位可以是 px, pt, cm, em 等等。

在 Flutter 中,你可以在 Text widget 子元素 TextStyle 的 letterSpacing 與 wordSpacing 屬性中將間距設置為邏輯像素(允許負值)。

Web  

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   letter-spacing: 4px;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child: Text( 
  5.         "Lorem ipsum"
  6.         style: TextStyle( 
  7.           color: Colors.white, 
  8.           fontSize: 24.0, 
  9.           fontWeight: FontWeight.w900, 
  10.           letterSpacing: 4.0,  
  11.         ), 
  12.       ), 
  13.       decoration: BoxDecoration( 
  14.         color: Colors.red[400], 
  15.       ), 
  16.       padding: EdgeInsets.all(16.0), 
  17.     ), 
  18.   ), 
  19.   width: 320.0, 
  20.   height: 240.0, 
  21.   color: Colors.grey[300], 
  22. ); 

4.2 內聯樣式

一個 Text widget 可以展示同一類樣式的文本。為了展現具有多種樣式的文本,需要改用 RichText widget。它的 text 屬性可以指定一個或多個可以單獨設置樣式的 TextSpan widget。

在下例中,”Lorem” 位于 TextSpan widget 中,具有默認(繼承自其父元素)文本樣式,”ipsum” 位于具有自定義樣式、單獨的一個 TextSpan 中。

Web  

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem <em>ipsum</em>  
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto;  
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.  .redbox em { 
  20.   font: 300 48px Roboto; 
  21.   font-style: italic; 
  22. }  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child:  RichText( 
  5.         text: TextSpan( 
  6.           style: bold24Roboto, 
  7.           children: <TextSpan>[ 
  8.             TextSpan(text: "Lorem "), 
  9.             TextSpan( 
  10.               text: "ipsum"
  11.               style: TextStyle( 
  12.                 fontWeight: FontWeight.w300, 
  13.                 fontStyle: FontStyle.italic, 
  14.                 fontSize: 48.0, 
  15.               ), 
  16.             ), 
  17.           ], 
  18.         ), 
  19.       ),  
  20.       decoration: BoxDecoration( 
  21.         backgroundColor: Colors.red[400], 
  22.       ), 
  23.       padding: EdgeInsets.all(16.0), 
  24.     ), 
  25.   ), 
  26.   width: 320.0, 
  27.   height: 240.0, 
  28.   color: Colors.grey[300], 
  29. ); 

4.3 文本摘要

在 Web 中,我們常用省略號處理溢出的文本內容,且在 HTML/CSS 中,摘要不能超過一行。 如果要在多行之后進行截斷,那么就需要 JavaScript 的幫助了。

在 Flutter 中,使用 Text widget 的 maxLines 屬性來指定包含在摘要中的行數,以及 overflow 屬性來處理溢出文本。

Web  

  1. <div class="greybox"
  2.   <div class="redbox"
  3.     Lorem ipsum dolor sit amet, consec etur 
  4.   </div> 
  5. </div> 
  6.  
  7. .greybox { 
  8.   background-color: #e0e0e0; /* grey 300 */ 
  9.   width: 320px; 
  10.   height: 240px; 
  11.   font: 900 24px Roboto; 
  12.   display: flex; 
  13.   align-items: center; 
  14.   justify-content: center; 
  15. .redbox { 
  16.   background-color: #ef5350; /* red 400 */ 
  17.   padding: 16px; 
  18.   color: #ffffff; 
  19.   overflow: hidden; 
  20.   text-overflow: ellipsis; 
  21.   white-space: nowrap;  

Dart 

  1. var container = Container( // grey box 
  2.   child: Center( 
  3.     child: Container( // red box 
  4.       child: Text( 
  5.         "Lorem ipsum dolor sit amet, consec etur"
  6.         style: bold24Roboto, 
  7.         overflow: TextOverflow.ellipsis, 
  8.         maxLines: 1,  
  9.       ), 
  10.       decoration: BoxDecoration( 
  11.         backgroundColor: Colors.red[400], 
  12.       ), 
  13.       padding: EdgeInsets.all(16.0), 
  14.     ), 
  15.   ), 
  16.   width: 320.0, 
  17.   height: 240.0, 
  18.   color: Colors.grey[300], 
  19. ); 

Teaser 截圖自 flutter.io 官網。

責任編輯:未麗燕 來源: Joe's Blog
相關推薦

2019-12-18 10:30:24

前端開發技術

2019-07-29 16:05:48

前端DockerNode.js

2015-08-26 14:18:25

Web前端工程師價值

2015-09-30 10:25:03

前端工程師

2010-01-13 10:53:51

Web前端工程師定位

2018-11-15 15:55:44

前端工程師Web云計算

2014-12-23 14:55:23

前端

2023-11-02 11:49:22

2015-03-16 16:01:40

Web前端前端工程師Web

2016-09-22 16:14:45

前端設計Photoshop

2010-01-13 10:10:07

Web前端工程師

2009-02-23 09:41:29

面試軟件測試工程師

2022-03-15 08:00:00

Flutter開發工具

2022-09-16 08:00:00

軟件工程師求職薪酬

2022-07-29 09:12:44

軟件硬件開發

2019-06-24 09:40:17

前端前端工程師開發工具

2023-10-30 08:27:50

ML后端學習機器

2012-06-28 14:23:32

Web

2021-04-22 09:00:00

軟件工程師代碼

2022-08-18 08:00:00

BGP非網絡工程師漏洞
點贊
收藏

51CTO技術棧公眾號

国产精品久久久久久福利| 国产做受高潮漫动| 在线观看欧美| 亚洲一区二区五区| 久久久精品有限公司| 国产精品视频一区在线观看| 成人写真视频| 日韩女优av电影| 国产亚洲精品网站| 日韩在线观看www| 国产成人精品影院| 国产成人高清激情视频在线观看 | 韩国精品视频在线观看 | 激情五月婷婷综合| 久久久噜噜噜久噜久久| 成人黄色a级片| 亚洲91网站| 日本高清不卡一区| 国产av熟女一区二区三区| 欧美美女色图| 国产成人在线观看| 国产精品旅馆在线| 久久精品国产亚洲AV无码麻豆| 视频一区中文| 精品国产免费视频| 欧美女同在线观看| 午夜裸体女人视频网站在线观看| 国产精品不卡一区二区三区| 精品一区二区视频| 99久久精品国产一区色| 久久只有精品| 国语自产精品视频在线看一大j8 | 国产探花一区| 精品免费一区二区三区| 少妇网站在线观看| 26uuu亚洲电影| 亚洲午夜免费福利视频| 亚洲欧美精品| 九色视频网站在线观看| 粉嫩一区二区三区性色av| 成人福利网站在线观看| 亚洲天堂男人av| 亚洲麻豆av| 欧美精品做受xxx性少妇| 国产无遮挡在线观看| 中文字幕亚洲影视| 日韩av在线免费观看| 国内自拍偷拍视频| 久久三级中文| 欧美一区二区三区视频免费播放| 日本三级黄色网址| 国内欧美日韩| 欧美日韩国产色站一区二区三区| 天天摸天天碰天天添| 爱情岛亚洲播放路线| 亚洲精品欧美激情| 2021狠狠干| 黄色成人在线观看| 亚洲欧洲日产国码二区| 亚洲自拍偷拍二区| 91官网在线| 中文在线一区二区| 四虎永久国产精品| av片在线看| 国产精品理论片在线观看| 亚洲欧洲日韩综合二区| 欧美一区二区三区| 亚洲男同性视频| 成人在线播放网址| 99爱在线视频| 欧美色播在线播放| 精品视频无码一区二区三区| 久久野战av| 欧美色视频一区| 久久久久久综合网| 亚洲1区在线| 日韩精品欧美激情| 久久亚洲AV无码专区成人国产| 精品国产一区二区三区香蕉沈先生 | 老司机在线精品视频| 日韩经典第一页| 一级片久久久久| 亚洲人成免费网站| 欧美激情一二区| 中文字幕免费在线观看视频| 日韩成人精品视频| 成人av色在线观看| 亚洲毛片欧洲毛片国产一品色| av动漫一区二区| 日本一区二区不卡高清更新| 黄av在线免费观看| 亚洲第一精品在线| 搡女人真爽免费午夜网站| 在线观看欧美| 日韩电影视频免费| 极品尤物一区二区| 国产精品扒开腿做爽爽爽软件| 久久久久久亚洲| 波多野结衣一二区| 国产一区二区精品久久91| 国产一区二区三区无遮挡| 国产高清视频在线观看| 亚洲久本草在线中文字幕| 欧美极品欧美精品欧美| 国精品产品一区| 亚洲精品久久久久国产| 老司机深夜福利网站| 亚洲久久成人| 国产美女搞久久| 人妻无码中文字幕| 亚洲欧洲精品一区二区三区不卡| 精品国产一区三区| 欧美黄页在线免费观看| 亚洲精品成人免费| 永久免费看mv网站入口| 久久精品亚洲| 国产精品日韩二区| 日本美女在线中文版| 疯狂蹂躏欧美一区二区精品| 中文字幕剧情在线观看| 神马影视一区二区| 97在线视频国产| 国产精品国产av| 国产亚洲精品aa午夜观看| 蜜臀av无码一区二区三区| 91精品福利观看| 国产一区二区三区精品久久久| 懂色av.com| 福利一区福利二区| 公共露出暴露狂另类av| 日韩av首页| 亚洲人av在线影院| 日韩特黄一级片| 国产99精品国产| 无码人妻aⅴ一区二区三区日本| av激情成人网| 亚洲欧美在线第一页| 国产精品自拍视频一区| 国产91丝袜在线播放| 99亚洲精品视频| 欧美日韩破处视频| 在线看国产精品| 国产九色91回来了| 国产午夜精品一区二区三区视频| 国产精品沙发午睡系列| 91久久精品无嫩草影院| 精品国偷自产在线视频| 中文字幕在线观看欧美| 欧美国产精品v| av丝袜天堂网| 欧美中文一区二区| 国产精品久久久久久久9999| 久久久久国产精品嫩草影院| 狠狠做深爱婷婷久久综合一区| 丰满大乳奶做爰ⅹxx视频| 亚洲激情网站| 精品国产乱码久久久久久88av| 2020av在线| 亚洲精品在线看| 国产第一页在线观看| 国产欧美久久久精品影院 | 精品在线免费视频| 一区二区三区四区五区视频| 国产成人精品一区二区三区在线 | 99爱在线视频| 亚洲美女www午夜| 懂色av中文字幕| 国产精品狼人久久影院观看方式| 91 视频免费观看| 欧美精选一区| 久久99精品久久久久久三级| 中文字幕成在线观看| 国产午夜精品全部视频在线播放| 国产精品无码粉嫩小泬| 1000部国产精品成人观看| 黑人性生活视频| 亚洲一级特黄| 欧美成人一区二区在线| 成人在线黄色| 欧美成人免费网| 天堂网在线中文| 色婷婷久久久综合中文字幕| 国产传媒视频在线| 国产精品羞羞答答xxdd| 又粗又黑又大的吊av| 日本一区二区高清不卡| 成人av资源| 免费成人直播| 欧美成人黄色小视频| 少妇精品高潮欲妇又嫩中文字幕 | 国产精品久久久久一区二区三区| 在线观看中文av| 亚洲国产精品一区制服丝袜| 日本一区视频在线| 国语精品视频| 欧美又大又硬又粗bbbbb| 免费黄色在线| 日韩精品999| 国产精品久久久久久久成人午夜 | 国产乡下妇女三片| 尤物视频一区二区| 女人又爽又黄免费女仆| 国产精品影视网| av五月天在线| 亚洲午夜一区| 亚洲bbw性色大片| 国产精品巨作av| 国产欧美精品va在线观看| freexxx性亚洲精品| 色偷偷偷综合中文字幕;dd| 欧美视频xxx| 91麻豆精品91久久久久同性| 在线永久看片免费的视频| 亚洲永久精品国产| 萌白酱视频在线| 久久久精品日韩欧美| 美女扒开腿免费视频| 久久丁香综合五月国产三级网站| 亚洲 高清 成人 动漫| 欧美91大片| 亚洲午夜在线观看| 最新国产一区| 国产一区二区三区无遮挡| 精品国产亚洲一区二区三区在线| 国产999精品久久久| av2020不卡| 久久69精品久久久久久久电影好| 在线视频1区2区| 亚洲色图校园春色| 天堂av中文在线资源库| 精品日韩成人av| 国产精品无码一区二区桃花视频| 色欧美日韩亚洲| 久久99精品波多结衣一区| 亚洲综合久久av| 欧美成人精品欧美一级私黄| 中文字幕五月欧美| 少妇愉情理伦三级| 国产日产精品1区| 精品人妻一区二区免费视频| 粉嫩蜜臀av国产精品网站| 欧美69精品久久久久久不卡| 激情文学综合插| 中文字幕12页| 精品一区二区在线免费观看| 中文字幕av不卡在线| 日本欧美一区二区| 国产精品人人妻人人爽人人牛| 亚洲一区观看| 国产91对白刺激露脸在线观看| 99热精品在线观看| 亚欧无线一线二线三线区别| 亚洲影视综合| 无码精品国产一区二区三区免费| 久久成人亚洲| 国产成人精品无码播放| 日韩精品福利网| 国产视频手机在线播放| 美国十次了思思久久精品导航| 任你操这里只有精品| 日韩精品视频网站| 网站一区二区三区| 精品一区二区三区在线播放视频| 第一区免费在线观看| 狠狠网亚洲精品| 中文字幕55页| 成人手机电影网| 三级男人添奶爽爽爽视频| 2023国产精品自拍| 亚洲а∨天堂久久精品2021| 国产精品毛片大码女人| 男人与禽猛交狂配| 亚洲午夜精品在线| 日本一区二区三区精品| 91福利视频网站| 国产乱淫av免费| 精品国产免费视频| 九色蝌蚪在线| 久久国产精品久久精品| 999精品网| 国产精品美女www| 亚洲精品一二三**| 精品视频高清无人区区二区三区| 国产麻豆精品久久| 桥本有菜av在线| 99精品免费网| 亚洲国产高清av| 成人性生交大合| 四季av中文字幕| 夜夜嗨av一区二区三区四季av| 你懂的国产视频| 56国语精品自产拍在线观看| 四虎永久在线观看| 最近2019中文字幕mv免费看| 免费网站在线观看人| 国产不卡在线观看| 视频精品二区| 色噜噜狠狠一区二区三区| 欧美日韩福利| 中文字幕 91| 91欧美一区二区| 国产天堂av在线| 色婷婷av一区二区三区之一色屋| 国产露脸91国语对白| 亚洲片在线资源| 成人性生交大片免费看在线播放| 国产精品美女www爽爽爽视频| 一区二区三区在线资源| 色综合视频二区偷拍在线 | 黄色三级视频片| 成人sese在线| 久久久久久视频| 在线免费观看一区| 天堂av资源网| 欧美国产第一页| 日韩护士脚交太爽了| 蜜桃999成人看片在线观看| 欧美日韩1区2区3区| 黄色在线视频网| 久久欧美一区二区| 中文字幕第28页| 在线不卡免费欧美| 国产系列在线观看| 18久久久久久| 国产精品毛片视频| 青青视频免费在线观看| 麻豆成人av在线| 极品蜜桃臀肥臀-x88av| 欧美网站在线观看| 神马午夜电影一区二区三区在线观看| 久久亚洲国产精品| 成人18视频在线观看| 欧美资源一区| 先锋a资源在线看亚洲| 亚洲欧美日韩色| 亚洲国产精品麻豆| 丁香花免费高清完整在线播放| 久久精品国产91精品亚洲| 国产精品久久久久77777丨| 欧洲久久久久久| 性xx色xx综合久久久xx| 完美搭档在线观看| 亚瑟在线精品视频| 蜜臀av在线观看| 96精品视频在线| 神马香蕉久久| 国产亚洲天堂网| 久久人人爽人人爽| 日本黄色一级视频| 一本一本久久a久久精品综合小说 一本一本久久a久久精品牛牛影视 | 国产在线精品免费| 色婷婷在线视频观看| 日韩免费一区二区| 毛片在线导航| 精品午夜一区二区| 性伦欧美刺激片在线观看| 欧美高清性xxxx| 色婷婷av一区二区三区大白胸 | 91av资源网| 久久婷婷综合激情| 成人av网站在线播放| 国产亚洲精品久久久久久| 日本精品网站| 在线无限看免费粉色视频| 韩国一区二区三区| 久久久精品视频在线| 亚洲电影免费观看| 日韩福利一区| 亚洲在线不卡| 国产激情偷乱视频一区二区三区| 精品97人妻无码中文永久在线| 精品国产髙清在线看国产毛片| av电影免费在线看| 日本一区视频在线观看| 国产在线看一区| 国产精品18p| 亚洲欧美综合v| 国产区一区二| 鲁一鲁一鲁一鲁一色| 欧美激情中文字幕| japanese国产| 2019中文字幕在线观看| 日韩在线欧美| 色姑娘综合天天| 欧美日韩一区二区在线播放| www免费网站在线观看| 亚洲一区二区久久久久久久| 99国产精品| 色偷偷www8888| 亚洲福利视频二区| 日本欧美一区| 可以看毛片的网址| 欧美激情综合五月色丁香小说| 国产成人三级在线播放| 日本一区二区不卡| 欧美日本久久| 特级西西www444人体聚色| 精品免费一区二区三区| 国产精成人品2018| 欧美成人免费在线观看视频|