0

What is the purpose of it in flutter framework?. I want to know the flow of build context.

class MyAwesomeWidget extends StatelessWidget{
    @override 
    Widget build(BuildContext context)  
        return Container(
            child: Text("Hello"),
    );
}
  • 4
    Does this answer your question? [What does BuildContext do in Flutter?](https://stackoverflow.com/questions/49100196/what-does-buildcontext-do-in-flutter) – AskNilesh Dec 24 '22 at 13:38

1 Answers1

0

According to some research as it says: "BuildContext is a locator that is used to track each widget in a tree and locate them and their position in the tree. The BuildContext of each widget is passed to their build method. Remember that the build method returns the widget tree a widget renders. Each BuildContext is unique to a widget." So your all application is basically consist of tree structure and following it from the root of your app.

iAliMalik
  • 3
  • 3