Skip to content

Commit 9ad2822

Browse files
committed
fix code format
1 parent 01ac231 commit 9ad2822

File tree

6 files changed

+25
-23
lines changed

6 files changed

+25
-23
lines changed

example/lib/main.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ class _HomePageState extends State<HomePage> {
3939
'message': 'Hi',
4040
},
4141
const emailjs.Options(
42-
publicKey: 'YOUR_PUBLIC_KEY',
43-
privateKey: 'YOUR_PRIVATE_KEY',
44-
limitRate: const emailjs.LimitRate(
45-
id: 'app',
46-
throttle: 10000,
47-
)
48-
),
42+
publicKey: 'YOUR_PUBLIC_KEY',
43+
privateKey: 'YOUR_PRIVATE_KEY',
44+
limitRate: const emailjs.LimitRate(
45+
id: 'app',
46+
throttle: 10000,
47+
)),
4948
);
5049
print('SUCCESS!');
5150
} catch (error) {

lib/src/api/send_post.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import '../models/emailjs_response_status.dart';
55
/// sends JSON object via HTTPS POST
66
Future<EmailJSResponseStatus> sendPost(
77
String url,
8-
String data,
9-
[
10-
Client? client,
11-
]) async {
12-
8+
String data, [
9+
Client? client,
10+
]) async {
1311
client ??= Client();
1412

1513
try {
@@ -20,7 +18,7 @@ Future<EmailJSResponseStatus> sendPost(
2018
},
2119
body: data,
2220
);
23-
21+
2422
final responseStatus = EmailJSResponseStatus(
2523
status: response.statusCode,
2624
text: response.body,

lib/src/methods/send.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,24 @@ Future<EmailJSResponseStatus> send(
2828
]) async {
2929
final publicKey = options?.publicKey ?? store.publicKey;
3030
final privateKey = options?.privateKey ?? store.privateKey;
31-
final StorageProvider storageProvider = options?.storageProvider ?? store.storageProvider;
31+
final StorageProvider storageProvider =
32+
options?.storageProvider ?? store.storageProvider;
3233

3334
final BlockList blockList = BlockList(
3435
list: options?.blockList?.list ?? store.blockList?.list,
35-
watchVariable: options?.blockList?.watchVariable ?? store.blockList?.watchVariable,
36+
watchVariable:
37+
options?.blockList?.watchVariable ?? store.blockList?.watchVariable,
3638
);
37-
39+
3840
final LimitRate limitRate = LimitRate(
3941
id: options?.limitRate?.id ?? store.limitRate?.id,
4042
throttle: store.limitRate?.throttle ?? options?.limitRate?.throttle ?? 0,
4143
);
4244

4345
validateParams(publicKey, serviceID, templateID);
4446

45-
if (templateParams != null && isBlockedValueInParams(blockList, templateParams)) {
47+
if (templateParams != null &&
48+
isBlockedValueInParams(blockList, templateParams)) {
4649
return Future.error(blockedEmailError());
4750
}
4851

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import '../models/block_list.dart';
22

33
bool isBlockListDisabled(BlockList options) {
4-
return options.list == null || options.list!.isEmpty || options.watchVariable == null;
4+
return options.list == null ||
5+
options.list!.isEmpty ||
6+
options.watchVariable == null;
57
}
68

79
bool isBlockedValueInParams(
810
BlockList options,
911
Map<String, dynamic> params,
1012
) {
11-
if (isBlockListDisabled(options)) return false;
13+
if (isBlockListDisabled(options)) return false;
1214

13-
final value = params[options.watchVariable];
14-
return options.list!.contains(value);
15+
final value = params[options.watchVariable];
16+
return options.list!.contains(value);
1517
}

lib/src/utils/is_limit_rate_hit.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Future<bool> isLimitRateHit(
2020
}
2121

2222
final id = options.id ?? 'default';
23-
23+
2424
validateLimitRateParams(options.throttle!, id);
2525

2626
final leftTime = await getLeftTime(id, options.throttle!, storage);

lib/src/utils/validate_limit_rate_params.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ void validateLimitRateParams(int throttle, [String? id]) {
66
if (id != null && id.isEmpty) {
77
throw 'The LimitRate ID has to be a non-empty string';
88
}
9-
}
9+
}

0 commit comments

Comments
 (0)