title: flutter initState() vs build()?
body: <p>I am confused about when to put my code in <code>initState()</code> compared to <code>build()</code> in a stateful widget. I am doing a quiz on flutter's udacity course which has <a href="https://github.com/flutter/udacity-course/blob/master/course/05_stateful_widgets/task_05_stateful_widgets/lib/category_route.dart#L70" rel="noreferrer">this</a> todo item, which was to move a block of code from <code>build()</code> to <code>initState()</code>. But I don't know the purpose or advantage of doing that. Why not just put all the code in <code>build()</code>?</p>
  
  <p>Is it that <code>build()</code> is called only once while <code>initState()</code> is called on every state change?</p>
  
  <p>Thank you.</p>