Skip to content

Commit f1c6f27

Browse files
Format project
1 parent 376dfb7 commit f1c6f27

File tree

6 files changed

+26
-27
lines changed

6 files changed

+26
-27
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: flutter analyze --no-pub --no-fatal-infos
3131

3232
- 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 .
3434

3535
- name: Run Flutter unit tests
3636
run: flutter test

lib/src/in_app_message.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:onesignal_flutter/src/utils.dart';
44
/// the handler returns an OSInAppMessageAction object so the Dart code can act accordingly
55
/// This allows for custom action events within Dart
66
class OSInAppMessageAction extends JSONStringRepresentable {
7-
87
// Name of the action event defined for the IAM element
98
String? clickName;
109

@@ -32,19 +31,16 @@ class OSInAppMessageAction extends JSONStringRepresentable {
3231
'closes_message': this.closesMessage,
3332
});
3433
}
35-
3634
}
3735

3836
class OSInAppMessage extends JSONStringRepresentable {
3937
String? messageId;
4038

4139
OSInAppMessage(Map<String, dynamic> json) {
4240
this.messageId = json["message_id"];
43-
}
41+
}
4442

4543
String jsonRepresentation() {
46-
return convertToJsonString({
47-
'message_id': this.messageId
48-
});
44+
return convertToJsonString({'message_id': this.messageId});
4945
}
5046
}

lib/src/permission.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class OSPermissionStateChanges extends JSONStringRepresentable {
8484
}
8585

8686
class OSDeviceState extends JSONStringRepresentable {
87-
8887
bool hasNotificationPermission = false;
8988
bool pushDisabled = false;
9089
bool subscribed = false;
@@ -110,7 +109,10 @@ class OSDeviceState extends JSONStringRepresentable {
110109
this.emailAddress = json['emailAddress'] as String?;
111110
this.smsUserId = json['smsUserId'] as String?;
112111
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']];
114116
}
115117

116118
String jsonRepresentation() {
@@ -129,4 +131,4 @@ class OSDeviceState extends JSONStringRepresentable {
129131
'notificationPermissionStatus': this.notificationPermissionStatus?.index,
130132
});
131133
}
132-
}
134+
}

lib/src/subscription.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class OSEmailSubscriptionStateChanges extends JSONStringRepresentable {
9393

9494
OSEmailSubscriptionStateChanges(Map<String, dynamic> json) {
9595
if (json.containsKey('from'))
96-
this.from = OSEmailSubscriptionState(json['from'].cast<String, dynamic>());
96+
this.from =
97+
OSEmailSubscriptionState(json['from'].cast<String, dynamic>());
9798
if (json.containsKey('to'))
9899
this.to = OSEmailSubscriptionState(json['to'].cast<String, dynamic>());
99100
}
@@ -151,4 +152,4 @@ class OSSMSSubscriptionStateChanges extends JSONStringRepresentable {
151152
'to': this.to.jsonRepresentation()
152153
});
153154
}
154-
}
155+
}

lib/src/utils.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ dynamic convertEnumCaseToValue(dynamic key) {
6161
}
6262

6363
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";
7272
}
7373

7474
return key;
@@ -78,9 +78,9 @@ dynamic convertEnumCaseToValue(dynamic key) {
7878
abstract class JSONStringRepresentable {
7979
String jsonRepresentation();
8080

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("\\", "");
8686
}

test/onesignalflutter_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'package:onesignal_flutter/onesignal_flutter.dart';
33
import 'mock_channel.dart';
44
import 'test_data.dart';
55

6-
76
void main() {
87
TestWidgetsFlutterBinding.ensureInitialized();
98

@@ -55,7 +54,8 @@ void main() {
5554
}).then(expectAsync1((v) {
5655
expect(channelController.state.postNotificationJson!['content_available'],
5756
true);
58-
expect(channelController.state.postNotificationJson!['include_player_ids'],
57+
expect(
58+
channelController.state.postNotificationJson!['include_player_ids'],
5959
[testPlayerId]);
6060
}));
6161
});

0 commit comments

Comments
 (0)