Код: Выделить всё
void main() async {
WidgetsFlutterBinding.ensureInitialized();
AwesomeNotifications().initialize(
null,
[
NotificationChannel(
channelKey: 'Mederipan',
channelName: 'Mederipan',
channelDescription: 'Notificaciones de Mederipan',
defaultColor: Color(0xFF9D50DD),
ledColor: Colors.white,
importance: NotificationImportance.High,
),
],
);
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
runApp(MyApp());
}
Код: Выделить всё
void scheduleNotification() {
AwesomeNotifications().createNotification(
content: NotificationContent(
id: 10,
channelKey: 'Mederipan',
title: 'Recordatorio sobre tarjetas',
body: '¡Ahora puede practicar la especialidad de ${widget.category} con las nuevas tarjetas disponibles desde hoy!',
notificationLayout: NotificationLayout.Default,
),
schedule: NotificationCalendar.fromDate(
date: DateTime.now().add(Duration(minutes: 5)),
preciseAlarm: true,
repeats: false,
),
);
}
Подробнее здесь: https://stackoverflow.com/questions/785 ... tions-even