반응형
stateful
-
statelees / stateful 일때 다음화면에 데이터 전달하기프로그래밍 공부 메모/flutter 2022. 6. 16. 19:11
1. statelees 화면으로 데이터 전달 Navigator.push( context, MaterialPageRoute( builder: (context) => DetailScreen(todo: todos[index]), ), class DetailScreen extends StatelessWidget { // Todo를 들고 있을 필드를 선언합니다. final Todo todo; // 생성자는 Todo를 인자로 받습니다. DetailScreen({Key key, @required this.todo}) : super(key: key); @override Widget build(BuildContext context) { // UI를 그리기 위해 Todo를 사용합니다. return Scaffold( app..