Skip to content

Commit

Permalink
Merge pull request #7 from takenet/extension-fix
Browse files Browse the repository at this point in the history
Exported NotificationEventExtension
  • Loading branch information
leonardogbr authored Apr 8, 2022
2 parents 0a9a15a + 84e1413 commit b5dc34f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.12

* Exported NotificationEventExtension

## 0.0.11

* New onNegotiationgStatus on ClientChannel
Expand Down
1 change: 1 addition & 0 deletions lib/lime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ library lime;

export 'src/protocol/guid.dart' show guid;
export 'src/protocol/extensions/string.extension.dart' show StringExtension;
export 'src/protocol/extensions/notification_event.extension.dart' show NotificationEventExtension;
export 'src/protocol/command.dart' show Command;
export 'src/protocol/document.dart' show Document;
export 'src/protocol/envelope.dart' show Envelope;
Expand Down
34 changes: 0 additions & 34 deletions lib/src/protocol/enums/notification_event.enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,3 @@ enum NotificationEvent {

unknown,
}

extension NotificationEventExtension on NotificationEvent {
NotificationEvent getValue(String stringValue) {
NotificationEvent value;

switch (stringValue.toLowerCase()) {
case 'failed':
value = NotificationEvent.failed;
break;
case 'accepted':
value = NotificationEvent.accepted;
break;
case 'validated':
value = NotificationEvent.validated;
break;
case 'authorized':
value = NotificationEvent.authorized;
break;
case 'dispatched':
value = NotificationEvent.dispatched;
break;
case 'received':
value = NotificationEvent.received;
break;
case 'consumed':
value = NotificationEvent.consumed;
break;
default:
value = NotificationEvent.unknown;
}

return value;
}
}
35 changes: 35 additions & 0 deletions lib/src/protocol/extensions/notification_event.extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import '../enums/notification_event.enum.dart';

extension NotificationEventExtension on NotificationEvent {
NotificationEvent getValue(String stringValue) {
NotificationEvent value;

switch (stringValue.toLowerCase()) {
case 'failed':
value = NotificationEvent.failed;
break;
case 'accepted':
value = NotificationEvent.accepted;
break;
case 'validated':
value = NotificationEvent.validated;
break;
case 'authorized':
value = NotificationEvent.authorized;
break;
case 'dispatched':
value = NotificationEvent.dispatched;
break;
case 'received':
value = NotificationEvent.received;
break;
case 'consumed':
value = NotificationEvent.consumed;
break;
default:
value = NotificationEvent.unknown;
}

return value;
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lime
description: LIME Protocol for Dart/Flutter - A lightweight messaging library
version: 0.0.11
version: 0.0.12
homepage: https://limeprotocol.org/
repository: https://github.com/takenet/lime-dart

Expand Down

0 comments on commit b5dc34f

Please sign in to comment.