title: Timely send push notifications with flutter
body: <p>I have to send push notifications timely in flutter. I have a list of my tasks and  I want that app should notify me against each task using time and date. Currently I am using <code>firebase</code> to store my tasks . and here is my code ..</p>
  
  <pre><code>  @override
    void initState() {
      // TODO: implement initState
      super.initState();
      _dateText = "${_dueDate.day}/${_dueDate.month}/${_dueDate.year}";
      _timeText = "${_time.hour}:${_time.minute}";
      menuDataList = [
        new MenuData(Icons.add, (context, menuData) {
        Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context)=&gt; new AddTask(email: widget.user.email)));
  
        }
        ,labelText: 'Add Task'
        ),
        new MenuData(Icons.group_add, (context, menuData) {
          Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context)=&gt; new AddGroup(email: widget.user.email)));
        }
        ,labelText: 'Add Group'
        ),
        new MenuData(Icons.group, (context, menuData) {
  
          Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context)=&gt; new CreateGroup(email: widget.user.email  )));
        }
        ,labelText: 'View Group'
        ),
        new MenuData(Icons.search, (context, menuData) {
          Navigator.of(context).push(new MaterialPageRoute(builder: (BuildContext context)=&gt; new MySearchPage()));
        }
            ,labelText: 'Search Here'
        ),
      ];
      var android = new AndroidInitializationSettings('mipmap/ic_launcher');
      var ios = new IOSInitializationSettings();
      var platform = new InitializationSettings(android , ios);
      flutterLocalNotificationsPlugin.initialize(platform);
      _firebaseMessaging.configure(
  
        onMessage: (Map&lt;String , dynamic&gt; message){
          showNotification(message);
          print('on message $message');
  
  //        AudioCache player = new AudioCache();
  //        const alarmAudioPath = "sounds/notification.mp3";
  //        player.play(alarmAudioPath);
        },
        onResume: (Map&lt;String , dynamic&gt; message){
          showNotification(message);
          print('on message $message');
        },
        onLaunch: (Map&lt;String , dynamic&gt; message){
          showNotification(message);
          print('on message $message');
        },
      );
      _firebaseMessaging.getToken().then((token){
        print(token);
      });
    }
  
    showNotification(Map&lt;String , dynamic&gt; message) async{
      var android = new AndroidNotificationDetails('channel_id' , "CHANNAL NAME" , "channelDescription");
      var ios = IOSNotificationDetails();
      var platform = new NotificationDetails(android, ios);
      await flutterLocalNotificationsPlugin.show(0, note , newtask , platform);
    }
  </code></pre>
  
  <p>And here is the code of my list where I am showing my tasks.</p>
  
  <pre><code>class TaskList extends StatelessWidget{
    TaskList({this.document});
    final List&lt;DocumentSnapshot&gt; document;
    @override
    Widget build(BuildContext context) {
      // TODO: implement build
      return new ListView.builder(
        itemCount: document.length,
        itemBuilder: (BuildContext  , int i ){
          String title = document[i].data['title'].toString();
          String note = document[i].data['note'].toString();
          DateTime _date = document[i].data['duedate'];
          String duedate = "${_date.day}/${_date.month}/${_date.year}";
  //        String email = document[i].data['email'].toString();
  
          return new Dismissible(
            key: new Key(document[i].documentID),
            onDismissed: (direction){
              Firestore.instance.runTransaction((transaction) async{
                DocumentSnapshot snapshot= await transaction.get(document[i].reference);
                await transaction.delete(snapshot.reference);
  
              });
  
              Scaffold.of(context).showSnackBar(new SnackBar(content: new Text("Data Deleted"),));
            },
  
            child: Padding(
              padding: const EdgeInsets.only(left: 0.0, top: 0.0 ,right: 0.0 , bottom: 16.0 ),
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: &lt;Widget&gt;[
                  Padding(
                    padding: const EdgeInsets.only(bottom: 10.0),
                    child: new Align( alignment: Alignment.topLeft ,
                      child: new IconButton(icon: Icon(Icons.lens , color: Colors.black87, size: 12.0,), onPressed: (
                          ){
                      },
                      ),
                    ),
                  ),
                  new Expanded(
                    child: Container(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: &lt;Widget&gt;[
  
                          Padding(
                            padding: const EdgeInsets.only(bottom: 0.0),
                            child: Text(title , style: new TextStyle(fontSize: 16.0 , letterSpacing: 1.0),),
                          ),
                          new Row(
                            children: &lt;Widget&gt;[
                              Padding(
                                padding: const EdgeInsets.only(right: 16.0 , top: 3.0 , bottom: 3.0),
                                child: Icon(Icons.date_range , color: Colors.black54, size: 17.0),
                              ),
                             new Expanded(child: Text(duedate , style: new TextStyle(fontSize: 13.0 ),)),
                            ],
                          ),
                          new Row(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: &lt;Widget&gt;[
                              Padding(
                                padding: const EdgeInsets.only(right: 16.0),
                                child: Icon(Icons.note , color: Colors.black54, size: 17.0,),
                              ),
                              new Expanded(child: Text(note , style: new TextStyle(fontSize: 13.0 ),)),
                            ],
                          ),
                          Padding(
                            padding: const EdgeInsets.only(top: 15.0),
  
                          ),
                        ],
                      ),
                    ),
                  ),
  
                  Padding(
                    padding: const EdgeInsets.only(bottom: 10.0),
                    child: new IconButton(icon: Icon(Icons.edit , color: Colors.black54,), onPressed: (
                        ){
                       Navigator.of(context).push(new MaterialPageRoute(builder: (context)=&gt; new EditTask(
                         title: title,
                         note: note,
                         duedate: document[i].data['duedate'],
                         index:document[i].reference,
                       )));
                    },
                    ),
                  )
                ],
              ),
            ),
          );
  
        },
      );
    }
  }
  </code></pre>