본문 바로가기

플러터 팝업

(3)
[Flutter] Dialog 콜백 값 핸들링 아래와 같이 플러팅 버튼을 누를때, 다이얼 로그 에 대한 노출을 한다. floatingActionButton: FloatingActionButton( onPressed: ((){ showDialog( context: context, builder: (BuildContext context){ return AlertDialog( content: CreatePopup(), ); }) 이후에 값을 받아올때는 아래와 같이 구현한다. showDialog( context: context, builder: (BuildContext context){ return AlertDialog( content: CreatePopup(), ); }).then((value) { setState(() { reportList = valu..
[Flutter] 팝업 구현 팝업창은 간혹 필요하여 모듈로 구현하면 편하다. showDialog( context: context, barrierDismissible: true, // 바깥 영역 터치시 닫을지 여부 builder: (BuildContext context) { return AlertDialog( content: CreateGroupPopUp(userId: userId), insetPadding: const EdgeInsets.fromLTRB(0,80,0, 80), ); } ); 단순히 이렇게 하고, content 클래스를 구현해주면 된다. import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart..
[Flutter] 팝업 띄우기 1. 별도 메소드 작성 Future _dialogBuilder(BuildContext context) { return showDialog( context: context, builder: (BuildContext context) { return AlertDialog( title: const Text('Basic dialog title'), content: const Text( 'A dialog is a type of modal window that\n' 'appears in front of app content to\n' 'provide critical information, or prompt\n' 'for a decision to be made.', ), actions: [ TextButton( sty..