btn

How to write by SpWML

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

// common usage
(btn, textColor:null)Text button
(btn, type:outlined, textColor:null)Outlined button
(btn, type:elevated, textColor:brown, textColor:null)Elevated button
(btn, type:icon, iconNum:0xefaa)Icon button
(btn, type:block, borderRadius:8, shape:roundRect)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)With params
(btn)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.
(btn, type:outlined)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.
(btn, type:elevated)
+(col)
++(menu)button's child block.
++(menu)a button with content like this.

Summary

A block in which various buttons can be placed.

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.