Padding enum
Enum for controlling padding inside background colors
This enum provides predefined padding options for text within colored backgrounds, allowing for better visual spacing and readability.
Example usage:
logger.onRed('Message', padding: Padding.medium);
// Result: [ Message ] with spaces inside the background
logger.onGreen('Alert', padding: Padding.large);
// Result: [ Alert ] with more spaces inside
Values
- none → const Padding
-
No padding - text touches background edges Example:
Messageconst Padding(0) - small → const Padding
-
Small padding - 1 space on each side Example:
Messageconst Padding(1) - medium → const Padding
-
Medium padding - 2 spaces on each side Example:
Messageconst Padding(2) - large → const Padding
-
Large padding - 3 spaces on each side Example:
Messageconst Padding(3) - extraLarge → const Padding
-
Extra large padding - 4 spaces on each side Example:
Messageconst Padding(4) - huge → const Padding
-
Custom padding for special cases - 5 spaces on each side Example:
Messageconst Padding(5)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- leftPadding → String
-
Get the padding string (spaces before text)
no setter
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - rightPadding → String
-
Get the padding string (spaces after text)
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spaces → int
-
Number of spaces to add on each side of the text
final
Methods
-
apply(
String text) → String - Apply padding to text (both sides)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited