Skip to content

Latest commit

 

History

History
152 lines (124 loc) · 2.62 KB

button.md

File metadata and controls

152 lines (124 loc) · 2.62 KB

Button

参考になるサイト

TextButton

TextButton(
  onPressed: _handlePressed,
  style: TextButton.styleFrom(primary: Colors.red),
  child: Text(
    "更新",
    style: TextStyle(color: Colors.blueAccent, fontSize: 20),
  )
)

アイコン付きはこちら.

TextButton.icon(
  onPressed: _handlePressed,
  icon: Icon(
    Icons.add,
    color: Colors.pink,
  ),
  label: Text(
    "更新",
    style: TextStyle(color: Colors.pink, fontSize: 20),
  )
)

ElevatedButton

ElevatedButton(
  onPressed: _handlePressed,
  style: ElevatedButton.styleFrom(primary: Colors.red),
  child: Text(
    "更新",
     style: TextStyle(color: Colors.white, fontSize: 20),
  )
)

アイコン付きはこちら

ElevatedButton.icon(
  onPressed: _handlePressed,
  icon: Icon(
    Icons.person,
    color: Colors.white,
  ),
  label: Text(
    "更新",
    style: TextStyle(color: Colors.white, fontSize: 20),
  )
)

OutlinedButton

OutlinedButton(
  onPressed: _handlePressed,
  style: OutlinedButton.styleFrom(
    primary: Colors.black,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(20)),
    side: BorderSide()),
  child: Text(
    "更新",
    style: TextStyle(fontSize: 20),
  )
)

アイコン付きはこちら

OutlinedButton.icon(
  onPressed: _handlePressed,
  style: OutlinedButton.styleFrom(
    primary: Colors.red,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(8),
    ),
    side: BorderSide(color: Colors.red),
  ),
  icon: Icon(
    Icons.pages,
    color: Colors.red,
  ),
  label: Text(
    "更新",
    style: TextStyle(color: Colors.red, fontSize: 20),
  )
)

IconButton

IconButton(
  icon: Icon(Icons.room),
  onPressed: _handlePressed,
  color: Colors.blueAccent,
  iconSize: 50,
  padding: const EdgeInsets.all(10),
),

FloatingActionButton

FloatingActionButton(
  onPressed: _handlePressed,
  backgroundColor: Colors.redAccent,
  child: Icon(Icons.room),
)

ラベルを含める場合はこちら.

FloatingActionButton.extended(
  onPressed: _handlePressed,
  backgroundColor: Colors.amberAccent,
  label: Text("わっしょい"),
  icon: Icon(Icons.room),
)