createActivity method

  1. @override
Future<String?> createActivity(
  1. Map<String, dynamic> data, {
  2. bool removeWhenAppIsKilled = false,
  3. Duration? staleIn,
})
override

Implementation

@override
Future<String?> createActivity(
  Map<String, dynamic> data, {
  bool removeWhenAppIsKilled = false,
  Duration? staleIn,
}) async {
  // If the duration is less than 1 minute then pass a null value instead of using 0 minutes
  final staleInMinutes =
      (staleIn?.inMinutes ?? 0) >= 1 ? staleIn?.inMinutes : null;
  return methodChannel.invokeMethod<String>('createActivity', {
    'data': data,
    'removeWhenAppIsKilled': removeWhenAppIsKilled,
    'staleIn': staleInMinutes,
  });
}