Utils class
Utility class providing various helper methods.
Constructors
- Utils()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
calculateTimeBetweenTwoDate(
DateTime dateTimeFirst, DateTime dateTimeSecond) → String - Calculates the time difference between two dates and formats it as a string.
-
copyCurl(
CurlModel request, BuildContext context, {bool redactHeaders = true}) → void - Copies the generated cURL command to the clipboard and shows a snackbar.
-
getCurl(
CurlModel request, {bool redactHeaders = true}) → String - Generates a cURL command string from a CurlModel request.
-
getCurlInputBody(
dynamic data) → String - Encodes the input body data for a cURL command.
-
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
Static Properties
-
redactedHeaderPatterns
↔ List<
RegExp> -
Pattern per nomi header da redigere in output curl/share (case-insensitive sul nome).
getter/setter pair
Static Methods
-
bodyIsNonEmpty(
dynamic body) → bool - True se il body va incluso nel curl.
-
escapeForSingleQuotedShell(
String value) → String -
Escape stringa per embedding in singole quote POSIX:
'...'. -
escapeHeaderValueForDoubleQuotes(
String value) → String - Escape valore per uso dentro doppie virgolette in shell (-H "...").
-
estimateSize(
dynamic data) → int? - Stima dimensione payload (bytes UTF-8 approssimativi per stringhe).
-
redactedHeadersMap(
Map< String, dynamic> headers, {bool redact = true}) → Map<String, dynamic> - Applica redazione ai valori header (mappa nuova).