sm_widget library

Classes

APIConfig
默认配置, 在调用 APISession 之前, 必须先调用 APICore.initialize 才会生效
APICore
APIEnv
APIPageable
APIPageableSession<T>
APIResponder<T>
APISession<T>
BackgroundTextSpan
BackgroundTransformer
The default Transformer for Dio.
BaseOptions
The base config for the Dio instance, used by Dio.options.
BoolConverter
CancelToken
Controls cancellation of Dio's requests.
Dio
Dio enables you to make HTTP requests easily.
DioMixin
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
ExtendedEditableTextState
ExtendedTextLibraryUtils
ExtendedWidgetSpan
create by zmtzawqlp on 2019/7/10
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
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 Interceptors.
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.
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.
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
MCupertinoPopupSurface
MDialog
MElevatedButton
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
MIconButton
MicroEpochDateTimeConverter
MilliEpochDateTimeConverter
MImage
MImageProvider
MInputDecoration
MListTile
ModalMBottomSheetRoute<T>
MOutlinedButton
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
MText
MTextField
MTextSpan
MTextStyle
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
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
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.
SMWidgetAppTranslation
SpecialText
SpecialTextSpan
create by zmtzawqlp on 2019/4/30
SpecialTextSpanBuilder
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.
WidgetSpanSize

Enums

APIEnvType
DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FieldRename
Values for the automatic field renaming behavior for JsonSerializable.
HTTPMethod
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
MBoxShape
MButtonIconAlignment
MButtonMode
MExpandablePanelBodyAlignment
Determines vertical alignment of the body
MExpandablePanelHeaderAlignment
Determines the alignment of the header relative to the expand icon
MExpandablePanelIconPlacement
Determines the placement of the expand/collapse icon in MExpandablePanel
MExpandableTransition
MImageClipMode
MImageRenderMethodForWeb
MInputBorderStyle
ResponseType
Indicates which transformation should be applied to the response data.
TextOverflowAlign
TextOverflowClearType
https://github.com/fluttercandies/extended_text/issues/118 Clear the text under TextOverflowWidget default: Paint()..BlendMode.clear Canvas.clipRect BlendMode.clear will make BackdropFilter to be black background
TextOverflowPosition
The position which TextOverflowWidget should be shown https://github.com/flutter/flutter/issues/45336

Mixins

APIDioMixin<T, E extends APIResponder<T>>
APIOptions<T>
APIPageableMixin<T>
APISessionMixin<T, E extends APIResponder<T>>
OptionsMixin
The mixin class for options that provides common attributes.
SpecialInlineSpanBase
create by zmtzawqlp on 2019/7/10

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.

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.
FromJsonT<T> = T Function(dynamic json)
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
HTTPHeader = Parameters
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.
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)
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.
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.
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.

Exceptions / Errors

APIError
BadKeyException
A base class for exceptions thrown when decoding JSON.
CheckedFromJsonException
Exception thrown if there is a runtime exception in fromJson code generated when JsonSerializableGenerator.checked is true
DioException
DioException describes the exception info when a request failed.
DisallowedNullValueException
Exception thrown if there are keys with disallowed null values in a JSON map that was provided during deserialization.
MissingRequiredKeysException
Exception thrown if there are missing required keys in a JSON map that was provided during deserialization.
NotNullableError<T>
A TypeError thrown by _checkNotNullable.
UnrecognizedKeysException
Exception thrown if there are unrecognized keys in a JSON map that was provided during deserialization.