Null check operator used on a null value in calendar! i am assigning calendar with ? mark then the this null operator error is occurring and when i am adding the late calendar LateInitializationError: Field '_calendar@94028380' has not been initialized error is getting
class MedicationListChild extends StatefulWidget { final String? medicationName; final String? medicationUID; final String? childUid; final String? childName; final Calendar? calendar; const MedicationListChild({ Key? key, this.medicationName, this.medicationUID, this.childUid, this.childName, this.calendar, }) : super(key: key); @override _MedicationListChildState createState() => _MedicationListChildState(); } class _MedicationListChildState extends State<MedicationListChild> { Calendar? _calendar; @override void initState() => super.initState(); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.only(top: 7.0), child: Card( elevation: 3.0, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7.0)), child: InkWell( splashColor: Colors.blue, highlightColor: Colors.green, onTap: () { Navigator.of(context).push( MaterialPageRoute( builder: (context) => CalendarEventPage(_calendar!), ), ); },