mirror of
https://github.com/hanskokx/arcane_helper_utils.git
synced 2026-05-14 02:19:09 +02:00
v1.2.5
- Null `String`s being manipulated should return `null` instead of an empty `String` Signed-off-by: Hans Kokx <hans.kokx@hackberry.se>
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.2.5
|
||||||
|
|
||||||
|
- Null `String`s being manipulated should return `null` instead of an empty `String`
|
||||||
|
|
||||||
## 1.2.4
|
## 1.2.4
|
||||||
|
|
||||||
- Made `String` manipulation utilities available for nullable objects
|
- Made `String` manipulation utilities available for nullable objects
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ extension TextManipulation on String? {
|
|||||||
/// String text = "hello";
|
/// String text = "hello";
|
||||||
/// String capitalized = text.capitalize; // "Hello"
|
/// String capitalized = text.capitalize; // "Hello"
|
||||||
/// ```
|
/// ```
|
||||||
String get capitalize {
|
String? get capitalize {
|
||||||
if (isNullOrEmpty) return "";
|
if (isNullOrEmpty) return null;
|
||||||
return "${this![0].toUpperCase()}${this!.substring(1).toLowerCase()}";
|
return "${this![0].toUpperCase()}${this!.substring(1).toLowerCase()}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ extension TextManipulation on String? {
|
|||||||
/// String text = "hello world";
|
/// String text = "hello world";
|
||||||
/// String capitalizedWords = text.capitalizeWords; // "Hello World"
|
/// String capitalizedWords = text.capitalizeWords; // "Hello World"
|
||||||
/// ```
|
/// ```
|
||||||
String get capitalizeWords {
|
String? get capitalizeWords {
|
||||||
if (isNullOrEmpty) return "";
|
if (isNullOrEmpty) return null;
|
||||||
final strings = this!.split(" ");
|
final strings = this!.split(" ");
|
||||||
return strings.map((s) => s.capitalize).join(" ");
|
return strings.map((s) => s.capitalize).join(" ");
|
||||||
}
|
}
|
||||||
@@ -120,8 +120,8 @@ extension TextManipulation on String? {
|
|||||||
/// String text = "ArcaneHelperUtils";
|
/// String text = "ArcaneHelperUtils";
|
||||||
/// String spaced = text.spacePascalCase; // "Arcane Helper Utils"
|
/// String spaced = text.spacePascalCase; // "Arcane Helper Utils"
|
||||||
/// ```
|
/// ```
|
||||||
String get spacePascalCase {
|
String? get spacePascalCase {
|
||||||
if (isNullOrEmpty) return "";
|
if (isNullOrEmpty) return null;
|
||||||
final List<String> strings = this!.split(
|
final List<String> strings = this!.split(
|
||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
name: arcane_helper_utils
|
name: arcane_helper_utils
|
||||||
description: Provides a variety of helpful utilities and extensions for Flutter
|
description: Provides a variety of helpful utilities and extensions for Flutter
|
||||||
and Dart.
|
and Dart.
|
||||||
version: 1.2.4
|
version: 1.2.5
|
||||||
repository: https://github.com/hanskokx/arcane_helper_utils
|
repository: https://github.com/hanskokx/arcane_helper_utils
|
||||||
issue_tracker: https://github.com/hanskokx/arcane_helper_utils/issues
|
issue_tracker: https://github.com/hanskokx/arcane_helper_utils/issues
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user