class MyApp extends StatelessWidget {
MyApp({Key? key}) : super(key: key);
var a = 1;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: (){
showDialog(
context: context,
builder: (context){
return DialogUI();
},
);
},
),));
}
class DialogUI extends StatelessWidget {
DialogUI({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Dialog(
child: Container(
width: 300,
height: 300,
child: Column(
children: [
TextField(),
TextButton( child: Text('완료'), onPressed:(){} ),
TextButton(
child: Text('취소'),
onPressed:(){ Navigator.pop(context); })
],
),
),
);
}
}
원랜 state전송이 안되서 테스트용으로 다시 만들다 보니 이러네요... 코드가 틀린게 없는것 같은데 뭐가 문제인지 모르겠습니다.
DialogUI()를 메소드라고 여깁니다. 커스텀위젯인데요....

state전송도 안됩니다..