Flutter

[Flutter, 토이 프로젝트] ElevatedButton Radius 변경 - styleFrom

hminor 2023. 8. 19. 14:32

목적

  • ElevatedButton 의 Radius를 변경하기

코드

  • ElevatedButton의 styleFrom을 활용해 shape속성으로 변경
Container(
  child: ElevatedButton(
    style: ElevatedButton.styleFrom(
      elevation: 0,
      backgroundColor: Colors.white,
      padding: EdgeInsets.fromLTRB(15, 20, 15, 20),
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15))
    ),
    onPressed: (){},
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text('내 계좌', style: TextStyle(fontSize: 18, color: Colors.black, fontWeight: FontWeight.w600),),
        Row(
          children: [
            Text('전체보기', style: TextStyle(fontSize: 18, color: Colors.blue, fontWeight: FontWeight.w600),),
            Icon(Icons.arrow_right, color: Colors.blue, size: 35,)
          ],
        ),
      ],
    )
  ),
),