Skip to content

[flutter_local_notifications] How about using Named Parameters for some functions? #2609

Description

@TaeBbong

Hi @MaikuB ! I've used this package for my projects, and I'm really appreciate about this nice package.

I have some enhancement points;

  • Using Named Parameters for functions in lib/src/flutter_local_notifications_plugin.dart
    Functions we use such as zonedSchedule() or periodicallyShow() provides positional parameters like:
Future<void> zonedSchedule(
    int id,
    String? title,
    String? body,
    TZDateTime scheduledDate,
    NotificationDetails notificationDetails, {
    required AndroidScheduleMode androidScheduleMode,
    String? payload,
    DateTimeComponents? matchDateTimeComponents,
  })

When we use this, we sometimes get confused about which order to put parameters in it.
So I suggest named parameters like:

Future<void> periodicallyShow({
  required int id,
  String? title,
  String? body,
  required RepeatInterval repeatInterval,
  required NotificationDetails notificationDetails,
  required AndroidScheduleMode androidScheduleMode,
  String? payload,
});

If you think this would work well, I would like to get on this work then make pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions