FlutterUI

V0.2.3 文檔

后續會繼續開發更新。

特性

  • 鏈式調用
  • 簡化代碼
  • 高可讀性
  • 便于維護

示例

Row(children: [
    const BlueButton("官方").marginOnly(left: 16),
    const SizedBox(width: 12),
    const WhiteOutlinedButton("線下"),
    const Spacer(),
    const Text("免費").fontSize(10).translate(0, -7)
]).roundedRect(6).paddingAll(8)

布局

  • padding
    1. paddingAll
    2. paddingSymmetric(double horizontal,double vertical)
    3. paddingLeft
    4. paddingRight
    5. paddingTop
    6. paddingBottom
    7. padding
  • margin
    1. marginAll
    2. 同上
  • flexible
  • aspectRatio
  • expanded
  • positioned 配合stack定位
尺寸
  • size
  • height
  • width
  • constraints 約束
    1. maxWidth
    2. maxHeight
    3. minWidth
    4. minHeight
    5. constraints

列表

  • inList
  • inSliverList
  • SliverLazyColumn<T>(data, childCount, child)

變換

  • translate(double dx, double dy)
  • rotate(double angle)
  • scale(double scale)

顏色

  • backgroundColor
  • backgroundColorInt

效果

  • roundedRect 圓角
    1. roundedRect
    2. roundedRectVertical
    3. roundedRectHorizontal
  • blur 毛玻璃
    1. blur 毛玻璃
    2. blurExpanded 模糊+expanded

功能

  • action 點擊等操作
  • onClick
  • onDoubleClick
  • onLongPress

官方組件擴展

Text

  • color
  • colorInt
  • fontSize
  • fontFamily
  • fontWeight
  • bold
  • italic
  • strikethrough
  • underLine
  • overLine
  • letterSpacing
  • wordSpacing
  • lineSpacing
  • lineLimit
  • singleLine
  • textAlignment

CircleAvatar

  • border 邊框

Image

  • coverMode
  • containMode
  • size
  • antialias 抗鋸齒

組件

CoverCacheImage 緩存、Cover模式的image

GradientTabIndicator 漸變色tab指示器

  • Button
    1. RRectButton 圓角圖片
    2. RRectOutlinedButton 圓角線框圖片

Swiper 輪播器 (三層:內容層、蒙版層、指示器層)

TODO

  • 網絡狀態、數據狀態容器
  • 上拉下拉容器
  • 其他
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容