saropa_dart_utils 0.5.9
saropa_dart_utils: ^0.5.9 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://dev.tools@saropa.com
0.5.9+Barcelona (Latest) #
API Improvements #
β¨ JsonUtils
isJson: AddedallowEmptyparameter (defaultfalse) to optionally treat{}as valid JSON while maintaining backwards compatibility
π Fixes
MakeListExtensions: Changed extension fromTtoT?to properly support nullable typesgetUtcTimeFromLocal: Fixed documentation (was incorrectly stating "returns null if offset is 0" when it returns the original instance)getNthWeekdayOfMonthInYear: Removed stalemonthandyearparameter references from documentation
π§Ή Cleanup
UniqueListExtensionsUniqueBy: Removed unusedpropertyComparergeneric parameterbetweenResult: Added documentation clarifying thelastIndexOfbehavior for nested delimiters
π§ͺ Tests
- Added 16 test cases for
JsonUtils.isJsonincludingallowEmptyparameter coverage - Total test count: 2907 tests (all passing)
0.5.8+Madrid #
Script Improvements #
π§ Publish Script
publish_pub_dev.ps1: Added idempotent handling for git tags (skips if tag already exists locally or on remote)publish_pub_dev.ps1: Added idempotent handling for GitHub releases (skips if release already exists)- Prevents script failures when re-running after partial completion
0.5.7+Lisbon #
String Fixes & Improvements #
π Fixes
extractCurlyBraces: switched to non-greedy matching to correctly extract multiple adjacent groups in order.removeSingleCharacterWords: made Unicode-aware to properly remove standalone single-letter words beyond ASCII.replaceLineBreaks: improved deduplication to collapse any run of replacements (robust for arbitrary replacement strings).grammarArticle: enhanced heuristics for silent 'h' (e.g., "hour"), "you"-sound words ("user", "university"), andone-prefixes.possess: trims input before applying trailing 's' rules (US vs. non-US style maintained).
βοΈ Performance/Behavior
repeat: optimized concatenation withStringBufferfor better performance.lettersOnly/lowerCaseLettersOnly: simplified to efficient regex-based ASCII filters.- Doc updates: clarified
countcounts non-overlapping matches (noting potentialallowOverlap), andobscureTextoutput length may vary due to jitter.
π§ͺ Tests
- Added tests for newline replacement dedupe with special replacement strings, Unicode single-letter removal, non-greedy curly brace extraction order, improved
grammarArticleheuristics, and trimmedpossessbehavior.
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.