title: Instance member '' can't be accessed using static access
body: <p>I am trying to insert an event into a syncfusion flutter calendar by following this <a href="https://www.youtube.com/watch?v=LoDtxRkGDTw&amp;t=638s&amp;ab_channel=JohannesMilke" rel="nofollow noreferrer">youtube tutorial</a> but I did not want to use a provider as they had. I tried to write my main add/edit event code like this:</p>
  <pre><code>class EditEventsPage extends StatefulWidget {
    final Events? event;
  
    const EditEventsPage({Key? key, this.event}) : super(key: key);
  
    @override
    _EditEventsPageState createState() =&gt; _EditEventsPageState();
  }
  
  class _EditEventsPageState extends State&lt;EditEventsPage&gt; {
    final _formKey = GlobalKey&lt;FormState&gt;();
    final titleController = TextEditingController();
    late DateTime fromDate;
    late DateTime toDate;
  
    @override
    void initState() {
      super.initState();
      if (widget.event == null) {
        fromDate = DateTime.now();
        toDate = DateTime.now().add(Duration(hours: 4));
      }
    }
  
    @override
    void dispose() {
      titleController.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          backgroundColor: Color(0xFF1c3f77),
          elevation: 0,
          leading: CloseButton(),
          actions: buildEditingActions(),
        ),
        body: SingleChildScrollView(
          padding: EdgeInsets.all(12),
          child: Form(
              key: _formKey,
              child: Column(mainAxisSize: MainAxisSize.min, children: &lt;Widget&gt;[
                buildTitle(),
                SizedBox(height: 25),
                buildDateTime(),
              ])),
        ),
      );
    }
  
  
  
    List&lt;Widget&gt; buildEditingActions() =&gt; [
          ElevatedButton.icon(
            style: ElevatedButton.styleFrom(
                primary: Colors.transparent, shadowColor: Colors.transparent),
            icon: Icon(Icons.done),
            label: Text(
              'Add',
              style: TextStyle(color: Colors.white, fontSize: 15),
            ),
            onPressed: saveEvent,
          )
        ];
  
    Widget buildTitle() =&gt; TextFormField(
          style: TextStyle(fontSize: 15),
          decoration:
              InputDecoration(border: UnderlineInputBorder(), hintText: 'Title'),
          onFieldSubmitted: (_) =&gt; saveEvent(),
          validator: (title) =&gt;
              title != null &amp;&amp; title.isEmpty ? 'Title cannot be empty' : null,
          controller: titleController,
        );
  </code></pre>
  <p>In order to add an event, the code is :</p>
  <pre><code>Future saveEvent() async {
      final isValid = _formKey.currentState!.validate();
  
      if (isValid) {
        final event = Events(
          title: titleController.text,
          details: 'testing 1 2 3',
          from: fromDate,
          to: toDate,
          isAllday: false,
        );
  
        InsertEvent.addEvent(event);
        Navigator.of(context).pop();
      }
    }
  </code></pre>
  <p>InsertEventClass Code:</p>
  <pre><code>class InsertEvent {
    final List&lt;Events&gt; _events = [];
    List&lt;Events&gt; get events =&gt; _events;
  
    void addEvent(Events event) {
      _events.add(event);
    }
  }
  </code></pre>
  <p>However, it gives me an error that the &quot;Instance member 'addEvent' can't be accessed using static access&quot;. Can someone explain why this occurred and how it can be fixed?</p>