0

I am just trying a random thing to clear my doubt but when I ran the code below the printing() function executes 2 times, can someone explain to me why the printing function executes 2 times.

void main() { runApp(new MyApp()); } class MyApp extends StatelessWidget { printing() { print("printing"); } @override Widget build(BuildContext context) { printing(); //calling printing() function return Container(); } } 

op(in console):

printing
printing

1 Answer 1

1

You should run your app in debug mode to understand what happens because there is no reason that your printing method is called twice.

I have tested your example and I have only one printing output in my console

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.