Flutter學習筆記(1)

2021-09-12 15:58:36 字數 784 閱讀 2495

各顯示控制項說明:

scaffold:scaffold 實現了基本的 material 布局。只要是在 material 中定義了的單個介面顯示的布局控制項元素,都可以使用 scaffold 來繪製。

listview:listview預設是豎直方向的

flexible:flexible是乙個控制row、column、flex等子元件如何布局的元件。

container:容器,乙個常用的控制項,由基本的繪製、位置和大小控制項組成。負責建立矩形的可視元素,可以用boxdecoration來設計樣式,比如背景、邊框和陰影,container也有邊距、填充和大小限制,另外,還可以在三維空間利用矩陣進行變換。

boxdecoration:boxdecoration就是設定當前container的content背景顏色。(裝飾)

column: 指的是豎直的一列,

row:指的是橫向的一排,屬性mainaxisalignment是橫向,crossaxisalignment是豎直方向

divider:分割線控制項

text:用來顯示文字的控制項

《按鈕》

raisedbutton :凸起的按鈕,其實就是android中的material design風格的button ,繼承自materialbutton

flatbutton :扁平化的按鈕,繼承自materialbutton

outlinebutton    :帶邊框的按鈕,繼承自materialbutton

iconbutton    :圖示按鈕,繼承自statelesswidget

flutter 學習筆記1

跨平台技術的時間軸 最早為hybird混合開發,後來為react native的橋接技術,hybird的主要依賴的webview的技術,乙個重量級的控制項,容易產生記憶體問題。對於複雜的webview顯示效能不好。flutter 最新的跨平台技術支援android,ios,macos,windows...

Flutter學習筆記 螢幕適配

flutter螢幕適配方案,使頁面設計在不同尺寸的螢幕上都能顯示一致 可以使用外掛程式 flutter screenutil 安裝 dependencies flutter sdk flutter 新增依賴 flutter screenutil 0.6.0在使用的地方匯入 import packag...

flutter學習筆記二 布局

import package flutter material.dart 第五節,卡片布局 override widget build buildcontext context 第四節,positioned布局 override widget build buildcontext context 第...