Flutter locale notification in spesific date and time

Viewed 187

I'm trying to add local schedule notification to my app but it's not working. My app has datetime picker so I'm trying to send notification spesific date and time. How can I do that? My codes are below. Thanks in advance for your comments.

@override
      void initState() {
        initSettings();
        tz.initializeTimeZones();
        super.initState();
      }
    
      Future<void> displayNot(String postBaslik, DateTime postZaman) async {
        var androidDetails = new AndroidNotificationDetails("channelId", "channelName", "channelDescription",importance: Importance.high);
        var iosDetails = new IOSNotificationDetails();
        var generalNotificationDetails= new NotificationDetails(android: androidDetails, iOS: iosDetails);
        await notificationsPlugin.show(0, "title", "body", generalNotificationDetails);
    
    void initSettings() async {
      var initAndorid = AndroidInitializationSettings('my_logo');
      var initIOS= IOSInitializationSettings();
      var initSetting = InitializationSettings(android: initAndorid, iOS: initIOS);
      await notificationsPlugin.initialize(initSetting);
    }
0 Answers
Related