What is a BuildContext?

 BuildContext is a handle to the location of a widget in the widget tree.

It helps Flutter know where a widget is located and what its parent/child relationships are.

Example:

Widget build(BuildContext context) { return Text('Hello'); }

You use context to access theme, navigation, or inherited widgets.

Comments

Popular posts from this blog

1. What is Flutter?

What is FutureBuilder and StreamBuilder?