title: flutter local notifications send ID with payload option
body: <p>I have an application that stores data with sqflite. I access the records that I list with listview from the detail page with the constructor method. Short and simple codes are as follows.</p>
  
  <p><em>notes.dart --> main page</em></p>
  
  <pre><code> child: ListView.builder(
                              itemCount: notes.length,
                              itemBuilder: (context, index) {
                                return NoteClass(
                                    notes: notes[index],
                                    );
                              },
                            ),
  </code></pre>
  
  <hr>
  
  <p><em>note_class.dart</em> -->  </p>
  
  <pre><code>  return Column(
        children: &lt;Widget&gt;[
          Dismissible(
              key: UniqueKey(),
              movementDuration: Duration(milliseconds: 400),
              background: Container(
                child: Padding(
                  padding: EdgeInsets.only(left: 38),
                  child: Align(
                    alignment: Alignment.centerLeft,
                    child: Icon(
                      LineIcons.trash,
                      color: Colors.red.shade900,
                      size: 27,
                    ),
                  ),
                ),
              ),
              onDismissed: (direction) {
                _deleteNote(widget.notes.noteID);
              },
              child: Card(
                margin: EdgeInsets.only(top: 2, bottom: 2),
                elevation: 2,
                shape: RoundedRectangleBorder(),
                child: Container(
                  height: 80,
                  child: ListTile(
                    onTap: (){
                      _detailPage(context, widget.notes);
                    },
                    contentPadding: EdgeInsets.only(left: 10, right: 5),
                    title: Stack(
                      children: &lt;Widget&gt;[
                        Container(
                          padding: EdgeInsets.only(top: 17),
                          child: Icon(Icons.note)
                        ),
                        Container(
                          padding: EdgeInsets.only(left: 45),
                          child: Row(
                            mainAxisAlignment:
                            MainAxisAlignment.spaceBetween,
                            children: &lt;Widget&gt;[
                              Column(
                                mainAxisAlignment:
                                MainAxisAlignment.spaceBetween,
                                crossAxisAlignment:
                                CrossAxisAlignment.start,
                                children: &lt;Widget&gt;[
                                  Container(
                                      padding: EdgeInsets.only(top: 0),
                                      child: Text(
                                        widget.notes.noteHeader,
                                        style: TextStyle(
                                            fontSize: 19,
                                            color: Colors.grey[900]),
                                      )),
                                  Container(
                                    padding: EdgeInsets.only(top: 0),
                                    child: Text(
                                       widget.notes.noteBody,
                                      style:  TextStyle(
                                          fontSize: 17,
                                          color: Colors.grey[900]),
                                    ),
                                  ),
                                ],
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              )),
        ],
      );
  
  
  
  _detailPage(BuildContext context, NoteModel noteModel) {
      Navigator.push(
          context,
          PageTransition(
              type: PageTransitionType.rightToLeft,
              child: NoteDetail(
                content: noteModel,
              )));
    }
  </code></pre>
  
  <hr>
  
  <p><em>note_detail.dart</em></p>
  
  <pre><code>Column(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: &lt;Widget&gt;[
                          Card(
                            elevation: 3,
                            shape: RoundedRectangleBorder(),
                            child: Container(
                              alignment: Alignment.centerLeft,
                              height: 50,
                              width: MediaQuery.of(context).size.width,
                              padding: EdgeInsets.only(left: 8, top: 0),
                              child: SelectableText(
                                widget.content.noteHeader,
                                style: TextStyle(fontSize: 18, color: Colors.grey[800],),
                              ),
                            ),
                          ),
                          Card(
                            elevation: 3,
                            shape: RoundedRectangleBorder(),
                            child: Container(
                              alignment: Alignment.centerLeft,
                              height: 50,
                              width: MediaQuery.of(context).size.width,
                              padding: EdgeInsets.only(left: 8, top: 0),
                              child: SelectableText(
                                widget.content.noteBody,
                                style: TextStyle(fontSize: 18, color: Colors.grey[800],),
                              ),
                            ),
                          ),],
                      ),
  </code></pre>
  
  <hr>
  
  <p>On the note detail page I set notifications with flutterLocalNotificationsPlugin.schedule and I can view note details with notifications. But when I click on the notification I want to go to the detail page of the related note. I sent the ID of the record with the payload parameter.</p>
  
  <hr>
  
  <p>Then, I added the onSelectNotification method in notes.dart.</p>
  
  <pre><code>Future onSelectNotification(String payload) async {
      if (payload != null) {
  
  ######## what should I write here? ########
  
      }
    }
  </code></pre>
  
  <hr>
  
  <p>There is an ID value in payload. How can I access the note detail about ID information. Or click on the notification in which way I can go to the note detail page.</p>