<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Element 系列組件之 EBorder 虛線(xiàn)邊框

          共 1899字,需瀏覽 4分鐘

           ·

          2021-12-11 01:32

          介紹

          「EBorder」 組件是 「Flutter Element」 組件系列中的 邊框組件,通過(guò)「虛/實(shí)線(xiàn)」繪制。

          引入

          1. 「pubspec.yaml」 中依賴(lài)

            element_ui:?^0.0.1
          2. import

            import?'package:element_ui/widgets.dart';

          基礎(chǔ)用法

          基礎(chǔ)用法:

          EBorder(
          ??child:?Text('data'),
          )

          默認(rèn)情況下 「EBorder」 充滿(mǎn)父組件。

          「mainAxisSize」:組件尺寸,默認(rèn)盡可能大,設(shè)置為 「MainAxisSize.min」 時(shí),表示盡可能小。

          EBorder(
          ??mainAxisSize:?MainAxisSize.min,
          ??child:?Text('data'),
          )

          內(nèi)部默認(rèn)設(shè)置了 「padding」,值為 「EdgeInsets.symmetric(vertical: 6.0, horizontal: 12)」

          修改其 「padding」

          EBorder(
          ??mainAxisSize:?MainAxisSize.min,
          ??style:?EBorderStyle(
          ??????padding:?EdgeInsets.symmetric(vertical:?20,?horizontal:?30)),
          ??child:?Text('data'),
          )

          「type」 :邊框類(lèi)型,默認(rèn)實(shí)線(xiàn)。

          • 「solid」:實(shí)線(xiàn)
          • 「dashed」:虛線(xiàn)

          設(shè)置虛線(xiàn):

          EBorder(
          ??type:?BorderType.dashed,
          ??child:?Text('data1'),
          )

          「shape」:邊框形狀,默認(rèn)圓角邊框。

          • 「circle」:圓形
          • 「rect」:矩形
          • 「rrect」:圓角矩形
          • 「round」:圓角 類(lèi)似足球場(chǎng)形狀

          設(shè)置圓形:

          Container(
          ??????????????height:?40,
          ??????????????width:?100,
          ??????????????child:?const?EBorder(
          ????????????????type:?BorderType.dashed,
          ????????????????shape:?BorderShape.circle,
          ????????????????child:?Text('data2'),
          ??????????????),
          ????????????)

          設(shè)置形狀為「round」

          EBorder(
          ??type:?BorderType.dashed,
          ??shape:?BorderShape.round,
          ??child:?Text('data'),
          )

          「style」:邊框的樣式。

          • 「color」:邊框顏色。
          • 「strokeWidth」:線(xiàn)寬。
          • 「dashGap」:虛線(xiàn)空白處寬。
          • 「dashWidth」:虛線(xiàn)寬。
          • 「padding」 :內(nèi)邊距。
          • 「radius」:圓角。

          設(shè)置顏色:

          EBorder(
          ??type:?BorderType.dashed,
          ??shape:?BorderShape.rrect,
          ??style:?EBorderStyle(color:?Colors.red),
          ??child:?Text('data'),
          )

          設(shè)置線(xiàn)寬:

          EBorder(
          ??type:?BorderType.dashed,
          ??shape:?BorderShape.rrect,
          ??style:?EBorderStyle(
          ????color:?Colors.red,
          ????strokeWidth:?3,
          ??),
          ??child:?Text('data'),
          )

          設(shè)置 「dashGap」「dashWidth」

          EBorder(
          ??type:?BorderType.dashed,
          ??shape:?BorderShape.rrect,
          ??style:?EBorderStyle(
          ????color:?Colors.red,
          ????dashGap:?5,
          ????dashWidth:?5,
          ??),
          ??child:?Text('data'),
          )


          你可能還喜歡

          關(guān)注「老孟Flutter」
          讓你每天進(jìn)步一點(diǎn)點(diǎn)
          瀏覽 200
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  人妻专区| 日韩A√ | 678五月丁香亚洲 | 国产在线无码观看 | 亚洲中文字幕巨乳 |