title: Flutter Provider, using child widget to update a list
body: <p>I'm new to using Flutter and I am currently struggling to understand how to use the Provider package for the following task, or if it is even the correct implementation in the first place.</p>
  <p>I have a widget that uses another widget within itself to update a time value.</p>
  <p>In the parent widget I have the following:</p>
  <pre><code>class _AddTimesScreenState extends State&lt;AddTimesScreen&gt; {
   List&lt;TimeOfDay&gt; times = [];
   @override
    Widget build(BuildContext context) {
      return Scaffold(      
        body: Provider&lt;List&lt;TimeOfDay&gt;&gt;.value(
          value: times,
      child: SetTimes()
  
  </code></pre>
  <p>In the 2nd widget, which is used to update the times list by using a time picker I have:</p>
  <pre><code>class _SetTimesState extends State&lt;SetTimes&gt; {
    @override
    Widget build(BuildContext context) {
      final times = Provider.of&lt;List&lt;TimeOfDay&gt;&gt;(context);
  </code></pre>
  <p>Essentially my goal is to be able to update the times list in the 2nd widget so it can then be used in the first widget. I have methods to add TimeOfDay objects to the list, but when the code is run the list in the first widget does not appear to be updated.</p>
  <p>Am I using Provider in a way that it's intended, or have I completely misunderstood its application?</p>
  <p>Thanks</p>