title: Change DateField value using Provider
body: <p>I want to change date field value while clicking on a Radio Button named &quot;Yes&quot;. One can input date by changing date from datepicker. Another one is is user clicked on &quot;Yes&quot; button the datefield value will be changed. I'm trying it using Provider. But the updated value isn't displaying into datefield instantly.</p>
  <p>Code snippet:</p>
  <pre><code>DateTimeFormField(
      dateFormat: DateFormat('yyyy-MM-dd'),
      mode: DateTimeFieldPickerMode.date,
      initialValue: DateTime.parse(list[index].endDate!),
      decoration: InputDecoration(
        isDense: true,
        contentPadding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
        hintStyle: TextStyle(color: Colors.black45),
        errorStyle: TextStyle(color: Colors.redAccent),
        border: OutlineInputBorder(),
        suffixIcon: Icon(Icons.event_note),
      ),
      onDateSelected: (DateTime value) {
        list[index].endDate = value.toString();
      },
    )
  
  ##
  class ManipulateDate extends ChangeNotifier {
    String date = '';
  
    void setDateToDTNow(String newDate) {
      date = newDate;
      notifyListeners();
    }
  }
  
  Inside Button's onPressed function
  
  Provider.of&lt;ManipulateDate&gt;(context, listen: false).setDateToDTNow(DateTime.now().toString());
  </code></pre>
  <p>How could I set the changed value <code>Provider.of&lt;ManipulateDate&gt;(context).date</code> into <code>list[index].endDate</code> and <em>the value will display instantly while clicking on Button.</em></p>