fuck_utils
library
Classes
AssetUtil
资源帮助类
AuthenticationChallenge
A single challenge in a WWW-Authenticate header, parsed as per RFC 2617 .
BackgroundTransformer
The default Transformer for Dio .
BaseOptions
A set of base settings for each Dio()
.
BaseOptions and Options will be merged into one RequestOptions before
sending the requests. See Options.compose .
Bindings
Bindings should be extended or implemented.
When using GetMaterialApp
, all GetPage
s and navigation
methods (like Get.to()) have a binding
property that takes an
instance of Bindings to manage the
dependencies() (via Get.put()) for the Route you are opening.
BindingsBuilder <T >
Simplifies Bindings generation from a single callback.
To avoid the creation of a custom Binding instance per route.
CachedNetworkImage
Image widget to show NetworkImage with caching functionality.
CachedNetworkImageProvider
IO implementation of the CachedNetworkImageProvider; the ImageProvider to
load network images using a cache.
CancelToken
Controls cancellation of Dio 's requests.
CaseInsensitiveMap <V >
A map from case-insensitive strings to values.
ChunkedCodingCodec
A codec that encodes and decodes the chunked transfer coding .
ChunkedCodingDecoder
A converter that decodes byte arrays into chunks with size tags.
ChunkedCodingEncoder
A converter that encodes byte arrays into chunks with size tags.
CommonScaffold
常用Scaffold,点击键盘外部的未消费事件区域,则让软键盘消失
CommonTabBar
CountDownController
倒计时,支持2个倒计时
CustomTransition
DateUtil
Date Util.
DialogUtil
Dio
Dio enables you to make HTTP requests easily.
DioMixin
DisposableInterface
DownloadProgress
Progress of the file that is being downloaded from the originalUrl
.
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
FastList <T >
FormData
A class to create readable "multipart/form-data" streams.
It can be used to submit forms and file uploads to http server.
FullLifeCycleController
FusedTransformer
A Transformer that has a fast path for decoding UTF8-encoded JSON.
If the response is utf8-encoded JSON and no custom decoder is specified in the RequestOptions , this transformer
is significantly faster than the default SyncTransformer and the BackgroundTransformer .
This improvement is achieved by using a fused Utf8Decoder and JsonDecoder to decode the response,
which is faster than decoding the utf8-encoded JSON in two separate steps, since
Dart uses a special fast decoder for this case.
See https://github.com/dart-lang/sdk/blob/5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9/sdk/lib/_internal/vm/lib/convert_patch.dart#L40
GetBar
GetBuilder <T extends GetxController >
GetBuilderState <T extends GetxController >
GetCupertinoApp
GetDelegate
GetInformationParser
GetInstance
GetInterface
GetInterface allows any auxiliary package to be merged into the "Get"
class through extensions
GetLifeCycle
GetMaterialApp
GetMaterialController
GetMicrotask
GetMiddleware
The Page Middlewares.
The Functions will be called in this order
(( redirect -> onPageCalled -> onBindingsStart ->
onPageBuildStart -> onPageBuilt -> onPageDispose ))
GetModalBottomSheetRoute <T >
GetNavConfig
This config enables us to navigate directly to a sub-url
GetNavigator
GetNotifier <T >
GetObserver
GetPage <T >
GetPlatform
GetQueue
GetResponsiveView <T >
Extend this widget to build responsive view.
this widget contains the screen
property that have all
information about the screen size and type.
You have two options to build it.
1- with builder
method you return the widget to build.
2- with methods desktop
, tablet
,phone
, watch
. the specific
method will be built when the screen type matches the method
when the screen is ScreenType.Tablet the tablet
method
will be exuded and so on.
Note if you use this method please set the
property alwaysUseBuilder
to false
With settings
property you can set the width limit for the screen types.
GetResponsiveWidget <T extends GetLifeCycleBase ? >
GetRouterOutlet
GetSnackBar
GetSnackBarState
GetStream <T >
GetStream is the lightest and most performative way of working
with events at Dart. You sintaxe is like StreamController, but it works
with simple callbacks. In this way, every event calls only one function.
There is no buffering, to very low memory consumption.
event add will add a object to stream. addError will add a error
to stream. listen is a very light StreamSubscription interface.
Is possible take the last value with value property.
GetStreamTransformation <T >
GetUtils
GetView <T >
GetView is a great way of quickly access your Controller
without having to call Get.find
GetWidget <S extends GetLifeCycleBase ? >
GetWidget is a great way of quickly access your individual Controller
without having to call Get.find
GetX <T extends DisposableInterface >
GetxController
GetxService
Unlike GetxController, which serves to control events on each of its pages,
GetxService is not automatically disposed (nor can be removed with
Get.delete()).
It is ideal for situations where, once started, that service will
remain in memory, such as Auth control for example. Only way to remove
it is Get.reset().
GetXState <T extends DisposableInterface >
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter
is a bridge between Dio and HttpClient .
HttpFormatter
HttpUtil
dio的封装
ImageLoader
图片加载,可以加载网络图和本地图片
ImageUtil
截图
IndexBar
索引栏
InstanceInfo
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.
InternalFinalCallback <T >
Special callable class to keep the contract of a regular method, and avoid
overrides if you extend the class that uses it, as Dart has no final
methods.
Used in DisposableInterface
to avoid the danger of overriding onStart.
KeyboardDismisser
A widget that can dismiss the keyboard when performing a gesture.
LightSubscription <T >
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.
LogUtil
MediaType
A class representing an HTTP media type, as used in Accept and Content-Type
headers.
MiddlewareRunner
MiniStream <T >
MiniSubscription <T >
MixinBuilder <T extends GetxController >
MultiImageStreamCompleter
An ImageStreamCompleter with support for loading multiple images.
MultipartFile
A file to be uploaded as part of a MultipartRequest
. This doesn't need to
correspond to a physical file.
Node <T >
ObjectUtil
Object Util.
Obx
The simplest reactive widget in GetX.
ObxState
ObxValue <T extends RxInterface >
Similar to Obx, but manages a local state.
Pass the initial data in constructor.
Useful for simple local states, like toggles, visibility, themes,
button states, etc.
Sample:
ObxValue((data) => Switch(
value: data.value,
onChanged: (flag) => data.value = flag,
),
false.obs,
),
ObxWidget
The ObxWidget is the base for all GetX reactive widgets
OnClick
点击封装
Options
The configuration for a single request.
BaseOptions and Options will be merged into one RequestOptions before
sending the requests. See Options.compose .
PagedChildBuilderDelegate <ItemType >
Supplies builders for the visual components of paged views.
PagedGridView <PageKeyType , ItemType >
A GridView with pagination capabilities.
PagedLayoutBuilder <PageKeyType , ItemType >
Facilitates creating infinitely scrolled paged layouts.
PagedListView <PageKeyType , ItemType >
A ListView with pagination capabilities.
PagedMasonryGridView <PageKeyType , ItemType >
A MasonryGridView
with pagination capabilities.
PagedPageView <PageKeyType , ItemType >
Paged PageView with progress and error indicators displayed as the last
item.
PagedSliverGrid <PageKeyType , ItemType >
Paged SliverGrid with progress and error indicators displayed as the last
item.
PagedSliverList <PageKeyType , ItemType >
A SliverList with pagination capabilities.
PagingController <PageKeyType , ItemType >
A controller for a paged widget.
PagingState <PageKeyType , ItemType >
The current item's list, error, and next page key state for a paginated
widget.
Pair <K , V >
PathDecoded
Permission
Defines the permissions which can be checked and requested.
PermissionWithService
A special kind of permission, used to access a service.
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.
RegexUtil
Regex Util.
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.
ResponsiveScreen
ResponsiveScreenSettings
RichTextUtil
富文本构造类
RichTextHelper().appendText().appendWidget().build();
RouterOutlet <TDelegate extends RouterDelegate <T > , T extends Object >
RouterOutletState <TDelegate extends RouterDelegate <T > , T extends Object >
Routing
Rx <T >
Foundation class used for custom Types
outside the common native Dart
types.
For example, any custom "Model" class, like User().obs will use Rx
as
wrapper.
RxBool
RxController
RxDouble
RxInt
RxInterface <T >
This class is the foundation for all reactive (Rx) classes that makes Get
so powerful.
This interface is the contract that _RxImpl]
RxList <E >
Create a list similar to List<T>
RxMap <K , V >
Rxn <T >
RxnBool
RxnDouble
RxnInt
RxnNum
RxNotifier <T >
RxnString
Rx class for String
Type.
RxNum
RxSet <E >
RxStatus
RxString
Rx class for String
Type.
Rxx <T >
RxxBool
RxxList <T >
RxxString
SaveResult
SearchContainer
SharedPreferences
Wraps NSUserDefaults (on iOS) and SharedPreferences (on Android), providing
a persistent store for simple data.
SharedPreferencesAsync
Provides a persistent store for simple data.
SharedPreferencesWithCache
Provides a persistent store for simple data.
SharedPreferencesWithCacheOptions
Options necessary to create a SharedPreferencesWithCache .
SimpleBuilder
SimpleBuilderState
SnackbarController
StatusLayout
状态切换布局
StringUtil
SuperContainer
SuperController <T >
SuperText
可携带一个child的Text组件
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 .
TitleBar
标题栏
ToastUtil
TokenInterceptor
Transformer
Transformer allows changes to the request/response data before
it is sent/received to/from the server.
Translations
Value <T >
ValueBuilder <T >
Manages a local state like ObxValue, but uses a callback instead of
a Rx value.
ValueBuilderState <T >
WebView
WebViewPage
WidgetUtil
Worker
Workers
Enums
CacheManagerLogLevel
Log levels of the cache manager. Debug shows failed downloads and verbose
also shows successful downloads and cache retrievals.
ChildPosition
DioExceptionType
The exception enumeration indicates what type of exception
has happened during requests.
GestureType
The gestures available to dismiss the keyboard with KeyboardDismisser .
ListFormat
Specifies the array format (a single parameter with multiple parameter
or multiple parameters with the same name).
and the separator for array items.
PagedLayoutProtocol
The Flutter layout protocols supported by PagedLayoutBuilder .
PagingStatus
All possible status for a pagination.
PermissionStatus
Defines the state of a Permission .
PopMode
Enables the user to customize the intended pop behavior
PreventDuplicateHandlingMode
Enables the user to customize the behavior when pushing multiple routes that
shouldn't be duplicates
ResponseType
Indicates which transformation should be applied to the response data.
RowStyle
ScreenType
ServiceStatus
Defines the different states a service can be in.
SmartManagement
GetX by default disposes unused controllers from memory,
Through different behaviors.
SmartManagement.full
SmartManagement.full is the default one. Dispose classes that are
not being used and were not set to be permanent. In the majority
of the cases you will want to keep this config untouched.
If you new to GetX then don't change this.
SmartManagement.onlyBuilder only controllers started in init:
or loaded into a Binding with Get.lazyPut() will be disposed. If you use
Get.put() or Get.putAsync() or any other approach, SmartManagement
will not have permissions to exclude this dependency. With the default
behavior, even widgets instantiated with "Get.put" will be removed,
unlike SmartManagement.onlyBuilders.
SmartManagement.keepFactory Just like SmartManagement.full,
it will remove it's dependencies when it's not being used anymore.
However, it will keep their factory, which means it will recreate
the dependency if you need that instance again.
SnackbarStatus
Indicates Status of snackbar
SnackbarStatus.OPEN Snack is fully open, SnackbarStatus.CLOSED Snackbar
has closed,
SnackbarStatus.OPENING Starts with the opening animation and ends
with the full
snackbar display, SnackbarStatus.CLOSING Starts with the closing animation
and ends
with the full snackbar dispose
SnackPosition
Indicates if snack is going to start at the TOP or at the BOTTOM
SnackStyle
Indicates if snack will be attached to the edge of the screen or not
TabStyle
Transition
Properties
Get
→ _GetImpl
final
idCardProvinceDict
↔ List <String >
id card province dict.
getter/setter pair
navigator
→ NavigatorState ?
It replaces the Flutter Navigator, but needs no context.
You can to use navigator.push(YourRoute()) rather
Navigator.push(context, YourRoute());
no setter
timeDilation
→ double
Slows down animations by this factor to help in development.
no setter
Functions
ambiguate <T > (T? value )
→ T?
debounce <T > (RxInterface <T > listener , WorkerCallback <T > callback , {Duration ? time , Function ? onError , void onDone ()?, bool ? cancelOnError })
→ Worker
debounce is similar to interval , but sends the last value.
Useful for Anti DDos, every time the user stops typing for 1 second,
for instance.
When listener
emits the last "value", when time
hits,
it calls callback
with the last "value" emitted.
defaultLogWriterCallback (String value , {bool isError = false })
→ void
default logger from GetX
ever <T > (RxInterface <T > listener , WorkerCallback <T > callback , {dynamic condition = true , Function ? onError , void onDone ()?, bool ? cancelOnError })
→ Worker
Called every time listener
changes. As long as the condition
returns true.
everAll (List <RxInterface > listeners , WorkerCallback callback , {dynamic condition = true , Function ? onError , void onDone ()?, bool ? cancelOnError })
→ Worker
Similar to ever , but takes a list of listeners
, the condition
for the callback
is common to all listeners
,
and the callback
is executed to each one of them. The Worker is
common to all, so worker.dispose()
will cancel all streams.
formatHttpDate (DateTime date )
→ String
Return a HTTP-formatted string representation of date
.
interval <T > (RxInterface <T > listener , WorkerCallback <T > callback , {Duration time = const Duration(seconds: 1) , dynamic condition = true , Function ? onError , void onDone ()?, bool ? cancelOnError })
→ Worker
Ignore all changes in listener
during time
(1 sec by default) or until
condition
is met (can be a bool expression or a bool Function()
),
It brings the 1st "value" since the period of time, so
if you click a counter button 3 times in 1 sec, it will show you "1"
(after 1 sec of the first press)
click counter 3 times in 1 sec, it will show you "4" (after 1 sec)
click counter 2 times in 1 sec, it will show you "7" (after 1 sec).
once <T > (RxInterface <T > listener , WorkerCallback <T > callback , {dynamic condition = true , Function ? onError , void onDone ()?, bool ? cancelOnError })
→ Worker
once()
will execute only 1 time when condition
is met and cancel
the subscription to the listener
stream right after that.
condition
defines when callback
is called, and
can be a bool or a bool Function()
.
openAppSettings ()
→ Future <bool >
Opens the app settings page.
parseHttpDate (String date )
→ DateTime
Parses an HTTP-formatted date into a UTC DateTime .
Typedefs
AddSubscription <T >
= FutureOr <void > Function(LightSubscription <T > subs )
AsyncInstanceBuilderCallback <S >
= Future <S > Function()
BindingBuilderCallback
= void Function()
CompletedListingBuilder
= Widget Function(BuildContext context , IndexedWidgetBuilder itemWidgetBuilder , int itemCount , WidgetBuilder ? noMoreItemsIndicatorBuilder )
Condition
= bool Function()
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.
DioMediaType
= MediaType
The type (alias) for specifying the content-type of the MultipartFile
.
ErrorListingBuilder
= Widget Function(BuildContext context , IndexedWidgetBuilder itemWidgetBuilder , int itemCount , WidgetBuilder newPageErrorIndicatorBuilder )
GetControllerBuilder <T extends DisposableInterface >
= Widget Function(T controller )
GetPageBuilder
= Widget Function()
GetXControllerBuilder <T extends DisposableInterface >
= Widget Function(T controller )
The signature that iterates header fields.
HttpLoggerFilter
= bool Function()
ImageWidgetBuilder
= Widget Function(BuildContext context , ImageProvider <Object > imageProvider )
Builder function to create an image widget. The function is called after
the ImageProvider completes the image loading.
InjectorBuilderCallback <S >
= S Function(GetInstance )
InstanceBuilderCallback <S >
= S Function()
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 .
ItemWidgetBuilder <ItemType >
= Widget Function(BuildContext context , ItemType item , int index )
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.
LoadingErrorWidgetBuilder
= Widget Function(BuildContext context , String url , Object error )
Builder function to create an error widget. This builder is called when
the image failed loading, for example due to a 404 NotFound exception.
LoadingListingBuilder
= Widget Function(BuildContext context , IndexedWidgetBuilder itemWidgetBuilder , int itemCount , WidgetBuilder newPageProgressIndicatorBuilder )
LogWriterCallback
= void Function(String text , {bool isError })
VoidCallback from logs
NotifierBuilder <T >
= Widget Function(T state )
OnTap
= void Function(GetSnackBar snack )
PagingStatusListener
= void Function(PagingStatus status )
PlaceholderWidgetBuilder
= Widget Function(BuildContext context , String url )
Builder function to create a placeholder widget. The function is called
once while the ImageProvider is loading the image.
PrintFunctionCallback
= void Function(String prefix , dynamic value , String info , {bool ? isError })
ProgressCallback
= void Function(int count , int total )
The type of a progress listening callback when sending or receiving data.
ProgressIndicatorBuilder
= Widget Function(BuildContext context , String url , DownloadProgress progress )
Builder function to create a progress indicator widget. The function is
called every time a chuck of the image is downloaded from the web, but at
least once during image loading.
RemoveSubscription <T >
= FutureOr <bool ? > Function(LightSubscription <T > subs )
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.
SliverGridBuilder
= SliverWithKeepAliveWidget Function(int childCount , SliverChildDelegate delegate )
SliverSimpleGridDelegateBuilder
= SliverSimpleGridDelegate Function(int childCount )
SnackbarStatusCallback
= void Function(SnackbarStatus ? status )
ValidateStatus
= bool Function(int ? status )
The type of a response status code validate callback.
ValueBuilderBuilder <T >
= Widget Function(T snapshot , ValueBuilderUpdateCallback <T > updater )
ValueBuilderUpdateCallback <T >
= void Function(T snapshot )
ValueUpdater <T >
= T Function()
WidgetCallback
= Widget Function()
WorkerCallback <T >
= dynamic Function(T callback )