extensions/utilities/ds_shelf_utilities_export library
Classes
- DsShelfBaseUtils
- Base utility class for shared behavior (if needed). You can remove if not used directly.
Functions
-
dsShelfApiKeyMiddleware(
String expectedKey) → Middleware - Simple API key check middleware.
-
dsShelfCapitalize(
String input) → String - Capitalize the first letter of a string.
-
dsShelfCustomTagMiddleware(
) → Middleware - Example custom middleware: tags each request with foo=bar.
-
dsShelfErrorResponse(
String message, {int statusCode = 400}) → Response - Wrap an error message in a JSON response.
-
dsShelfExtractBearerToken(
Request request) → String? - Extract Bearer token from Authorization header.
-
dsShelfJoinPaths(
String base, String segment) → String - Safely join two URL or file path segments.
-
dsShelfJsonResponse(
Object data, {int statusCode = 200}) → Response - Wrap data in a JSON response.
-
dsShelfParseJson(
String jsonStr) → Map< String, dynamic> - Parse a JSON string into a Map.
-
dsShelfParseQueryParams(
Request request) → Map< String, String> - Extract query parameters from a request.
-
dsShelfSaveUploadedFile(
Request request, String targetPath) → Future< File> -
Save request body to a file at
targetPath
. -
dsShelfToJson(
Object data) → String - Convert an object to its JSON string representation.