corextra 1.0.4
corextra: ^1.0.4 copied to clipboard
Handy Dart extensions and utility functions for easier coding.
corextra #
A lightweight Dart package offering handy extensions and utility functions
for common types like String, int, double, List, and more.
Make your Dart and Flutter code cleaner, safer, and easier to read.
Features #
- Extensions on core types for safer parsing and formatting
- Null-safe and concise checks like
.isNullOrEmptyonString?andList? - Convenient conversion helpers:
.toTryInt(),.toTryDouble(),.toTryBool() - String utilities like
.capitalize() - Numeric helpers to sanitize negative values
- Helper functions like
isStringEmpty()andisListEmpty()for legacy or functional use - DateTime extensions for easy parsing from string to
DateTimeand formatting fromDateTimeto string with customizable formats - ResponsiveBreakpoints: simple and customizable screen size helpers (
xs,sm,md,lg,xl) for responsive layouts in Flutter - Custom Exception System for structured error handling across your app:
CorextraException(base class)CorextraCustomExceptionfor generic app-level errorsCorextraNetworkExceptionfor network-related errors (e.g., Dio, HTTP requests)
- DioErrorHandler for convenient network error handling:
- Maps Dio errors to user-friendly messages
- Throws typed exceptions (
CorextraNetworkException) - Ready for future network-related utility functions
Getting Started #
Add this package to your Dart or Flutter project by adding this line to your pubspec.yaml:
dependencies:
corextra: ^1.0.4
Then import it in your Dart code:
import 'package:corextra/corextra.dart';