saropa_dart_utils 0.5.6
saropa_dart_utils: ^0.5.6 copied to clipboard
Boilerplate reduction tools and human-readable extension methods by Saropa
Change History for Saropa Dart Utils #
....
-+shdmNMMMMNmdhs+-
-odMMMNyo/-..``.++:+o+/-
/dMMMMMM/ `````
dMMMMMMMMNdhhhdddmmmNmmddhs+-
/MMMMMMMMMMMMMMMMMMMMMMMMMMMMMNh/
. :sdmNNNNMMMMMNNNMMMMMMMMMMMMMMMMm+
o ..~~~::~+==+~:/+sdNMMMMMMMMMMMo
m .+NMMMMMMMMMN
m+ :MMMMMMMMMm
/N: :MMMMMMMMM/
oNs. +NMMMMMMMMo
:dNy/. ./smMMMMMMMMm:
/dMNmhyso+++oosydNNMMMMMMMMMd/
.odMMMMMMMMMMMMMMMMMMMMdo-
-+shdNNMMMMNNdhs+-
``
Made by Saropa. All rights reserved.
Learn more at https://saropa.com, or mailto://[email protected]
0.5.6+Wellington (Latest) #
New URI/URL Extensions #
✨ New UrlExtensions Methods
isSecure- Check if URI uses HTTPS schemeaddQueryParameter- Add or update query parameters (removes if value is null/empty)hasQueryParameter- Check if a specific query parameter existsgetQueryParameter- Get the value of a query parameterreplaceHost- Create a new URI with a different host
0.5.5+Brisbane #
New Utility Classes & Methods #
✨ New Utility Classes
JsonUtils- JSON parsing, type conversion, and validation (jsonDecodeToMap, jsonDecodeSafe, isJson, cleanJsonResponse, tryJsonDecode, toDateTimeJson, toDateTimeEpochJson, toBoolJson, toIntJson, toDoubleJson, toStringJson, and more)MapExtensions- Map manipulation (nullIfEmpty, getRandomListExcept, getChildString, getGrandchild, formatReadableString)UrlExtensions- URI manipulation (removeQuery, fileName, isValidUrl, isValidHttpUrl, tryParse)StringBetweenExtensions- Content extraction (between, betweenLast, betweenBracketsResult, removeBetween, removeBetweenAll, betweenSplit)StringCharacterExtensions- Character operations (splitByCharacterCount, charAtOrNull)StringSearchExtensions- Search utilities (containsAnyIgnoreCase, indexOfAll, lastIndexOfPattern)MonthUtils,WeekdayUtils,SerialDateUtils- Date constant lookups and parsing
✨ New DateTime Extensions
mostRecentSunday,mostRecentWeekday- Find previous occurrence of a weekdaydayOfYear,weekOfYear,numOfWeeks,weekNumber- ISO week/day calculationstoSerialString,toSerialStringDay- Serial date formatting
✨ New String Extensions
removeSingleCharacterWords,removeLeadingAndTrailing- Content cleanupfirstWord,secondWord- Word extractionendsWithAny,endsWithPunctuation,isAny- Pattern matchingextractCurlyBraces,obscureText- Content extraction/maskinghasInvalidUnicode,isVowel,hasAnyDigits- Character validation
✨ New Iterable/Num Extensions
randomElement,containsAll- Collection utilitiestoDoubleOrNull,toIntOrNull- Safe numeric conversions
✨ Enhanced DateTimeUtils
isValidDateParts- Comprehensive date part validationconvertDaysToYearsAndMonths- Now withincludeRemainingDaysoption
Extended Test Coverage #
🧪 Comprehensive Test Suite
- Added 10-20 test cases for each new utility method
- Total test count: 2850 tests (all passing)
0.5.4+Auckland #
Algorithm Fixes & Improvements #
🐛 DateTime Extensions
- Fixed
isBetweenRangeto properly forward theinclusiveparameter (was being ignored) - Fixed
isAnnualDateInRangeto correctly handle date ranges spanning year boundaries (e.g., Dec-Feb ranges) - Fixed
isNthDayOfMonthInRangecross-year range validation that incorrectly rejected valid months - Fixed
inRangeandisNowInRangeto default to inclusive boundary semantics (more intuitive behavior)
🐛 List Extensions
- Fixed
equalsIgnoringOrderto correctly compare duplicate counts (previously[1,1,2]incorrectly equaled[1,2,2])
🐛 String Extensions
- Fixed
hexToIntcase-sensitive overflow check (lowercase7fffffffffffffffwas incorrectly flagged as overflow) - Fixed
toUpperLatinOnlyO(n²) string concatenation - now uses StringBuffer for O(n) performance - Fixed
upperCaseLettersOnlyO(n²) string concatenation - now uses StringBuffer for O(n) performance - Fixed
truncateWithEllipsisPreserveWordsto return truncated content when first word exceeds cutoff (instead of just ellipsis) - Fixed
containsIgnoreCaseto follow standard string semantics (empty string is contained in any string)
🐛 DateTime Utils
- Improved
convertDaysToYearsAndMonthsprecision using average days per year (365.25) and month (30.4375) to account for leap years - Added optional
includeRemainingDaysparameter for more detailed output
🧪 Testing
- Added 110 new test cases covering all algorithm fixes across respective test files
0.5.3+Christchurch #
🔄 Enhanced string_utils.dart to optimize final regex usages.
📚 Improved documentation and usage for CommonRandom and list generation.
0.5.2+Düsseldorf #
🧹 Rename StringFormattingAndWrappingExtensions to StringExtensions
0.5.1+Essen #
🧩 All string extension methods for formatting, manipulation, parsing, and validation were merged into a single file: lib/string/string_extensions.dart.
🔗 Imports across dependent files were updated to point to the unified extension file.
🗑️ Redundant string extension files and their old test files were removed.
🧪 A comprehensive test suite was added for string_extensions.dart, ensuring full coverage of the consolidated functionality.
0.5.0+Rotterdam #
➕ New extension methods were added for numbers, lists, and strings (like forceBetween, order‑agnostic list comparison, and safer string number parsing). 🧪 Fresh test files were created to cover the new extensions, and overall test coverage has been improved. 🔄 Some extension names were refactored for consistency across the codebase. 🧹 Test imports and structures were updated to align with the refactored code.
0.4.4+Utrech #
✂️ The big file for string code was split into smaller, more specific files. ➕ New code was added for things like unique lists and number ranges. 🧹 The existing code was cleaned up, making it safer and more efficient. 🔄 The tests and imports were updated to match the new file structure. ⚙️ The code analysis settings were improved to help keep things organized.
0.4.3+Bristol #
- ✂️ Removed VGV's spelling lists as they are not inherently wrong or needed
- 📦 Many more framework extensions added for primitives (num, string, etc. )
- 📚 Changed line length to 100 foresightmobile.com
- 📚 Added then Removed dependency to intl v0.20.2 intl -- too many conflicting dependencies
0.3.18+Kyoto #
0.3.13+Jakarta (Latest) #
- ✅ Added an unused flutter code detection script Dead Code Die Hard: A Practical Guide to Identifying Orphan Flutter Methods
- 🤝 Added a video library of TED talks to the Code of Conduct
- 🚀 Removed Codecov for being annoying
- 🤝 Keep H.O.N.E.S.T.I. the acronym with new wording on Work from Home and Impossible Problems to the Code of Conduct
- 🤝 Updated Code of Conduct with the Saropa logo, examples, a survey and an exercise
- 🤝 Include a link to the Code of Conduct into README.md
- 🧹 Rename
docoutput folder todocs
0.2.3+Pittsburgh #
- 🧹 Update this change log CHANGELOG.md
- 🔢 Add CommonRandom class as a drop-in replacement for math.Random() with a reliable random seed
- 🤝 Added Code of Conduct for the Saropa contributors
- 📜 Added development helper scripts - including doc generation and publishing
0.2.1+Adelaide #
- 🧹 Migrated
Listextensions toIterable
0.2.0+Melbourne #
- 🚀 New
EnumMethods: Introduced byNameTry and sortedEnumValues methods for enums to enhance searching and sorting capabilities. - 📈 Added of list extensions for common operations such as finding the smallest, biggest, most, and least occurrences in a list.
- 🧹 Bumped medium version due to addition of collections package and sdk bumps (sdk: ">=3.4.3 <4.0.0", flutter: ">=3.24.0")
0.1.0+Tuscany #
- 🧹 Bumped medium version due to deprecations and rename of "string_nullable_utils.dart" to "string_nullable_extensions.dart"
0.0.11+Rome #
-
🗑️ Removed deprecated functions in
StringNullableExtensions -
🐛 Fixed
StringExtensions.removeStartto return the input string when the search param is empty'Hello, World!'.removeStart(''); // 'Hello, World!' -
⚙️ Added constant
DateConstants.unixEpochDateDateConstants.unixEpochDate; // January 1st, 1970 -
✨ Added function
DateConstantExtensions.isUnixEpochDateDateTime.utc(1970).isUnixEpochDate; // true -
✨ Added function
DateConstantExtensions.isUnixEpochDateTimeDateTime.utc(1970, 1, 1, 0, 0, 1).isUnixEpochDateTime; // false -
✨ Added function
IntStringExtensions.ordinal101.ordinal(); // 101st -
✨ Added function
StringUtils.getNthLatinLetterLowerString? StringUtils.getNthLatinLetterLower(3) // "c" -
✨ Added function
StringUtils.getNthLatinLetterUpperString? StringUtils.getNthLatinLetterUpper(4) // "D" -
✨ Added function
IntUtils.findGreatestCommonDenominatorString? IntUtils.findGreatestCommonDenominator(15, 45) // 15 -
✨ Added function
IntExtensions.countDigits(-12345).countDigits() // 5
0.0.10+Paris #
- Change start to be nullable
String? removeStart(String? start)
0.0.9+Geneva #
- Review of meta data
- Add trimFirst param to
StringExtensions.removeStart({bool trimFirst = false,}){...}
0.0.8+Nepal #
- Review of meta data
- Add trimFirst param to
StringExtensions.nullIfEmpty({bool trimFirst = true,}){...}
0.0.7+Jamaica #
- Renamed strings folder to singular
- Deprecated nullable string extensions
0.0.6 #
- Added Swipe gesture properties
0.0.5 #
- Added Documentation for all methods
- Added Code Usage in Example App
- Added Code Usage in README.md
- Added String Extension Methods
0.0.4 #
- Added Example App
- Setup Github Actions
- Create Pull request template
- Create Issue template
- Create Contributing guide
0.0.3 #
- Random enum method
0.0.2 #
- String to bool conversion methods.
0.0.1 #
- Initial release with bool list methods.
Made by Saropa. All rights reserved.