sm_core
library
Classes
AdvancedFileOutput
Accumulates logs in a buffer to reduce frequent disk, writes while optionally
switching to a new log file if it reaches a certain size.
AnsiColor
This class handles colorizing of terminal output.
API <T >
APIConfig
默认配置, 在调用 APISession 之前, 必须先调用 APICore.initialize 才会生效
APICore
APIEnv
APIPaging
APIPagingConfig
APIPagingSession <T >
APIResponder <T >
APISession <T >
APIXSession <T >
BackgroundTextSpan
BackgroundTransformer
The default Transformer for Dio .
BaseOptions
The base config for the Dio instance, used by Dio.options .
BoolConverter
BrowserConfiguration
Additional configuration options for LaunchMode.inAppBrowserView
CancelToken
Controls cancellation of Dio 's requests.
ConsoleOutput
Default implementation of LogOutput .
CustomAnimation
DevelopmentFilter
Prints all logs with level >= Logger.level
while in development mode (eg
when assert
s are evaluated, Flutter calls this debug mode).
Dio
Dio enables you to make HTTP requests easily.
DioMixin
EasyLoading
EasyLoadingAnimation
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
ExtendedEditableTextState
ExtendedTextLibraryUtils
ExtendedWidgetSpan
create by zmtzawqlp on 2019/7/10
FileOutput
FlutterEasyLoading
FontSizeResolvers
FormData
A class to create readable "multipart/form-data" streams.
It can be used to submit forms and file uploads to http server.
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter
is a bridge between Dio and HttpClient .
HybridPrinter
A decorator for a LogPrinter that allows for the composition of
different printers to handle different log messages. Provide it's
constructor with a base printer, but include named parameters for
any levels that have a different printer:
ImageSpan
Interceptor
Interceptor helps to deal with RequestOptions , Response ,
and DioException during the lifecycle of a request
before it reaches users.
Interceptors
A Queue-Model list for Interceptor s.
InterceptorsWrapper
A helper class to create interceptors in ease.
JsonConverter <T , S >
Implement this class to provide custom converters for a specific Type .
JsonEnum
Allows configuration of how enum
elements are treated as JSON.
JsonKey
An annotation used to specify how a field is serialized.
JsonLiteral
An annotation used to generate a private field containing the contents of a
JSON file.
JsonSerializable
An annotation used to specify a class to generate code for.
JsonValue
An annotation used to specify how a enum value is serialized.
ListParam <T >
Indicates a param being used as queries or form data,
and how does it gets formatted.
LoadingAnimationWidget
LogEvent
LogFilter
An abstract filter of log messages.
LogfmtPrinter
Outputs a logfmt message:
Logger
Use instances of logger to send log messages to the LogPrinter .
LogInterceptor
LogInterceptor is used to print logs during network requests.
It should be the last interceptor added,
otherwise modifications by following interceptors will not be logged.
This is because the execution of interceptors is in the order of addition.
LogOutput
Log output receives a OutputEvent from LogPrinter and sends it to the
desired destination.
LogPrinter
An abstract handler of log events.
MAlertDialog
MAppBar
MBottomSheet
MButton
MButtonStyle
maximumSize 最大尺寸
!: 注意 如果设置了 maximumSize 不设置 minimumSize , 并且 maximumSize 小于 minimumSize , 则会导致约束冲突.
!: BoxConstraints has both width and height constraints non-normalized.
MCircleAvatar
MContainer
MCupertinoActionSheet
MCupertinoActionSheetAction
MCupertinoAlertDialog
MCupertinoDialogAction
MCustomStatus <T >
MDateFormat
MDialog
MDioLogger
MElevatedButton
MemoryOutput
Buffers OutputEvent s.
MEmptyStatus <T >
MErrorStatus <T , S >
MExpandable
Shows either the expanded or the collapsed child depending on the state.
The state is determined by an instance of MExpandableController provided by ScopedModel
MExpandableButton
Toggles the state of MExpandableController when the user clicks on it.
MExpandableController
Controls the state (expanded or collapsed) of one or more Expandable
.
The controller should be provided to Expandable
via MExpandableNotifier .
MExpandableIcon
An down/up arrow icon that toggles the state of MExpandableController when the user clicks on it.
The model is accessed via ScopedModelDescendant
.
MExpandableNotifier
Makes an MExpandableController available to the widget subtree.
Useful for making multiple Expandable
widgets synchronized with a single controller.
MExpandablePanel
A configurable widget for showing user-expandable content with an optional expand button.
MExpandableTheme
MExpandableThemeData
MFilledButton
MGetStatus <T >
MIconButton
MicroEpochDateTimeConverter
MilliEpochDateTimeConverter
MImage
MImageProvider
MInputDecoration
MListTile
MLoadingStatus <T >
MLogFilter
MLogger
ModalMBottomSheetRoute <T >
MOutlinedButton
MPrettyPrinter
MRichText
MScaffold
MScrollOnExpand
Ensures that the child is visible on the screen by scrolling the outer viewport
when the outer MExpandableNotifier delivers a change event.
MSelectableText
MStrutStyle
MSuccessStatus <T >
MText
MTextField
MTextSpan
MTextStyle
MToast
MToastConfig
MultiOutput
Logs simultaneously to multiple LogOutput outputs.
MultipartFile
A file to be uploaded as part of a MultipartRequest
. This doesn't need to
correspond to a physical file.
Options
Every request can pass an Options object which will be merged with Dio.options
OutputEvent
PrefixPrinter
A decorator for a LogPrinter that allows for the prepending of every
line in the log output with a string for the level of that log. For
example:
PrettyPrinter
Default implementation of LogPrinter .
ProductionFilter
Prints all logs with level >= Logger.level
even in production.
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
RebuildFactors
REdgeInsets
REdgeInsetsDirectional
RedirectRecord
A record that records the redirection happens during requests,
including status code, request method, and the location.
RegExpSpecialText
RegExpSpecialTextSpanBuilder
RequestInterceptorHandler
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after
BaseOptions and Options are composed.
Response <T >
The Response class contains the payload (could be transformed)
that respond from the request, and other information of the response.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
RPadding
RSizedBox
ScreenUtil
ScreenUtilInit
SimplePrinter
Outputs simple log messages:
SMGetAppTranslation
SMModelAppTranslation
SMWidgetAppTranslation
SpecialText
SpecialTextSpan
create by zmtzawqlp on 2019/4/30
SpecialTextSpanBuilder
StreamOutput
StringDateTimeConverter
SyncTransformer
If you want to custom the transformation of request/response data,
you can provide a Transformer by your self, and replace
the transformer by setting the Dio.transformer .
TextInputBinding
void main() {
TextInputBinding();
runApp(const MyApp());
}
TextInputFocusNode
The FocusNode to be used in TextInputBindingMixin
TextOverflowWidget
TextPainterHelper
Transformer
Transformer allows changes to the request/response data before
it is sent/received to/from the server.
WebViewConfiguration
Additional configuration options for LaunchMode.inAppWebView .
WidgetSpanSize
Functions
$checkedConvert <T > (Map map , String key , T castFunc (dynamic ), {Object ? readValue (Map , String )? })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked
is true
.
$checkedCreate <T > (String className , Map map , T constructor (S <S >(String , S (Object ? ), {Object ? readValue (Map , String )? }) ), {Map <String , String > fieldKeyMap = const {} })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked
is true
.
$checkedNew <T > (String className , Map map , T constructor (), {Map <String , String > ? fieldKeyMap })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked
is true
.
$checkKeys (Map map , {List <String > ? allowedKeys , List <String > ? requiredKeys , List <String > ? disallowNullValues })
→ void
Helper function used in generated fromJson
code when
JsonSerializable.disallowUnrecognizedKeys
is true for an annotated type or
JsonKey.required
is true
for any annotated fields.
$enumDecode <K extends Enum , V > (Map <K , V > enumValues , Object ? source , {K? unknownValue })
→ K
Returns the key associated with value source
from enumValues
, if one
exists.
$enumDecodeNullable <K extends Enum , V > (Map <K , V > enumValues , Object ? source , {Enum ? unknownValue })
→ K?
Returns the key associated with value source
from enumValues
, if one
exists.
canLaunch (String urlString )
→ Future <bool >
Checks whether the specified URL can be handled by some app installed on the
device.
canLaunchUrl (Uri url )
→ Future <bool >
Checks whether the specified URL can be handled by some app installed on the
device.
closeInAppWebView ()
→ Future <void >
Closes the current in-app web view, if one was previously opened by
launchUrl .
closeWebView ()
→ Future <void >
Closes the current WebView, if one was previously opened via a call to launch .
launch (String urlString , {bool ? forceSafariVC , bool forceWebView = false , bool enableJavaScript = false , bool enableDomStorage = false , bool universalLinksOnly = false , Brightness ? statusBarBrightness , String ? webOnlyWindowName })
→ Future <bool >
Parses the specified URL string and delegates handling of it to the
underlying platform.
launchUrl (Uri url , {LaunchMode mode = LaunchMode.platformDefault , WebViewConfiguration webViewConfiguration = const WebViewConfiguration() , BrowserConfiguration browserConfiguration = const BrowserConfiguration() , String ? webOnlyWindowName })
→ Future <bool >
Passes url
to the underlying platform for handling.
supportsCloseForLaunchMode (LaunchMode mode )
→ Future <bool >
Returns true if closeInAppWebView is supported for mode
in the current
platform implementation.
supportsLaunchMode (LaunchMode mode )
→ Future <bool >
Returns true if mode
is supported by the current platform implementation.
Typedefs
DefaultTransformer
= SyncTransformer
DioError
= DioException
DioError describes the exception info when a request failed.
DioErrorType
= DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
EasyLoadingStatusCallback
= void Function(EasyLoadingStatus status )
FontSizeResolver
= double Function(num fontSize , ScreenUtil instance )
FromJsonT <T >
= T Function(dynamic json )
The signature that iterates header fields.
InterceptorErrorCallback
= void Function(DioException error , ErrorInterceptorHandler handler )
The signature of Interceptor.onError .
InterceptorSendCallback
= void Function(RequestOptions options , RequestInterceptorHandler handler )
The signature of Interceptor.onRequest .
InterceptorSuccessCallback
= void Function(Response response , ResponseInterceptorHandler handler )
The signature of Interceptor.onResponse .
JsonDecodeCallback
= FutureOr Function(String )
The callback definition for decoding a JSON string.
JsonEncodeCallback
= FutureOr <String > Function(Object )
The callback definition for encoding a JSON object.
LogCallback
= void Function(LogEvent event )
MErrorCallback <T >
= void Function(T error )
MErrorListener
= void Function(Object exception , StackTrace ? stackTrace )
MErrorWidget
= Widget Function(BuildContext context , String url , Object error )
MExpandableBuilder
= Widget Function(BuildContext context , Widget collapsed , Widget expanded )
MImageErrorProviderBuilder
= ImageProvider <Object > Function(BuildContext context , Object error , StackTrace ? stackTrace )
MValueChanged <T >
= void Function(T value )
MVoidCallback
= void Function()
OutputCallback
= void Function(OutputEvent event )
PaintBackground
= bool Function(BackgroundTextSpan backgroundTextSpan , Canvas canvas , Offset offset , TextPainter ? painter , Rect rect , {Offset ? endOffset , TextPainter ? wholeTextPainter })
if you don't want use default, please return true.
endOffset is the text top-right Offfset
allTextPainter is the text painter of extended text.
painter is current background text painter
Parameters
= Map <String , dynamic >
ParseJsonT <T >
= T Function(Parameters json )
ProgressCallback
= void Function(int count , int total )
The type of a progress listening callback when sending or receiving data.
RebuildFactor
= bool Function(MediaQueryData old , MediaQueryData data )
RequestEncoder
= FutureOr <List <int > > Function(String request , RequestOptions options )
The type of a request encoding callback.
ResponseDecoder
= FutureOr <String ? > Function(List <int > responseBytes , RequestOptions options , ResponseBody responseBody )
The type of a response decoding callback.
ScreenUtilInitBuilder
= Widget Function(BuildContext context , Widget ? child )
SpecialTextGestureTapCallback
= void Function(dynamic parameter )
create by zmtzawqlp on 2019/6/5
ToJsonT <T >
= Parameters ? Function(T? value )
ValidateStatus
= bool Function(int ? status )
The type of a response status code validate callback.