상세 컨텐츠

본문 제목

위젯 보관소 showDialog

flutter

by 소사탕 2024. 3. 16. 22:35

본문

728x90
반응형
showDialog(
  context: context,
  builder: (BuildContext context) {
    return AlertDialog(
      backgroundColor: Colors.white,
      contentPadding:EdgeInsets.zero,
      title: Text('해당 근로자의 출결 사항을\n저장하시겠습니까?',style: TextStyle(fontWeight: FontWeight.w500,fontSize: 17),textAlign: TextAlign.center),
      content: Container(
        height: 120,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Container(
                height: 40,
                alignment: Alignment.center,
                child: Text('처음 선택한 내용으로 표시됩니다',style: TextStyle(fontSize: 16,fontWeight: FontWeight.w400),)
            ),
            Container(
              width: 321,height: 44,
              decoration: BoxDecoration(
                  border:Border(
                      top: BorderSide(width:0.5,color: Color.fromRGBO(60, 60, 67, 0.36))
                  )
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  Container(
                    width: 156.5,
                    decoration: BoxDecoration(
                        border:Border(
                            right: BorderSide(width:0.5,color: Color.fromRGBO(60, 60, 67, 0.36))
                        )
                    ),
                    child: TextButton(
                      child: Text('취소',style: TextStyle(fontSize: 17,fontWeight: FontWeight.w400,color: mainColor),),
                      onPressed: () {
                        Navigator.of(context).pop(); // 다이얼로그 닫기
                      },
                    ),
                  ),
                  SizedBox(
                    width: 156.5,
                    child: TextButton(
                        child: Text('저장',style: TextStyle(fontSize: 17,fontWeight: FontWeight.w700,color: mainColor),),
                      onPressed: () {
                        Navigator.of(context).pop(); // 다이얼로그 닫기
                      },
                    ),
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  },
);
728x90
반응형

관련글 더보기

댓글 영역