Passing Data to a State Object
[Ko]
- location_screen에 constructor를 설정하고 locationWeather를 loading_screen의 MaterialPageRoute로부터 전달받도록 함.
- stateful widget은 parent stateful widget과 child state widget으로 나누어지며, 외부로부터 데이터를 받을 때는 parent stateful widget constructor의 property를 이용해서 받음. Child state widget에서 parent stateful widget의 property에 접근하기 위해서는 widget을 이용하며, widget은 parent stateful widget을 나타냄. Stateful widget에서 widget이 parent와 child를 연결하는 다리 역할을 함.
[En]
- Set constructor on location_screen and get locationWeather from MaterialPageRoute of loading_screen.
- The stateful widget is divided into a parent stateful widget and a child state widget. When receiving data from the outside, it is received using the properties of the parent stateful widget constructor. The widget is used to access the properties of the parent stateful widget from the Child state widget, and the widget represents the parent stateful widget. In stateful widgets, widgets serve as a bridge between parent and child.
'플러터(Flutter) > 플러터 일반(Flutter General)' 카테고리의 다른 글
Hero Animation (0) | 2020.03.19 |
---|---|
set Named Route (0) | 2020.03.19 |
JSON Parsing and Dynamic Types (0) | 2020.03.19 |
Lifecycle method of Stateful widget (0) | 2020.03.19 |
Composition vs. Inheritance - Building Flutter Widgets From Scratch (0) | 2020.03.19 |