extensions library
Classes
Extensions
- AlertExtension on BuildContext
- BuildContextExtensions on BuildContext
- ColorExtensions on Color
- DateTimeExtensions on DateTime
- Extension for DateTime with BuildContext support
- DoubleExtensions on double
- DurationExtensions on Duration
- EdgeInsetsExtensions on EdgeInsets
-
EdgeInsets has no
copyWithin Flutter, so we add one. - FileExtensions on File
- IconExtensions on Icon
- ImageExtensions on Image
- IntExtensions on int
-
IterableExtensions
on Iterable<
T> -
IterableNestedExtensions
on Iterable<
Iterable< T> > -
ListExtensions
on List<
T> -
MapExtensions
on Map<
K, V> - NullableObjectExtensions on Object?
- NullableStringExtensions on String?
-
String helpers that can also be used on
nullstrings. - NumExtension on num
-
NumIterableExtensions
on Iterable<
num> - ObjectExtensions on T
- Object helpers (Kotlin-style scope functions).
- PlatformExt on BuildContext
- Platform extensions
-
RecordIterableExtensions
on Iterable<
(R, S)> - SnackBarExtension on BuildContext
-
StateExtensions
on State<
T> - StringExtensions on String
- TextStyleExtensions on TextStyle
- Extensions for TextStyle to simplify and enhance text styling.
- ThemeModeExt on BuildContext
- WidgetExtension on Widget
Functions
-
colorFromHex(
String hex) → Color -
Parses
#RGB,#RRGGBB,#AARRGGBB(with or without#) into a Color. Throws a FormatException for invalid input. -
emailValidator(
String? value, {String message = 'Enter a valid email'}) → String? - Field must be a valid email (blank passes).
-
maxLengthValidator(
String? value, int maxLength, {String? message}) → String? -
Field must be at most
maxLengthcharacters (blank passes). -
minLengthValidator(
String? value, int minLength, {String? message}) → String? -
Field must be at least
minLengthcharacters (blank passes). -
phoneValidator(
String? value, {String message = 'Enter a valid phone number'}) → String? - Field must be a valid phone number (blank passes).
-
requiredField(
String? value, {String message = 'This field is required'}) → String? - Field must not be null/blank.
Typedefs
- FormValidator = String? Function(String?)
-
Validator helpers returning an error String or
nullwhen valid. Use directly asvalidator:forTextFormField/FormField.