color, font 등 저장 가능
theme: ThemeData(
textTheme : TextTheme(titleLarge:TextStyle(
color:Colors.red,
),
)
(생략)
별도로 뺀 위젯이 있다고 가정하자
Widget build(BuildContext context) {
return Text(
"hello",
style: TextStyle(
fontSize:30,
color : Theme.of(context).textTheme.titleLarge.color,
)
}
이게 어떻게 가능해?

context 에는 위젯트리에 대한 정보가 들어있고, 매우 먼 요소의 데이터를 가져올 수 있어서 유용하다. 부모요소, 부모의 부모요소 등...
부모 요소에 접근 할 수 있도록 돕는다
위 예제는 context를 통해서 부모 요소에 접근한 것이고, 그래서 theme의 color를 가져온 것.