magic library

Classes

ApiClient
ApiDataReceiver
Auth
Authenticatable
BaseApiServiceProvider
BaseAuthServiceProvider
BaseDataReceiver
BaseDataServiceProvider
BaseRouterServiceProvider
BaseRoutes
BaseValidator
DatePicker
EmailValidator
FormItem
FormList
Guard
Input
Lang
LangDelegate
Magic
MagicConfig
MaxValidator
MinValidator
Model
PasswordValidator
RequiredValidator
SelectBox<T>
ServiceProvider
StringValidator

Properties

authBearerTokenCacheKey String
final
authUserCacheKey String
The cache keys.
final

Functions

apiClient() ApiClient
Get the current api client instance.
auth() Auth
Get the active auth instance.
cache(String key) Future<String>
Get cache variable.
cacheDelete(String key) Future<void>
Delete cache variable.
cacheSet(String key, String value) Future<void>
Set cache variable.
config(String key) → dynamic
Get the specified configuration value.
dataReceiver() BaseDataReceiver
Get the base data receiver instance.
fetchItems(String resourceKey, { Map<String, dynamic> queries }) Future<List>
Fetch the data from the given resource key.
fetchModels<T>(FetchModelMapCallback mapCallback, { Map<String, dynamic> queries }) Future<List<T>>
Fetch the models by the given queries.
guard() Guard
Get the active auth guard.
hideLoader(BuildContext context) → void
Hide the loader.
make<T>() → T
Resolve the given type from the magic.
redirectTo(BuildContext context, String routeName) → void
Redirect to current page
replaceTo(BuildContext context, String routeName) → void
Pop all routes and replace
router() Router
Get instance of the router.
secureStorage() FlutterSecureStorage
Get instance of the secure storage.
showError(BuildContext context, String error) → void
Show error
showLoader(BuildContext context) → void
Let's start to show the loader
showSnackBar(BuildContext context, Widget title, { Widget content, List<Widget> actions }) → void
trans(BuildContext context, String key, { Map<String, String> replaces }) String
Translate the given key from the localization
validates(BuildContext context, Object value, String attribute, List<BaseValidator> validators) String
Let's validate!

Enums

InputType

Typedefs

FetchModelMapCallback(dynamic data) → dynamic
MagicConcreteCallback(Magic magic) Object
VoidCallback() → void

Exceptions / Errors

ApiException