mayr_extensions 0.3.1
mayr_extensions: ^0.3.1 copied to clipboard
A comprehensive set of handy Dart and Flutter extensions to make your code cleaner, shorter, and more expressive.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.3.1] #
- Automated deployments
[0.3.0] - 30th April, 2025 #
Added #
context.platformInLightMode
dateTime.startOfDay()
MayrDateTimeFormats
: A collection of popular datetime formats- Slightly more tests and dartdocs
Changed #
dateTime.toFormat(...)
->dateTime.format(...)
dateTime.isYesterday()
,dateTime.isToday()
, anddateTime.isTomorrow()
are now getter properties:dateTime.isYesterday
dateTime.isToday
dateTime.isTomorrow
dateTime.isInPast()
anddateTime.isInFuture()
are also now getter properties:dateTime.isInPast
dateTime.isInFuture
Removed #
dateTime.toDateString(...)
dateTime.toDateStringUK(...)
dateTime.toDateStringUS(...)
dateTime.toDateTimeString(...)
dateTime.isExpired()
[0.2.0] - [29-04-2025] #
Added #
T?.orDefault(T fallback)
AddedString.copyToClipboard()
AddedString.toUri()
Added- More dartdocs to properties and methods
Changed #
String.toDateTime()
now uses tryParse, so null is returned if parse fails and error is not thrown- Added namespaces to extensions to prevent clash with user extensions
[0.1.1] - Minor cleanups #
Changed #
- Removed certain files that are not required to use package from pub
[0.1.0] - Rebrand to mayr_* #
Changed #
- Package name was rebranded from
flutter_util_extensions
tomayr_extensions
[0.0.1] - Initial Release #
Added #
- BuildContext extensions:
- Access to form, navigator, overlay, scaffold, media query, brightness, platform checks, and widget size.
- Device type checks (phone, tablet, desktop).
- Added
showSnackBar()
utility method.
- DateTime extensions:
- Checkers for time of day, expiry, and comparisons.
- Manipulators to add/subtract dates, months, years, etc.
- Conversions to various string formats and age calculation.
- Duration extension:
delay()
method for simple async delays.
- Dynamic extensions:
nullOnDebug()
,onlyOnDebug()
, andmaybe()
based on probability.
- Image extension:
- Easily create a
CircleAvatar
widget with an image.
- Easily create a
- Number extensions:
- Comparison helpers, random number generators, number formatters, and conversions to Duration.
- String extensions:
- Pattern matching, parsing to different cases (camelCase, snakeCase, etc.), and pretty printing (JSON, YAML, XML).
- Pattern checkers for emails, URLs, IP addresses, and more.
- Widget extensions:
- Helpers for padding, sizing, positioning, clipping, visibility, and touch management via
InkWellManager
.
- Helpers for padding, sizing, positioning, clipping, visibility, and touch management via
Notes #
- First public release.
- Still evolving — contributions and feedback welcome!