flint_dart library
Support for doing something awesome.
More dartdocs go here.
Classes
- AIMessage
- AIProvider
- Base AI provider — stores conversation history and context memory
- AntiSqlInjectionMiddleware
- Blocks requests that contain high-confidence SQL injection payloads.
- BinaryResponseSerializer
- BodySerializer
- Encodes request payloads into bytes.
- CacheConfig
- Configuration for response caching
-
CachedResponse<
T> - Cached response data
- CacheStore
- Cache storage abstraction
- CancelToken
- Token used to cancel in-flight requests.
- Column
- Describes a column in a database table.
- ConsoleColor
- Context
- Unified request context for HTTP and WebSocket routes.
- Controller
-
ControllerRouteBuilder<
T extends Controller> - Cookie
- CookieService
- ================= Cookie Service =================
- CookieSessionMiddleware
- ================= Middleware Example =================
- CorsMiddleware
- DB
- Database manager for Flint Dart
- DBTransaction
- Default
- ExceptionMiddleware
- FileRange
- Flint
- The core application class for the Flint Dart framework.
- FlintClient
- A powerful HTTP client for making requests to REST APIs with support for JSON, file uploads/downloads, progress tracking, caching, and retries.
- FlintEnv
- A lightweight environment variable loader for Dart applications.
- FlintJwt
- FlintPageMeta
-
FlintResponse<
T> - Represents a response from the Flint client.
- FlintWebSocket
- Represents a connected WebSocket client
- FlintWebSocketClient
- ForeignKey
- FormUrlEncodedBodySerializer
- GeminiChatCandidate
- GeminiChatContent
- GeminiChatPart
- GeminiChatResponse
- GeminiProvider
- GeminiResponse
- GeminiUsage
- Hashing
- HuggingFaceProvider
- HuggingFaceResponse
- Index
- Represents an index on one or more columns in a table.
-
IsolateTask<
T> - Base class for tasks running in isolates
- IsolateTaskQueue
- Manager to schedule multiple isolate tasks
- JsonBodySerializer
- JsonResponseSerializer
- Log
- LoggerMiddleware
- MailAttachment
- Email attachment
- MailConfig
- MemoryCacheStore
- In-memory cache implementation
- Middleware
-
Model<
T extends Model< T> > - MySQLDialect
- ---------------- MySQL ----------------
- OpenAIProvider
- OpenAIResponse
- PostgresDialect
- ---------------- Postgres ----------------
- QueryBuilder
- A simple SQL query builder for MySQL/PostgreSQL in Flint Dart.
- RelationConfig
-
RelationDefinition<
T extends Model< T> > - Relations
- Clean, static helper methods for defining relations
- Request
- Enhanced HTTP request wrapper with comprehensive parsing, validation, and session management.
- RequestContext
- Mutable request-scoped state passed across client components.
- RequestLifecycleHooks
-
RequestOptions<
T> - Response
- A wrapper around HttpResponse for sending HTTP responses in Flint Dart.
- ResponseSerializer
- ResponseSerializerInput
- ResponseSerializerResult
- RetryConfig
- Route
- RouteGroup
- A base class for grouping and organizing HTTP routes in Flint.
- Router
- Seeder
- Base contract for framework-level database seeders.
- SeederRunner
- Runs a list of seeders sequentially and closes the database connection.
- SerializedBody
- Serialized request payload with optional content type.
- SessionManager
- SessionService
- A service to manage session data key-by-key.
- SQLDialect
- Base dialect interface
- StaticFileMiddleware
- StatusCodeConfig
- Configurable status code mapping that frontend devs can customize
- Table
- Represents a database table schema, including its columns, indexes, and foreign keys.
- TextResponseSerializer
- UploadedFile
- Validator
- A utility class for validating input data against a set of rules.
- ViewMailable
- Represents an email built from an HTML view template (.flint.html)
- WebSocketManager
- XmlBodySerializer
Enums
- ColumnType
- Enum representing supported column types for a table schema. Enum representing supported column types for a table schema.
- DBDriver
- Supported database drivers
- FlintErrorKind
- Structured classification for FlintError.
- FlintResponseType
- Enum representing the type of response returned by the Flint client.
- ForeignKeyAction
- HashingAlgorithm
- LogLevel
- MailPriority
- Email priority levels
- RelationType
- RespondType
- Supported response types for automatic content handling.
- ResponseParseMode
- SameSite
- WebSocketConnectionState
Extensions
- ColumnSQL on Column
- ---------------- Column helpers ----------------
- ControllerRouteExtension on Object
- Convenience extension (typically used inside RouteGroup classes) to reduce controllerAction boilerplate without requiring a mixin.
-
FirstWhereOrNullExtension
on Iterable<
T> - FlintClientFileSaver on FlintClient
-
FutureModelListExtension
on Future<
List< T> > -
ModelCrud
on Model<
T> -
ModelListExtension
on List<
T> -
ModelQuery
on Model<
T> -
ModelRelations
on Model<
T> - Relation methods for Model
- OAuthResponse on Response
- ResponseSendStreamed on Response
- TableSQL on Table
- ---------------- Dispatcher ----------------
Properties
-
relationLoaders
→ Map<
String, dynamic> -
final
Functions
-
adaptHttp(
LegacyHandler legacy) → Handler - Adapter for legacy HTTP handlers.
-
adaptWebSocket(
WsHandler legacy) → Handler - Adapter for legacy WebSocket handlers.
-
controller<
T extends Controller> (ControllerFactory< T> factory, ControllerCallback<T> callback) → Handler - Short alias for controllerAction.
-
controllerAction<
T extends Controller> (ControllerFactory< T> factory, ControllerCallback<T> callback) → Handler - Creates a route handler that instantiates, binds, and disposes a controller per request. This keeps controller context request-scoped for HTTP and WS.
-
controllerVoid<
T extends Controller> (ControllerFactory< T> factory, void action(T controller)) → Handler - Short alias for controller actions that do not return a value.
-
env(
String key, [dynamic defaultValue]) → dynamic - Top-level helper for reading env values with optional type coercion.
-
getTableSchema(
String tableName) → Future< Table?> - Helper function to get table schema
-
loadRelations(
List< Model< parents, List<Model> >String> relations, String modelClassName, Map<String, RelationConfig> ? relationConfigs) → Future<void> - Load relations for a list of parent models
-
looksLikeDateTime(
String value) → bool -
parseInt(
dynamic value) → int? -
parseMySQLType(
dynamic rawType) → String -
runSeeders(
List< Seeder> seeders, {bool closeConnection = true}) → Future<void> - Convenience helper for running framework seeders.
-
runTableRegistry(
List< Table> tables, [dynamic _, SendPort? sendPort]) → void - Runs the table registry process inside a Dart isolate.
Typedefs
-
AuthTokenProvider
= FutureOr<
String?> Function() -
ContextualRequestInterceptor
= Future<
void> Function(HttpClientRequest request, RequestContext context) -
ContextualResponseInterceptor
= Future<
void> Function(HttpClientResponse response, RequestContext context) -
ControllerCallback<
T extends Controller> = FutureOr< Object?> Function(T controller) -
ControllerFactory<
T extends Controller> = T Function() - ErrorHandler = void Function(FlintError error)
- Callback type for handling errors returned by FlintClient.
- ForbiddenErorr = ForbiddenException
-
Handler
= FutureOr<
Object?> Function(Context ctx) - Unified handler signature for HTTP + WebSocket routes.
- HookErrorHandler = void Function(String hookName, Object error, StackTrace stackTrace, RequestContext context)
- JsonFn = JsonMap Function()
-
JsonMap
= Map<
String, dynamic> -
JsonParser<
T> = T Function(dynamic json) -
Parses JSON responses into a strongly-typed object
T. -
LegacyHandler
= FutureOr<
Response?> Function(Request req, Response res) - A legacy HTTP handler signature.
- MapFn = JsonMap Function()
-
OnCacheHit
= FutureOr<
void> Function(RequestContext context, String cacheKey, CachedResponse cachedResponse) -
OnRequestEnd
= FutureOr<
void> Function(RequestContext context, FlintResponse? response, FlintError? error) -
OnRequestError
= FutureOr<
void> Function(RequestContext context, FlintError error, bool willRetry) -
OnRequestStart
= FutureOr<
void> Function(RequestContext context) -
OnRetry
= FutureOr<
void> Function(RequestContext context, FlintError error, Duration delay) - ProgressCallback = void Function(int sent, int total)
-
Callback type to track upload or download progress.
sentis the number of bytes sent or received.totalis the total number of bytes. -
RequestDoneCallback<
T> = void Function(FlintResponse< T> response, FlintError? error) -
RequestInterceptor
= Future<
void> Function(HttpClientRequest request) - Intercepts HTTP requests before they are sent.
-
ResponseInterceptor
= Future<
void> Function(HttpClientResponse response) - Intercepts HTTP responses after they are received.
- RetryEvaluator = bool Function(FlintError error, int attempt)
- Configuration for request retries
- Socket = FlintWebSocket
- WsHandler = void Function(Request req, FlintWebSocket socket)
- Legacy WebSocket handler signature.
Exceptions / Errors
- AuthException
- BaseException
- ControllerContextException
- FlintError
- Represents an error returned by the Flint client.
- ForbiddenException
- HttpException
- MailValidationError
- Mail validation error
- NotFoundException
- ValidationError
- ValidationException
- An exception that is thrown when validation fails.