본문 바로가기
Flutter

onHighlightChanged

by Andro07 2024. 1. 7.
728x90
반응형

 

RawMaterialButton(
  onPressed: () => {},
  onHighlightChanged: (value) {
    setState(() {
      backgroundColor = value ? Colors.amber : Colors.redAccent;
      _highlight = value;
    });
  },
  elevation: _highlight ? 10.0 : 1.0,
  constraints: BoxConstraints.tightFor(
      width: 100.0, // double? width
      height: 100.0 // double? height
      ),
  fillColor: backgroundColor,
  shape: _pentagonBorder(),
)
728x90
728x90

댓글