Flutter: Scheduled notification datetime

Hi guys,

I’m looking to integrate Flutter’s plugin date_time_picker with local notification.

So when I select a date&time I also schedule a notification.

Here’s my code…could you help me? Now I don’t have any error but code is not working.

Future scheuleAtParticularTime(DateTime timee) async {
var time = DateTime(timee.day, timee.month, timee.year, timee.hour,
timee.minute, timee.second);

var scheduledNotificationDateTime =
    new DateTime.now().add(new Duration(seconds: 5));
var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
    'your other channel id',
    'your other channel name',
    'your other channel description');

var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
NotificationDetails platformChannelSpecifics = new NotificationDetails(
android: androidPlatformChannelSpecifics,
iOS: iOSPlatformChannelSpecifics);

await fltrNotification.schedule(1, ‘scheduled title’, ‘scheduled body’,
scheduledNotificationDateTime, platformChannelSpecifics);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
FlatButton(
onPressed: () {
DatePicker.showDateTimePicker(context, showTitleActions: true,
onChanged: (date) {
print(‘change $date’);
}, onConfirm: (date) {
print(‘confirm $date’);
scheuleAtParticularTime(DateTime.fromMillisecondsSinceEpoch(
date.millisecondsSinceEpoch));
}, currentTime: DateTime.now(), locale: LocaleType.it);
},
child: Text(
‘Select time for notification arrival’,
style:
TextStyle(color: Colors.black, fontWeight: FontWeight.w900),
),
),
],
),
),
);
}