fifty_utils 0.1.1
fifty_utils: ^0.1.1 copied to clipboard
Pure Dart/Flutter utilities - DateTime, Duration, Color extensions, responsive breakpoints, and async state containers.
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.1.0 - 2025-12-31 #
Added #
-
DateTime Extensions
isToday,isYesterday,isTomorrow- Date comparison gettersisSameDay,isSameMonth,isSameYear- Date comparison methodsstartOfDay,endOfDay- Day boundary gettersdaysBetween- Calculate days between datesformat,formatTime,formatDateTime- Flexible date formattingtimeAgo- Human-readable relative time strings
-
Duration Extensions
format- Format as HH:mm:ssformatCompact- Format as compact string (e.g., "2h 5m")
-
Color Extensions
HexColor.fromHex- Parse hex string to ColortoHex- Convert Color to hex string
-
Responsive Utils
- Device type detection (
isMobile,isTablet,isDesktop,isWideDesktop) deviceType- Get device type as enumvalueByDevice- Return different values per device typescaledFontSize- Scale fonts by devicepadding,margin,gridColumns- Device-appropriate valuesscreenWidth,screenHeight- Screen dimension helpersisPortrait,isLandscape- Orientation helpers- Configurable breakpoints
- Device type detection (
-
State Containers
ApiStatus- Lifecycle status enum (idle, loading, success, error)ApiResponse<E>- Immutable request state containerapiFetch- Stream-based API fetch helperPaginationResponse<E>- Pagination envelope with total rows
Notes #
- Extracted from
fifty_archpackage for standalone use - Requires Flutter SDK >= 3.0.0 and Dart SDK >= 3.0.0
- Depends on
intlpackage for date formatting