File tree Expand file tree Collapse file tree 6 files changed +26
-27
lines changed Expand file tree Collapse file tree 6 files changed +26
-27
lines changed Original file line number Diff line number Diff line change 30
30
run : flutter analyze --no-pub --no-fatal-infos
31
31
32
32
- name : Ensure the Dart code is formatted correctly
33
- run : flutter format -o json --set-exit-if-changed .
33
+ run : flutter format -o none --set-exit-if-changed .
34
34
35
35
- name : Run Flutter unit tests
36
36
run : flutter test
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import 'package:onesignal_flutter/src/utils.dart';
4
4
/// the handler returns an OSInAppMessageAction object so the Dart code can act accordingly
5
5
/// This allows for custom action events within Dart
6
6
class OSInAppMessageAction extends JSONStringRepresentable {
7
-
8
7
// Name of the action event defined for the IAM element
9
8
String ? clickName;
10
9
@@ -32,19 +31,16 @@ class OSInAppMessageAction extends JSONStringRepresentable {
32
31
'closes_message' : this .closesMessage,
33
32
});
34
33
}
35
-
36
34
}
37
35
38
36
class OSInAppMessage extends JSONStringRepresentable {
39
37
String ? messageId;
40
38
41
39
OSInAppMessage (Map <String , dynamic > json) {
42
40
this .messageId = json["message_id" ];
43
- }
41
+ }
44
42
45
43
String jsonRepresentation () {
46
- return convertToJsonString ({
47
- 'message_id' : this .messageId
48
- });
44
+ return convertToJsonString ({'message_id' : this .messageId});
49
45
}
50
46
}
Original file line number Diff line number Diff line change @@ -84,7 +84,6 @@ class OSPermissionStateChanges extends JSONStringRepresentable {
84
84
}
85
85
86
86
class OSDeviceState extends JSONStringRepresentable {
87
-
88
87
bool hasNotificationPermission = false ;
89
88
bool pushDisabled = false ;
90
89
bool subscribed = false ;
@@ -110,7 +109,10 @@ class OSDeviceState extends JSONStringRepresentable {
110
109
this .emailAddress = json['emailAddress' ] as String ? ;
111
110
this .smsUserId = json['smsUserId' ] as String ? ;
112
111
this .smsNumber = json['smsNumber' ] as String ? ;
113
- this .notificationPermissionStatus = json['notificationPermissionStatus' ] == null ? null : OSNotificationPermission .values[json['notificationPermissionStatus' ]];
112
+ this .notificationPermissionStatus = json['notificationPermissionStatus' ] ==
113
+ null
114
+ ? null
115
+ : OSNotificationPermission .values[json['notificationPermissionStatus' ]];
114
116
}
115
117
116
118
String jsonRepresentation () {
@@ -129,4 +131,4 @@ class OSDeviceState extends JSONStringRepresentable {
129
131
'notificationPermissionStatus' : this .notificationPermissionStatus? .index,
130
132
});
131
133
}
132
- }
134
+ }
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ class OSEmailSubscriptionStateChanges extends JSONStringRepresentable {
93
93
94
94
OSEmailSubscriptionStateChanges (Map <String , dynamic > json) {
95
95
if (json.containsKey ('from' ))
96
- this .from = OSEmailSubscriptionState (json['from' ].cast <String , dynamic >());
96
+ this .from =
97
+ OSEmailSubscriptionState (json['from' ].cast <String , dynamic >());
97
98
if (json.containsKey ('to' ))
98
99
this .to = OSEmailSubscriptionState (json['to' ].cast <String , dynamic >());
99
100
}
@@ -151,4 +152,4 @@ class OSSMSSubscriptionStateChanges extends JSONStringRepresentable {
151
152
'to' : this .to.jsonRepresentation ()
152
153
});
153
154
}
154
- }
155
+ }
Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ dynamic convertEnumCaseToValue(dynamic key) {
61
61
}
62
62
63
63
switch (key) {
64
- case OSSession .DIRECT :
65
- return "DIRECT" ;
66
- case OSSession .INDIRECT :
67
- return "INDIRECT" ;
68
- case OSSession .UNATTRIBUTED :
69
- return "UNATTRIBUTED" ;
70
- case OSSession .DISABLED :
71
- return "DISABLED" ;
64
+ case OSSession .DIRECT :
65
+ return "DIRECT" ;
66
+ case OSSession .INDIRECT :
67
+ return "INDIRECT" ;
68
+ case OSSession .UNATTRIBUTED :
69
+ return "UNATTRIBUTED" ;
70
+ case OSSession .DISABLED :
71
+ return "DISABLED" ;
72
72
}
73
73
74
74
return key;
@@ -78,9 +78,9 @@ dynamic convertEnumCaseToValue(dynamic key) {
78
78
abstract class JSONStringRepresentable {
79
79
String jsonRepresentation ();
80
80
81
- String convertToJsonString (Map <String , dynamic >? object) => JsonEncoder
82
- .withIndent (' ' )
83
- .convert (object)
84
- .replaceAll ("\\ n" , "\n " )
85
- .replaceAll ("\\ " , "" );
81
+ String convertToJsonString (Map <String , dynamic >? object) =>
82
+ JsonEncoder .withIndent (' ' )
83
+ .convert (object)
84
+ .replaceAll ("\\ n" , "\n " )
85
+ .replaceAll ("\\ " , "" );
86
86
}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import 'package:onesignal_flutter/onesignal_flutter.dart';
3
3
import 'mock_channel.dart' ;
4
4
import 'test_data.dart' ;
5
5
6
-
7
6
void main () {
8
7
TestWidgetsFlutterBinding .ensureInitialized ();
9
8
@@ -55,7 +54,8 @@ void main() {
55
54
}).then (expectAsync1 ((v) {
56
55
expect (channelController.state.postNotificationJson! ['content_available' ],
57
56
true );
58
- expect (channelController.state.postNotificationJson! ['include_player_ids' ],
57
+ expect (
58
+ channelController.state.postNotificationJson! ['include_player_ids' ],
59
59
[testPlayerId]);
60
60
}));
61
61
});
You can’t perform that action at this time.
0 commit comments