common library

Classes

AnsiColor
This class handles colorizing of terminal output.
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.
CachedNetworkImage
Image widget to show NetworkImage with caching functionality.
CachedNetworkImageProvider
IO implementation of the CachedNetworkImageProvider; the ImageProvider to load network images using a cache.
Chars
CircleWidget
{@temaplate circle_widget} Widget này sẽ cắt child thành hình tròn, mà không can thiệp tới kích thước của chúng {@endtemplate}
ConsoleOutput
Default implementation of LogOutput.
DateFormat
DateFormat is for formatting and parsing dates in a locale-sensitive manner.
DevelopmentFilter
Prints all logs with level >= Logger.level while in development mode (eg when asserts are evaluated, Flutter calls this debug mode).
DotWidget
DownloadProgress
Progress of the file that is being downloaded from the originalUrl.
Event<T>
dùng để wrap các event muốn sử dụng trong state, các event này sẽ bắt buộc phải khởi tạo qua hàm Event.from(data), trong hàm này sẽ tự động tạo ra 1 trường thời gian = thời gian lúc gọi hàm.
FileOutput
Gap
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:
ImageWidget
Trả về hình ảnh tương ứng với imageUrl có thể là một URL hoặc một đường dẫn tới file ảnh trong thư mục assets, hoặc là đường dẫn trỏ tới file trong máy.
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.
KeyboardDismisser
A widget that can dismiss the keyboard when performing a gesture.
KeyboardVisibilityBuilder
Calls builder on keyboard close/open. https://stackoverflow.com/a/63241409/1321917
LoadingWidget
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.
LogOutput
Log output receives a OutputEvent from LogPrinter and sends it to the desired destination.
LogPrinter
An abstract handler of log events.
MemoryOutput
Buffers OutputEvents.
MicroMoney
Used primarily for currency formatting, this number-like class stores millionths of a currency unit, typically as an Int64.
MultiImageStreamCompleter
An ImageStreamCompleter with support for loading multiple images.
MultiOutput
Logs simultaneously to multiple LogOutput outputs.
Bọc widget trong một Navigator riêng biệt, để ví dụ replace nó với 1 widget khác thì sẽ mất toàn bộ các widget và các dialog đang hiện trong Navigator đó, thích hợp dùng ở màn hình login
NumberFormat
Provides the ability to format a number in a locale-specific way.
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.
ShimmerBox
Trả về một Widget có kích thước là widthheight được áp dụng sẵn hiệu ứng từ thư viện shimmer.
SimplePrinter
Outputs simple log messages:
StreamOutput
TextDirection
Represents directionality of text.
TextStyles
TimeOfDayConverter
TimeOfDayConverterNotNull

Enums

CacheManagerLogLevel
Log levels of the cache manager. Debug shows failed downloads and verbose also shows successful downloads and cache retrievals.
GestureType
The gestures available to dismiss the keyboard with KeyboardDismisser.
Level
Levels to control logging output. Logging can be enabled to include all levels above certain Level.
MediaType

Constants

colors → const List<int>

Properties

inputNumber List<FilteringTextInputFormatter>
final
isTesting bool
no setter
logger Logger
final
timeDilation double
Slows down animations by this factor to help in development.
no setter

Functions

a() → void
copyToClipboard(String value) Future<void>
debug(dynamic message, [dynamic error, StackTrace? stackTrace]) → void
defaultPage<T>(Widget child, {String? routeName}) Route<T>
getMediaType(String? mediaSrc) MediaType
getNameFromEmail(String? email) String?
/////////////////////
getRandomElement<T>(List<T> list) → T
getRandomRange(int start, int end) int
random int from start,end
offsetFromDirection(AxisDirection axisDirection) Offset
////////////////////////// ////Transition////////////
parseList<T extends Object?>({required List? json, required T fromJson(Map<String, dynamic> json)}) List<T?>?
////PARSER////////////
parseListNotNull<T extends Object?>({required List json, required T fromJson(Map<String, dynamic> json)}) List<T>
parseMap<T extends Object?>({required Map<String, dynamic> json, required T fromJson(Map<String, dynamic> json)}) Map<String, T?>
parseMapNotNull<T extends Object?>({required Map<String, dynamic> json, required T fromJson(Map<String, dynamic> json)}) Map<String, T>
pop<T extends Object?>(BuildContext context, [T? result]) → void
popToRoot(BuildContext context) → void
push<T>(BuildContext context, Widget page, {String? routeName}) Future<T?>
pushReplacement<T extends Object?, T0 extends Object?>(BuildContext context, Widget page, {T0? result}) Future<T?>
showAlertDialog<T>(BuildContext context, {String? title, String? content, VoidCallback? onClose, VoidCallback? onOk, String titleClose = 'Close', String titleOk = 'Ok', bool barrierDismissible = true, bool useRootNavigator = false}) Future<T?>
actions: a builder with dismiss callback to dismiss the dialog
showLoadingDialog(BuildContext context, {bool useRootNavigator = false}) Future<void>
showSnackBar(BuildContext context, String message, {Color? backgroundColor, int milliseconds = 4000, SnackBarAction? action, Function? onClosed}) → void
slidePage(Widget child, {AxisDirection axisDirection = AxisDirection.right}) Route
toast(String value, {Color? backgroundColor, Color? textColor, double? fontSize = 16}) Future<bool?>
toBeginningOfSentenceCase(String? input, [String? locale]) String?
Convert a string to beginning of sentence case, in a way appropriate to the locale.
validateEmpty(String? value) String?

Typedefs

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.
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.
LogCallback = void Function(LogEvent event)
OutputCallback = void Function(OutputEvent event)
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.
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.