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.
Code:
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: 1));
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);
// tz.initializeTimeZones();
// tz.setLocalLocation(tz.getLocation('Italy'));
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),
),
),
],
),
),
);
}
Thanks!
--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/5eed40c6-d1b1-4a25-a7b3-f014470811efn%40googlegroups.com.
var time = DateTime(timee.day, timee.month, timee.year, timee.hour,
timee.minute, timee.second);
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/636cc30a-4f53-4fe3-9c3f-75e34bb39084n%40googlegroups.com.
‘var scheduledNotificationDateTime = DateTime.now().add(new Duration(seconds: 1));’
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/DB8PR10MB37826A6846AD2B8C50C258DFA41F0%40DB8PR10MB3782.EURPRD10.PROD.OUTLOOK.COM.
Expected, picked from the plugin date timeIl Mar 20 Ott 2020, 23:40 Suzuki Tomohiro <suz...@gmail.com> ha scritto:Are these dates expected or unexpected?
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/2aa95e3f-7e94-4b93-90ad-eba52c165cc9n%40googlegroups.com.