Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit f9a1999

Browse files
author
github-actions
committed
Prepare release for version 0.57.1
1 parent ce28e93 commit f9a1999

12 files changed

+59
-26
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## [0.57.1]
44

5-
- Released @ 2024-06-15 01:51:49.477363Z
5+
- Released @ 2024-06-23 04:28:16.242352Z
66
- Fix exports
7+
- Organize source code structure and refactor
78

89
## [0.57.0]
910

lib/src/core/src/debug_log.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ void _debugLog({
185185
if (group == null || groups.contains(group)) {
186186
final colorPath = color != null ? AnsiStyle.italic + color : null;
187187
final colorTitle = color != null ? AnsiStyle.bold + color : null;
188-
final path = (rec?.code != null ? '${rec!.code}' : '').withAnsiStyle(colorPath);
189-
final title = '['.withAnsiStyle(colorTitle) + path + ']'.withAnsiStyle(colorTitle);
188+
final path =
189+
(rec?.code != null ? '${rec!.code}' : '').withAnsiStyle(colorPath);
190+
final title =
191+
'['.withAnsiStyle(colorTitle) + path + ']'.withAnsiStyle(colorTitle);
190192
final m = message.toString();
191193
final mStyled = m.withAnsiStyle(style);
192194
final resultUnstyled = '$icon $m';

lib/src/core/src/let.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ T? letOrNull<T>(dynamic input) {
116116
return letBoolOrNull(input) as T;
117117
} else if (typeEquality<T, DateTime>() || typeEquality<T, DateTime?>()) {
118118
return letDateTimeOrNull(input) as T;
119-
} else if (typeEquality<T, FirestoreTimestamp>() || typeEquality<T, FirestoreTimestamp?>()) {
119+
} else if (typeEquality<T, FirestoreTimestamp>() ||
120+
typeEquality<T, FirestoreTimestamp?>()) {
120121
return letFirestoreTimestampOrNull(input) as T;
121122
} else if (typeEquality<T, Duration>() || typeEquality<T, Duration?>()) {
122123
return letDurationOrNull(input) as T;
@@ -285,7 +286,8 @@ Map<K, V>? letMapOrNull<K, V>(
285286
final temp = decoded.entries
286287
.map((entry) {
287288
final convertedKey = letOrNull<K>(entry.key);
288-
final convertedValue = letOrNull<V>(entry.value) ?? letOrNull<V?>(nullFallback);
289+
final convertedValue =
290+
letOrNull<V>(entry.value) ?? letOrNull<V?>(nullFallback);
289291
if (filterNulls) {
290292
if (!isNullable<K>() && convertedKey == null) {
291293
return const _Empty();

lib/src/http/src/http_service.dart

+14-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class HttpService {
3636
Duration timeout = const Duration(seconds: 30),
3737
Map<String, String>? headers,
3838
}) async {
39-
return await http.get(url, headers: headers).handleExceptions(timeout: timeout);
39+
return await http
40+
.get(url, headers: headers)
41+
.handleExceptions(timeout: timeout);
4042
}
4143

4244
//
@@ -50,7 +52,9 @@ class HttpService {
5052
Duration timeout = const Duration(seconds: 30),
5153
Map<String, String>? headers,
5254
}) async {
53-
final response = await http.get(url, headers: headers).handleExceptions(timeout: timeout);
55+
final response = await http
56+
.get(url, headers: headers)
57+
.handleExceptions(timeout: timeout);
5458
return (response, response.bodyJson);
5559
}
5660

@@ -65,7 +69,9 @@ class HttpService {
6569
Duration timeout = const Duration(seconds: 30),
6670
Map<String, String>? headers,
6771
}) async {
68-
final response = await http.get(url, headers: headers).handleExceptions(timeout: timeout);
72+
final response = await http
73+
.get(url, headers: headers)
74+
.handleExceptions(timeout: timeout);
6975
return (response, response.bodyBytes);
7076
}
7177

@@ -81,7 +87,9 @@ class HttpService {
8187
}) async {
8288
final url = composedRequest.$1;
8389
final body = composedRequest.$2;
84-
return await http.post(url, headers: headers, body: body).handleExceptions(timeout: timeout);
90+
return await http
91+
.post(url, headers: headers, body: body)
92+
.handleExceptions(timeout: timeout);
8593
}
8694

8795
//
@@ -141,7 +149,8 @@ class HttpService {
141149
/// Returns the current IP address of the device.
142150
Future<String?> getCurrentIpAddress() async {
143151
try {
144-
final response = await http.get(Uri.parse('https://api.ipify.org?format=json'));
152+
final response =
153+
await http.get(Uri.parse('https://api.ipify.org?format=json'));
145154
if (response.statusCode == 200) {
146155
final jsonData = jsonDecode(response.body);
147156
return jsonData['ip'];

lib/src/location_utils/src/calculate_havershire_3d_distance_on_location_package_extension.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ import 't_location_components.dart';
1717

1818
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
1919

20-
extension CalculateHavershire3DDistanceOnLocationPackageExtension on LocationUtils {
20+
extension CalculateHavershire3DDistanceOnLocationPackageExtension
21+
on LocationUtils {
2122
/// Calculate the distance between two locations using the Haversine formula
2223
/// and optionally the elevation difference.
2324
///

lib/src/location_utils/src/calculate_zoom_to_fit_on_location_package_extension.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ extension CalculateZoomToFitOnLocationPackageExtension on LocationUtils {
4242
}
4343
final lngDelta = maxLng - minLng;
4444
// Estimate zoom level based on longitude span.
45-
final estimate = max(0.0, 1.0 - log(lngDelta) / log(2.0) + (log(360) / log(2.0)) - 1);
45+
final estimate =
46+
max(0.0, 1.0 - log(lngDelta) / log(2.0) + (log(360) / log(2.0)) - 1);
4647
// Apply the factor and clamp the zoom level.
4748
final zoom = max(minZoom, min(maxZoom, estimate)) * factor;
4849
return zoom;

lib/src/location_utils/src/celestial_radius.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ enum CelestialRadius {
4343
double get inNauticalMiles => this.convert(DistanceUnit.NAUTICAL_MILES);
4444
double get inFeet => this.convert(DistanceUnit.FEET);
4545
double get inYards => this.convert(DistanceUnit.YARDS);
46-
double get inAstronomicalUnits => this.convert(DistanceUnit.ASTRONOMICAL_UNITS);
46+
double get inAstronomicalUnits =>
47+
this.convert(DistanceUnit.ASTRONOMICAL_UNITS);
4748

4849
//
4950
//

lib/src/location_utils/src/t_location_components.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
99
//.title~
1010

11-
typedef TLocationComponents = ({double longitude, double latitude, double altitude});
11+
typedef TLocationComponents = ({
12+
double longitude,
13+
double latitude,
14+
double altitude
15+
});

lib/src/patterns/src/replace_patterns.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ String replacePatterns(
3030
final e1 = parts.elementAtOrNull(1);
3131
final key = (e1 ?? e0)!;
3232
final defaultValue = e0 ?? key;
33-
final data1 =
34-
settings.caseSensitive ? data : data.map((k, v) => MapEntry(k.toString().toLowerCase(), v));
33+
final data1 = settings.caseSensitive
34+
? data
35+
: data.map((k, v) => MapEntry(k.toString().toLowerCase(), v));
3536
final key1 = settings.caseSensitive ? key : key.toLowerCase();
3637
final suggestedReplacementValue = data1[key1];
3738
final replacementValue =

lib/src/strings/src/misc_on_string_extension.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
extension MiscOnStringExtension on String {
1414
/// Truncates the string to the given [length] and adds '...' at the end.
1515
String truncToLength(int length) {
16-
return (this.length > length ? '${this.substring(0, length).trim()}...' : this);
16+
return (this.length > length
17+
? '${this.substring(0, length).trim()}...'
18+
: this);
1719
}
1820

1921
/// Replaces all whitespace characters with a single space.

lib/src/strings/src/string_case_conversions_on_string_extension.dart

+8-4
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ extension StringCaseConversionsOnStringExtension on String {
3939
String toUpperDotCase() => this.toDotCase().toUpperCase();
4040

4141
/// Converts the string to path/case.
42-
String toPathCase([String separator = '/']) => this.extractLowercaseComponents().join(separator);
42+
String toPathCase([String separator = '/']) =>
43+
this.extractLowercaseComponents().join(separator);
4344

4445
/// Converts the string to camelCase.
4546
String toCamelCase() => this.toPascalCase().withFirstLetterAsLowerCase();
4647

4748
/// Converts the string to PascalCase.
48-
String toPascalCase() => this.extractLowercaseComponents().map((e) => e.capitalize()).join();
49+
String toPascalCase() =>
50+
this.extractLowercaseComponents().map((e) => e.capitalize()).join();
4951

5052
/// Extracts and returns a list of lowercase components from the string.
5153
///
@@ -101,10 +103,12 @@ extension StringCaseConversionsOnStringExtension on String {
101103
bool get isLetter => RegExp(r'^[a-zA-Z]$').hasMatch(this);
102104

103105
/// Returns `true` if the string is all uppercase.
104-
bool get isUpperCase => this == this.toUpperCase() && this != this.toLowerCase();
106+
bool get isUpperCase =>
107+
this == this.toUpperCase() && this != this.toLowerCase();
105108

106109
/// Returns `true` if the string is all lowercase.
107-
bool get isLowerCase => this == this.toLowerCase() && this != this.toUpperCase();
110+
bool get isLowerCase =>
111+
this == this.toLowerCase() && this != this.toUpperCase();
108112

109113
/// Capitalizes the first letter of the string.
110114
///

lib/src/time/src/date_time.dart

+10-5
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ extension UtilsOnDateTimeExtension on DateTime {
5858
/// ''|single quote|(Literal)|'o''clock'
5959
///
6060
/// For more info, see: https://api.flutter.dev/flutter/intl/DateFormat-class.html
61-
String format(String pattern, String locale) => DateFormat(pattern, locale).format(this);
61+
String format(String pattern, String locale) =>
62+
DateFormat(pattern, locale).format(this);
6263

6364
/// e.g. August 8, 2023
6465
String full([String? localeCode]) {
@@ -126,10 +127,14 @@ bool isSameDay(DateTime date1, DateTime date2) {
126127
bool isSameWeek(DateTime date1, DateTime date2) {
127128
final a = date1.toUtc();
128129
final b = date2.toUtc();
129-
final week1 =
130-
DateTime.utc(a.year, a.month, a.day).difference(DateTime.utc(a.year, a.month)).inDays ~/ 7;
131-
final week2 =
132-
DateTime.utc(b.year, b.month, b.day).difference(DateTime.utc(b.year, b.month)).inDays ~/ 7;
130+
final week1 = DateTime.utc(a.year, a.month, a.day)
131+
.difference(DateTime.utc(a.year, a.month))
132+
.inDays ~/
133+
7;
134+
final week2 = DateTime.utc(b.year, b.month, b.day)
135+
.difference(DateTime.utc(b.year, b.month))
136+
.inDays ~/
137+
7;
133138
return week1 == week2;
134139
}
135140

0 commit comments

Comments
 (0)