0
var submitData = {
      'beauticianId': context.read(selectedBeautician).state.docId,
      'beauticianName': context.read(selectedBeautician).state.name,
      'cityBook': context.read(selectedCity).state.name,
      //'name': context.read(selectedBeautician).state.name,
      'clinicAddress': context.read(selectedClinic).state.address,
      'clinicId': context.read(selectedClinic).state.docId,
      'clinicName': context.read(selectedClinic).state.name,
      'slot': context.read(selectedTimeSlot).state,
      'timeStamp': timeStamp,
      'time': '${context.read(selectedTime).state} - ${DateFormat('dd/MM/yyyy').format(context.read(selectedDate).state)}'
    };

I can't seem to find the solution anywhere. There's a lot of that errors since I used that lines a lot.

Aqiela Adhlina
  • 113
  • 1
  • 1
  • 4

1 Answers1

0

so instead of using context.read(someProvider).state use this

Provider.of<someProvider>(context).state
Munsif Ali
  • 1,839
  • 1
  • 8
  • 22