dartshine library

Classes

BooleanField
Field for boolean value
BooleanOrmField
Boolean Type
CharOrmField
Char with maximul length Type
ChoiceField
Field for single choice
Cookie is a class used by Dartshine for managing cookies. To use it, you should call the constructor in the Response.setCookie method.
DartshineController
DartshineController is the main class for managing all methods in a route. To use the DartshineController, you should create a class that extends DartshineController. For each method, you should have an HttpRequest parameter and return a Response.
DartshineCors
DartshineCors is a middleware provided by Dartshine. It manages CORS for you. You should place the middleware at the end of the middleware array that you defined, as mentioned here: DartshineMiddleware.
DartshineCsrf
DartshineCsrf is a middleware provided by Dartshine. It manages CSRF for you. You should place the middleware at the end of the middleware array that you defined, as mentioned here: DartshineMiddleware. You should create a secret key.
DartshineForms
DartshineForms is used for managing forms with fields, you can create fields in fields variable. This class provides a validate method with isValid(HttpRequest request) where request is the request you received in your controller.
DartshineMiddleware
DartshineMiddleware is a class used for managing middleware. You should extend it with a new class.
DartshineOrm
DartshineRoute
DartshineRoute is a class for managing routes, you should create a class and extend to it. You can add some URLs and include error handling to each status.
DateOrmField
DATE Type
DateTimeOrmField
TIMESTAMP Type
Delete
Field
FileField
Field for file data type
FloatField
Field for floating-point data type
FloatOrmField
Float Type
ForeignKeyOrmField
Foreign Key Type
Get
HttpRequest
Used to describe the HTTP request
Insert
IntegerField
Field for integer data type
IntegerOrmField
Integer Type
MailField
MultipleChoicesField
Field for multiple choices
NumberField
Field for both integer and floating-point data types
Orm
OrmField
PasswordField
Response
Response is a class for creating HTTP responses, the class has 5 methods for each type of response, for HTML, JSON, text, status only and redirection.
RouteUrl
RouteUrl is used to specify the URL with the URI path, controller, and supported methods.
Server
Template
Template is a class that uses the Dartshine template engine. You should provide an HTML file path.
TextField
TextOrmField
Text Type
Update
Validator
Validator is used to validate a field.

Enums

DbType
Database type
ForeignKeyOnDelete
What if the parent table is deleted
Method
HTTP methods
OrmTypes
Used for ORM field data type
Status
HTTP status

Functions

compress(HttpRequest request, MiddlewareNextFunction next) Future<Response>
compress is a middleware provided by Dartshine. You should place the middleware first in the middleware array that you defined, as mentioned here: DartshineMiddleware.

Typedefs

CustomValidateFunction = String? Function(String value)
ErrorHandler = Response Function(HttpRequest request)
Function for error handling
MiddlewareNextFunction = Future<Response> Function(HttpRequest request)
The middleware next function
ResponseFunction = Future<Response> Function(HttpRequest request, MiddlewareNextFunction next)
The function type that we need