Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.1"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.3"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
Expand All @@ -56,7 +56,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -80,21 +80,21 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.1"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.1"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -106,56 +106,56 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.2"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.1"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.2"
version: "0.4.2"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
sdks:
dart: ">=2.10.0-110 <2.11.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"
10 changes: 5 additions & 5 deletions lib/content/notification/notificatioin_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class NotificationContent {
final String titleText;

/// sets the notification text body
final String bodyText;
final String? bodyText;

/// sets the sub text of the notification
final String subText;
final String? subText;

/// the notification icon name to use.
///
Expand All @@ -27,7 +27,7 @@ class NotificationContent {

/// the notification color
/// if `null` the default color is used
final Color color;
final Color? color;

/// the notification priority
/// can't be `null`
Expand All @@ -36,8 +36,8 @@ class NotificationContent {
/// used for setting the notification content
/// for further reading click [here](https://developer.android.com/reference/androidx/core/app/NotificationCompat.Builder)
NotificationContent({
@required this.titleText,
@required this.iconName,
required this.titleText,
required this.iconName,
this.bodyText,
this.subText,
this.enableSound = false,
Expand Down
2 changes: 1 addition & 1 deletion lib/content/notification/notification_priority.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ enum NotificationPriority {
}

extension PriorityExtension on NotificationPriority {
int get priority {
int? get priority {
switch (this) {
case NotificationPriority.defaultPr:
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class NotificationChannelContent {
/// used for setting the notification content
/// for further reading click [here](https://developer.android.com/reference/android/app/NotificationChannel)
NotificationChannelContent({
@required this.id,
@required this.nameText,
required this.id,
required this.nameText,
this.descriptionText = "",
this.importance = NotificationChannelImportance.defaultIm,
this.lockscreenVisibility = NotificationChannelLockscreenVisibility.secret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum NotificationChannelImportance {
}

extension ImportanceExtension on NotificationChannelImportance {
int get importance {
int? get importance {
switch (this) {
case NotificationChannelImportance.unspecified:
return -1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ enum NotificationChannelLockscreenVisibility {

extension LockscreenVisibilityExtension
on NotificationChannelLockscreenVisibility {
int get visibility {
int? get visibility {
switch (this) {
case NotificationChannelLockscreenVisibility.public:
return 1;
Expand Down
28 changes: 14 additions & 14 deletions lib/flutter_foreground_service_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ class FlutterForegroundServicePlugin {
/// change a channel's name and description.`
/// [Click here for further reading about the android notification channels](https://developer.android.com/training/notify-user/channels)
static Future<void> startForegroundService({
@required NotificationContent notificationContent,
@required NotificationChannelContent notificationChannelContent,
required NotificationContent notificationContent,
required NotificationChannelContent notificationChannelContent,
bool isStartOnBoot = false,
}) async {
assert(notificationContent != null);
assert(notificationChannelContent != null);
assert(isStartOnBoot != null);

int notifColorValue = notificationContent.color != null
? notificationContent.color.red << 16 |
notificationContent.color.green << 8 |
notificationContent.color.blue
int? notifColorValue = notificationContent.color != null
? notificationContent.color!.red << 16 |
notificationContent.color!.green << 8 |
notificationContent.color!.blue
: null;

Map<String, dynamic> args = {
Expand Down Expand Up @@ -94,14 +94,14 @@ class FlutterForegroundServicePlugin {
}

static Future<void> refreshForegroundServiceContent({
@required NotificationContent notificationContent,
required NotificationContent notificationContent,
}) async {
assert(notificationContent != null);

int notifColorValue = notificationContent.color != null
? notificationContent.color.red << 16 |
notificationContent.color.green << 8 |
notificationContent.color.blue
int? notifColorValue = notificationContent.color != null
? notificationContent.color!.red << 16 |
notificationContent.color!.green << 8 |
notificationContent.color!.blue
: null;

Map<String, dynamic> args = {
Expand All @@ -120,7 +120,7 @@ class FlutterForegroundServicePlugin {

/// Checks wether the service is running or not
/// if it is returns true, false otherwise
static Future<bool> isForegroundServiceRunning() async {
static Future<bool?> isForegroundServiceRunning() async {
return await _foreground_channel.invokeMethod(_isServiceRunning);
}

Expand Down Expand Up @@ -150,7 +150,7 @@ class FlutterForegroundServicePlugin {
static Future<void> startPeriodicTask({
Duration delay = const Duration(milliseconds: 0),
Duration period = const Duration(milliseconds: 1),
@required void Function() periodicTaskFun,
required void Function() periodicTaskFun,
}) async {
assert(delay != null);
assert(period != null);
Expand All @@ -159,7 +159,7 @@ class FlutterForegroundServicePlugin {
assert(periodicTaskFun != null);

var rawTaskHandler =
PluginUtilities.getCallbackHandle(periodicTaskFun).toRawHandle();
PluginUtilities.getCallbackHandle(periodicTaskFun)!.toRawHandle();

Map<String, dynamic> args = {
'taskDelay': delay.inMilliseconds,
Expand Down
Loading