dnkit library
Flutter 앱에서 공통으로 사용하는 앱 셸, 테마, HTTP 유틸리티와 위젯을 제공한다.
Classes
- Abortable
- An HTTP request that can be aborted before it completes.
- AbortableMultipartRequest
- A MultipartRequest which supports abortion using abortTrigger.
- AbortableRequest
- A Request which supports abortion using abortTrigger.
- AbortableStreamedRequest
- A StreamedRequest which supports abortion using abortTrigger.
- BaseClient
- The abstract base class for an HTTP client.
- BaseRequest
- The base class for HTTP requests.
- BaseResponse
- The base class for HTTP responses.
- BaseResponseWithUrl
- A BaseResponse with a url field.
- Bidi
- This provides utility methods for working with bidirectional text. All of the methods are static, and are organized into a class primarily to group them together for documentation and discoverability.
- BidiFormatter
- Bidi stands for Bi-directional text. According to Wikipedia: Bi-directional text is text containing text in both text directionalities, both right-to-left (RTL) and left-to-right (LTR). It generally involves text containing different types of alphabets, but may also refer to boustrophedon, which is changing text directionality in each row.
- BrowserConfiguration
- Additional configuration options for LaunchMode.inAppBrowserView
- ByteStream
- A stream of chunks of bytes representing a single piece of data.
-
ChangeNotifierProvider<
T extends ChangeNotifier?> - Listens to a ChangeNotifier, expose it to its descendants and rebuilds dependents whenever ChangeNotifier.notifyListeners is called.
-
ChangeNotifierProxyProvider<
T, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider0<
R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider2<
T, T2, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider3<
T, T2, T3, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider4<
T, T2, T3, T4, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider5<
T, T2, T3, T4, T5, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
-
ChangeNotifierProxyProvider6<
T, T2, T3, T4, T5, T6, R extends ChangeNotifier?> - A ChangeNotifierProvider that builds and synchronizes a ChangeNotifier with external values.
- Client
- The interface for HTTP clients that take care of maintaining persistent connections across multiple requests to the same server.
-
Consumer<
T> - Obtains Provider<T> from its ancestors and passes its value to builder.
-
Consumer2<
A, B> - Obtains Provider<T> from its ancestors and passes its value to builder.
-
Consumer3<
A, B, C> - Obtains Provider<T> from its ancestors and passes its value to builder.
-
Consumer4<
A, B, C, D> - Obtains Provider<T> from its ancestors and passes its value to builder.
-
Consumer5<
A, B, C, D, E> - Obtains Provider<T> from its ancestors and passes its value to builder.
-
Consumer6<
A, B, C, D, E, F> - Obtains Provider<T> from its ancestors and passes its value to builder.
- DateFormat
- DateFormat is for formatting and parsing dates in a locale-sensitive manner.
-
DeferredInheritedProvider<
T, R> - An InheritedProvider where the object listened is not the object emitted.
- DN
- Dnkit이 등록한 전역 서비스와 편의 기능에 접근하는 정적 파사드다.
- DNBottomPageButton
- 페이지 하단 액션에 맞춘 DNPrimaryButton 래퍼다.
- DNColorScheme
- Dnkit 위젯과 Material 테마가 공유하는 의미 기반 색상 모음이다.
- DNDialogContainer
- 화면 크기에 맞춰 제한되고 스크롤 가능한 다이얼로그 내용 컨테이너다.
-
DNDropdownButton<
T> - Dnkit 테마의 테두리와 배경을 적용한 드롭다운 버튼이다.
- DNEmailField
- 로컬 파트와 선택 가능한 도메인을 조합하는 이메일 입력 위젯이다.
- DNFadeInAnimation
- 지연 후 자식을 서서히 표시하는 페이드인 애니메이션이다.
- DNHeadingBar
- 제목과 우측 액션을 한 행에 배치하는 섹션 헤더다.
- DNHourMinutePicker
- 시, 분, 오전·오후를 각각 휠로 선택하는 시간 선택기다.
- DNHttp
- Dnkit이 사용하는 HTTP 요청 및 오류 알림 계약이다.
- DNIntrinsicGridView
- 자식의 고유 높이를 유지하며 고정 열 수로 배치하는 간단한 그리드다.
- DNLabel
- 제목, 우측 액션과 선택적 내용을 세로로 묶는 레이블 섹션이다.
- DNMaterialApp
- Dnkit의 서비스와 테마를 Provider로 등록하는 최상위 Material 앱 위젯이다.
- DNMenuButton
- 선택적 아이콘과 내용을 가로로 배치하는 탭 가능한 메뉴 행이다.
- DNPageContainer
- 화면의 사용 가능한 최소 높이를 채우는 스크롤 컨테이너다.
- DNPageIndicator
- 현재 위치까지 강조하는 분할형 페이지 진행 표시기다.
- DNPicker
- 선택 변경을 디바운스하는 Cupertino 고정 범위 휠 선택기다.
- DNPlaceholder
- 현재 테마의 옅은 회색으로 원형 자리 표시자를 그린다.
- DNPopUpAnimation
- 자식을 아래쪽에서 나타나게 하며 페이드인하는 진입 애니메이션이다.
- DNPrimaryButton
- 활성, 대기, 비활성 및 외곽선 상태를 지원하는 기본 액션 버튼이다.
- DNTextField
- Dnkit 테마와 디바운스된 변경 이벤트를 지원하는 텍스트 입력 위젯이다.
- DNTextStyle
- 등록된 Dnkit 테마의 글꼴 크기와 글꼴 가족을 기본 적용하는 텍스트 스타일이다.
- DNTheme
- 현재 테마 모드를 관리하고 Material ThemeData를 생성한다.
- DNThemeData
- 밝은색·어두운색 구성과 타이포그래피 및 회색 팔레트를 묶은 테마 설정이다.
- DNToggleButton
- 여러 문자열 옵션 중 하나를 선택하는 분할 토글 버튼이다.
- DNYearMonthPicker
- 연도를 이동하며 월을 선택하는 다이얼로그용 선택기다.
-
FutureProvider<
T> -
Listens to a Future and exposes its result to
childand its descendants. -
InheritedContext<
T> - A BuildContext associated to an InheritedProvider.
-
InheritedProvider<
T> - A generic implementation of an InheritedWidget.
- Intl
-
The Intl class provides a common entry point for internationalization
related tasks. An Intl instance can be created for a particular locale
and used to create a date format via
anIntl.date(). Static methods on this class are also used in message formatting. -
ListenableProvider<
T extends Listenable?> - Listens to a Listenable, expose it to its descendants and rebuilds dependents whenever the listener emits an event.
-
ListenableProxyProvider<
T, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider0<
R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider2<
T, T2, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider3<
T, T2, T3, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider4<
T, T2, T3, T4, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider5<
T, T2, T3, T4, T5, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
-
ListenableProxyProvider6<
T, T2, T3, T4, T5, T6, R extends Listenable?> - A variation of ListenableProvider that builds its value from values obtained from other providers.
- MediaType
- A class representing an HTTP media type, as used in Accept and Content-Type headers.
- MicroMoney
- Used primarily for currency formatting, this number-like class stores millionths of a currency unit, typically as an Int64.
- MultipartFile
- A file to be uploaded as part of a MultipartRequest.
- MultipartRequest
-
A
multipart/form-datarequest. - MultiProvider
- A provider that merges multiple providers into a single linear widget tree. It is used to improve readability and reduce boilerplate code of having to nest multiple layers of providers.
- NumberFormat
- Provides the ability to format a number in a locale-specific way.
-
NumberParserBase<
R> -
Option<
T> - 값이 없을 수 있음을 명시적으로 감싸는 최소 컨테이너다.
- PreferredSizePadding
- PreferredSizeWidget에 패딩을 더하고 선호 크기도 함께 확장한다.
-
Provider<
T> - A Provider that manages the lifecycle of the value it provides by delegating to a pair of Create and Dispose.
- ProviderBinding
-
ProxyProvider<
T, R> - A provider that builds a value based on other providers.
-
ProxyProvider0<
R> - A provider that builds a value based on other providers.
-
ProxyProvider2<
T, T2, R> - A provider that builds a value based on other providers.
-
ProxyProvider3<
T, T2, T3, R> - A provider that builds a value based on other providers.
-
ProxyProvider4<
T, T2, T3, T4, R> - A provider that builds a value based on other providers.
-
ProxyProvider5<
T, T2, T3, T4, T5, R> - A provider that builds a value based on other providers.
-
ProxyProvider6<
T, T2, T3, T4, T5, T6, R> - A provider that builds a value based on other providers.
- ReassembleHandler
- If you need your provider to be notified when 'Hot Reload' occurs, use this class
- Request
- An HTTP request where the entire request body is known in advance.
- Response
- An HTTP response where the entire response body is known in advance.
-
Selector<
A, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
-
Selector0<
T> - A base class for custom Selector.
-
Selector2<
A, B, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
-
Selector3<
A, B, C, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
-
Selector4<
A, B, C, D, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
-
Selector5<
A, B, C, D, E, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
-
Selector6<
A, B, C, D, E, F, S> - An equivalent to Consumer that can filter updates by selecting a limited amount of values and prevent rebuild if they don't change.
- StreamedRequest
- An HTTP request where the request body is sent asynchronously after the connection has been established and the headers have been sent.
- StreamedResponse
- An HTTP response where the response body is received asynchronously after the headers have been received.
-
StreamProvider<
T> -
Listens to a Stream and exposes its content to
childand descendants. - TextDirection
- Represents directionality of text.
-
ValueListenableProvider<
T> - Listens to a ValueListenable and exposes its current value.
- WebViewConfiguration
- Additional configuration options for LaunchMode.inAppWebView.
Enums
- AmPm
- 12시간제 시간의 오전 또는 오후 구분이다.
- DNThemeMode
- Dnkit 테마의 밝은색 및 어두운색 모드다.
- LaunchMode
- The desired mode to launch a URL.
Extensions
- ColorExtensions on Color
- Material Color의 HSL 밝기를 조절하는 확장 기능이다.
- DNHttpAuthExtension on DNHttp
- DNHttp에 저장된 토큰을 이용한 인증 요청과 갱신 재시도를 추가한다.
- DNResponseExtension on Response
-
http.Response의 상태 판정, JSON 해석 및 오류 처리를 돕는다. - HeadersWithSplitValues on BaseResponse
- ReadContext on BuildContext
- Exposes the read method.
- SelectContext on BuildContext
-
Adds a
selectmethod on BuildContext. - WatchContext on BuildContext
- Exposes the watch method.
Functions
-
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.
-
cdn(
String key, {int? width, int? height, String? fit, double? ratio, int? quality}) → String - 설정된 CDN 원점에 리사이즈 및 품질 쿼리를 붙인 URL을 만든다.
-
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.
-
delete(
Uri url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> - Sends an HTTP DELETE request with the given headers to the given URL.
-
get(
Uri url, {Map< String, String> ? headers}) → Future<Response> - Sends an HTTP GET request with the given headers to the given URL.
-
head(
Uri url, {Map< String, String> ? headers}) → Future<Response> - Sends an HTTP HEAD request with the given headers to the given URL.
-
launch(
String urlString, {bool? forceSafariVC, bool forceWebView = false, bool enableJavaScript = false, bool enableDomStorage = false, bool universalLinksOnly = false, Map< String, String> headers = const <String, String>{}, 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
urlto the underlying platform for handling. -
patch(
Uri url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> - Sends an HTTP PATCH request with the given headers and body to the given URL.
-
post(
Uri url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> - Sends an HTTP POST request with the given headers and body to the given URL.
-
put(
Uri url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> - Sends an HTTP PUT request with the given headers and body to the given URL.
-
read(
Uri url, {Map< String, String> ? headers}) → Future<String> - Sends an HTTP GET request with the given headers to the given URL and returns a Future that completes to the body of the response as a String.
-
readBytes(
Uri url, {Map< String, String> ? headers}) → Future<Uint8List> - Sends an HTTP GET request with the given headers to the given URL and returns a Future that completes to the body of the response as a list of bytes.
-
runWithClient<
R> (R body(), Client clientFactory(), {ZoneSpecification? zoneSpecification}) → R -
Runs
bodyin its own Zone with the Client returned byclientFactoryset as the default Client. -
supportsCloseForLaunchMode(
LaunchMode mode) → Future< bool> -
Returns true if closeInAppWebView is supported for
modein the current platform implementation. -
supportsLaunchMode(
LaunchMode mode) → Future< bool> -
Returns true if
modeis supported by the current platform implementation. -
toBeginningOfSentenceCase<
T extends String?> (T input, [String? locale]) → T - Convert a string to beginning of sentence case, in a way appropriate to the locale.
Typedefs
-
Create<
T> = T Function(BuildContext context) -
A function that creates an object of type
T. -
DeferredStartListening<
T, R> = VoidCallback Function(InheritedContext< R?> context, void setState(R value), T controller, R? value) -
A callback used to handle the subscription of
controller. -
Dispose<
T> = void Function(BuildContext context, T value) -
A function that disposes an object of type
T. -
ErrorBuilder<
T> = T Function(BuildContext context, Object? error) - A callback used to build a valid value from an error.
-
Locator
= T Function<
T>() - A generic function that can be called to read providers, without having a reference on BuildContext.
-
ProviderBuilder<
R> = Widget Function(BuildContext context, R value, Widget child) -
ProxyProviderBuilder<
T, R> = R Function(BuildContext context, T value, R? previous) -
ProxyProviderBuilder2<
T, T2, R> = R Function(BuildContext context, T value, T2 value2, R? previous) -
ProxyProviderBuilder3<
T, T2, T3, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, R? previous) -
ProxyProviderBuilder4<
T, T2, T3, T4, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, R? previous) -
ProxyProviderBuilder5<
T, T2, T3, T4, T5, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, T5 value5, R? previous) -
ProxyProviderBuilder6<
T, T2, T3, T4, T5, T6, R> = R Function(BuildContext context, T value, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, R? previous) -
ShouldRebuild<
T> = bool Function(T previous, T next) - Used by providers to determine whether dependents needs to be updated when the value exposed changes
-
StartListening<
T> = VoidCallback Function(InheritedContext< T?> element, T value) - A callback used to start the listening of an object and return a function that cancels the subscription.
-
UpdateShouldNotify<
T> = bool Function(T previous, T current) -
A function that returns true when the update from
previoustocurrentshould notify listeners, if any.
Exceptions / Errors
- ClientException
- An exception caused by an error in a pkg/http client.
- ProviderNotFoundException
- The error that will be thrown if Provider.of fails to find a Provider as an ancestor of the BuildContext used.
- ProviderNullException
-
Called
Provider.of<T>instead ofProvider.of<T?>but the provider returnednull. - RequestAbortedException
- Thrown when an HTTP request is aborted.