btn

How to write by SpWML

// Example
(btn, sid:btn1)Button text
+(block)Block-type buttons use child blocks.

// common usage
(btn, textColor:null, sid:btn2)Text button
(btn, type:outlined, textColor:null, sid:btn3)Outlined button
(btn, type:elevated, textColor:brown, textColor:null, sid:btn4)Elevated button
(btn, type:icon, iconNum:0xefaa, sid:btn5)Icon button
(btn, type:block, borderRadius:8, shape:roundRect, sid:btn6)An example of defining a card-type button with a block button
+(row, bgColor:orange, borderRadius:8, borderShape:rectangle)
++(col, mL:8, mT:8, mR:8, mB:8)
+++(menu)button's child block.
+++(menu)a button with content like this.
(btn, type:elevated, textColor:white, iconNum:0xefaa, lineHeight:1.2, h:32, iconColor:yellow, btnBGColor:blue, sid:btn7)With params
(btn, sid:btn8)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.
(btn, type:outlined, sid:btn9)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.
(btn, type:elevated, sid:btn10)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.

Summary

A block in which various buttons can be placed.

It is necessary to set the SID.

It has similar parameters to TextButton class.


Dart Class Reference

BtnElement class


SpWML Parameters

  • common parameters. Parameters related to borders work differently from other elements.

  • parent parameters.

  • type (String). Specify the type of button as one of text, outlined, elevated, filled, filledTonal, icon, iconFilled, iconFilledTonal, iconOutlined, faSmall, faExtended, fa, faLarge or block. block is a special button whose child element responds to taps.

  • iconNum (String). Set icon type by codePoint .

  • iconSize (double).

  • iconColor (String). The color system .

  • splashRadius (double).

  • fgColor (String). The foreground color. The color of the overlay changes when the button is tapped. The color system .

  • btnBGColor (String). The backgound color. The color system .

  • color (String). Same btnBGColor.

  • shape (String). The border shape. Specify one of roundRect, stadium, bevel, circle.

  • isEnabled (bool). Set to false if you want to disable this elements.