mini_tools library

Classes

BaseOptions
The common config for the Dio instance. dio.options is a instance of BaseOptions
CancelToken
You can cancel a request by using a cancel token. One token can be shared with different requests. when a token's cancel method invoked, all requests with this token will be cancelled.
ColorUtil
DataFormats
一些常用格式参照。可以自定义格式,例如:"yyyy/MM/dd HH:mm:ss","yyyy/M/d HH:mm:ss"。 格式要求 year -> yyyy/yy month -> MM/M day -> dd/d hour -> HH/H minute -> mm/m second -> ss/s
DateUtil
Date Util.
Decimal
DefaultTransformer
Dio
A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, File downloading etc. and Dio is very easy to use. [...]
DioMixin
DioUtil
EnInfo
EnNormalInfo
FileUtil
文件操作类
FlutterImageCompress
Image Compress [...]
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient. [...]
Interceptor
Dio instance may have interceptor(s) by which you can intercept requests or responses before they are handled by then or catchError.
Interceptors
InterceptorsWrapper
L
Lock
Add lock/unlock API for interceptors.
LogInterceptor
LogInterceptor is used to print logs during network requests. It's better to add LogInterceptor to the tail of the interceptor queue, otherwise the changes made in the interceptor behind A will not be printed out. This is because the execution of interceptors is in the order of addition.
MiniLoggerConfig
日志配置
MiniLoggerLevelEnum
  • V : 黑色,Verbose就是冗长啰嗦的。通常表达开发调试过程中的一些详细信息。
  • D : 蓝色,Debug来表达调试信息。
  • I : 绿色,Info来表达一些信息。
  • W : 橙色,Warn表示警告,但不一定会马上出现错误,开发时有时用来表示特别注意的地方。
  • E : 红色,Error 出现错误,是最需要关注解决的。 E>W>I>D>V
  • MiniLoggerModel
    日志 Model
    MoneyUtil
    MultipartFile
    A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file. [...]
    NumUtil
    Num Util.
    Options
    Every request can pass an Options object which will be merged with Dio.options
    QueryLogParameter
    Rational
    RedirectRecord
    RegexUtil
    Regex Util.
    RequestOptions
    Response<T>
    Response describes the http Response info.
    ResponseBody
    ResponseModel
    SpUtil
    shared preferences
    StringUtil
    ThemeUtil
    TimeFormatUtil
    TimelineUtil
    TimelineInfo
    Timeline information configuration. Timeline信息配置.
    TimeModel
    TimerUtil
    TimerUtil.
    TimeTool
    时间计算器(上月、本月、下月、本年)
    Transformer
    Transformer allows changes to the request/response data before it is sent/received to/from the server. [...]
    UrlUtil
    UsNumberTextInputFormatter
    ZhInfo
    ZhNormalInfo

    Extensions

    DateTimeExtension
    IterableExtension
    MapExtension
    StringExtension

    Constants

    COLORS_MAP → const Map<String, Color>
    const {"AliceBlue" : const Color(0xFFF0F8FF), "AntiqueWhite" : const Color(0xFFFAEBD7), "Aqua" : const Color(0xFF00FFFF), "Aquamarine" : const Color(0xFF7FFFD4)…
    ID_CARD_PROVINCE_DICT → const List<String>
    id card province dict.
    const ['11=北京', '12=天津', '13=河北', '14=山西', '15=内蒙古', '21=辽宁', '22=吉林', '23=黑龙江', '31=上海', '32=江苏', '33=浙江', '…
    MONTH_DAY → const Map<int, int>
    const {1 : 31, 2 : 28, 3 : 31, 4 : 30, 5 : 31, 6 : 30, 7 : 31, 8 : 31, 9 : 30, 10 : 31, 11 : 30, 12 : 31}

    Properties

    disablePathProviderPlatformOverride bool
    @Deprecated('This is no longer necessary, and is now a no-op'), @visibleForTesting, write-only

    Functions

    canLaunch(String urlString) Future<bool>
    Checks whether the specified URL can be handled by some app installed on the device. [...]
    closeWebView() Future<void>
    Closes the current WebView, if one was previously opened via a call to launch. [...]
    getApplicationDocumentsDirectory() Future<Directory>
    Path to a directory where the application may place data that is user-generated, or that cannot otherwise be recreated by your application. [...]
    getApplicationSupportDirectory() Future<Directory>
    Path to a directory where the application may place application support files. [...]
    getDownloadsDirectory() Future<Directory>
    Path to the directory where downloaded files can be stored. This is typically only relevant on desktop operating systems. [...]
    getExternalCacheDirectories() Future<List<Directory>>
    Paths to directories where application specific external cache data can be stored. These paths typically reside on external storage like separate partitions or SD cards. Phones may have multiple storage directories available. [...]
    getExternalStorageDirectories({StorageDirectory type}) Future<List<Directory>>
    Paths to directories where application specific data can be stored. These paths typically reside on external storage like separate partitions or SD cards. Phones may have multiple storage directories available. [...]
    getExternalStorageDirectory() Future<Directory>
    Path to a directory where the application may access top level storage. The current operating system should be determined before issuing this function call, as this functionality is only available on Android. [...]
    getLibraryDirectory() Future<Directory>
    Path to the directory where application can store files that are persistent, backed up, and not visible to the user, such as sqlite.db. [...]
    getTemporaryDirectory() Future<Directory>
    Path to the temporary directory on the device that is not backed up and is suitable for storing caches of downloaded files. [...]
    launch(String urlString, {bool forceSafariVC, bool forceWebView, bool enableJavaScript, bool enableDomStorage, bool universalLinksOnly, Map<String, String> headers, Brightness statusBarBrightness, String webOnlyWindowName}) Future<bool>
    Parses the specified URL string and delegates handling of it to the underlying platform. [...]
    setLocaleInfo(String locale, TimelineInfo timelineInfo) → void
    add custom configuration.

    Enums

    CompressFormat
    Webp only support android. [...]
    DateFormat
    DayFormat
    (xx)Configurable output. (xx)为可配置输出.
    DioErrorType
    MoneyFormat
    MoneyUnit
    ResponseType
    ResponseType indicates which transformation should be automatically applied to the response data by Dio.
    StorageDirectory
    Corresponds to constants defined in Androids android.os.Environment class. [...]

    Typedefs

    CancelWrapper = Future Function(Future)
    EnqueueCallback = FutureOr Function()
    HeaderForEachCallback = void Function(String name, List<String> values)
    InterceptorErrorCallback = dynamic Function(DioError e)
    InterceptorSendCallback = dynamic Function(RequestOptions options)
    InterceptorSuccessCallback = dynamic Function(Response e)
    JsonDecodeCallback = dynamic Function(String)
    The default Transformer for Dio. If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the DefaultTransformer by setting the dio.Transformer.
    OnTimerTickCallback = void Function(int millisUntilFinished)
    timer callback.(millisUntilFinished 毫秒).
    ProgressCallback = void Function(int count, int total)
    Callback to listen the progress for sending/receiving data. [...]
    RequestEncoder = List<int> Function(String request, RequestOptions options)
    ResponseDecoder = String Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
    UpLogEvent = Future<bool> Function(MiniLoggerModel value)
    日志上传事件 value 等待上传的日志! value 反馈是否处理成功!
    ValidateStatus = bool Function(int status)
    VoidCallback = dynamic Function()

    Exceptions / Errors

    DioError
    DioError describes the error info when request failed.
    MissingPlatformDirectoryException
    An exception thrown when a directory that should always be available on the current platform cannot be obtained.