dart_consul library
Classes
- AbsolutePosition
- BaseElement
- BaseOngoingMouseAction
- Base class for OngoingMouseActions that require access to the originating window, and/or event, and/or sendMessage shortcut.
- BlockCanvas
- Buffer
- Generic char code buffer for pre-rendering a "screen" before dumping it into the console.
- BufferConsoleAdapter
- Canvas
- Cell
- Represents an ansi cell: A character, plus an optional ansi sequence before it and a "reset ansi after me" flag.
-
Chooser<
T> - Clipboard
- CloseWindowAction
- Predefined action to close the window that generates this action. Triggers on button release. Uses the Desktop built-in "close-window" message.
- Color
- ColorCanvas
- CompositeDisposable
- Holds potentially multiple Disposables to be disposed in one call. Removes all Disposables when dispose is called. Can be reused after dispose has been called.
- ConIO
- Defines the required functionality to be provided from a console/terminal.
- Console
- The root of the console API
- ConsoleAdapter
- ConsoleCanvas
- ConsumedMouseAction
- Immediately done. Use this to block duplicate event handling in chained mouse event handlers.
- ControlKey
- Represents an identified control-key event.
- Cursor
- CursorPosition
- DebugLog
- Basic auto-timestamped log.
- Desktop
- Pseudo desktop environment for the console. Requires an implementation of ConIO for rendering. Functions only during awaited execution of the run function.
- DesktopNotification
- Dialog
- Disposable
- Generic "disposable" to dispose/cancel/free some wrapped object.
- DrawingCanvas
- DuiBorder
- DuiButton
- DuiColumn
- DuiContainer
- DuiElement
- DuiFocusable
- DuiLayout
- DuiPadding
- DuiRow
- DuiSpace
- DuiState
-
DuiSwitcher<
T> - DuiText
- DuiTextInput
- DuiTitle
- FocusHandling
- Icon
- UTF-8 Icons
- InputKey
- Represents an identified "printable key" event.
- Keyboard
- API for the Keyboard
- KeyCode
- KeyEvent
- Represents the various kinds of incoming key events.
- LoadingBar
- A loading bar
- LogView
- Matcher
- MatchResult
- MaximizeWindowAction
- Predefined action to toggle maximize the window that generates this action. Triggers on button release.
- MinimizeWindowAction
- Predefined action to minimize the window that generates this action. Triggers on button release.
- MockWindowHandling
- MouseButtonEvent
- MouseEvent
- Sealed type representing the various mouse events. Fields x and y are potentially relative to the target object (Window only for now). xAbs and yAbs will hold the original event position.
- MouseGestures
-
Simple mouse gesture detection. Has to be installed as a mouse event
listener via for example
Window.chainOnMouseEvent
. - MouseMotionEvent
- MouseWheelEvent
- MoveWindowAction
- Predefined action to move/drag the window that generates this action.
- OngoingMouseAction
- Interface for handling "ongoing" mouse actions. Windows can return an OngoingMouseAction from their Window.onMouseEvent to intercept mouse events until done returns true. This way moving/dragging, resizing, etc can be implemented.
- OSXClipboard
- OverlayBuffer
- TODO Why not VirtualBuffer only? Or OverlayBuffer only? Revisit!
- PixelSpec
- Position
- Represents the various types available for positioning items. For now this is used for Windows only.
- ProgressBar
- A fancy progress bar
- Prompter
- QueryCancel
- If canceling is allowed.
- QueryPositive
- On positive choice.
- QueryResult
- Somewhat generic types of results that can be returned from query dialogs.
- RaiseWindowAction
- Predefined action to raise/restore the window that generates this action.
- RawEvent
- Represents incoming low-level events (keyboard and mouse).
- RelativePosition
- Position relative to "something". Uses RelativePositionMode and offsets to position elements somewhat dynamically.
- ResizeWindowAction
- Predefined action to resize the window that generates this action. Uses the "resize-window" message to handle resize via the Desktop built-in resize.
- ScrolledContent
- ShellPrompt
- Emulates a Shell Prompt
- Size
- Somewhat generic size type. Uses autoSize constant to represent adaptive sizes.
- StdioConsoleAdapter
- TermLibConIO
- TextPen
- TimeDisplay
- A timer display that mimics pub's timer.
- ToastHandling
- Unidentified
- Represents an "unidentified key sequence" event.
- UnsetInitially
- Special position to represent "not positioned, yet". Will be resolved dynamically when needed. By default, falls back to "center" in toAbsolute and to "zero" in moved.
- VariableStyle
- VirtualBuffer
- Helper for drawing WindowOverlays.
- WideLoadingBar
- A wide loading bar. Kind of like a Progress Bar.
- Window
- Basic window abstraction for the Desktop system. Boils down to a String as the "buffer". May contain ansi control sequences. Buffer can be smaller or bigger than the window size. Will be restricted properly when drawn. Return the data to be shown via redrawBuffer.
- WindowOverlay
- Low-ceremony interface for drawing overlays into Windows.
- WindowSize
- Somewhat over-engineered class for representing current, min and max size of a Window.
- XClipboard
Enums
- Control
- Identifies the supported control keys. Captured via ControlKey events.
- MouseButtonKind
- MouseMotionKind
- MouseWheelKind
- RelativePositionMode
- WindowFlag
- Windows can have any combination of these flags set to change their behavior.
- WindowState
- Primary window state. Windows can be in exactly one primary state only.
Mixins
- AutoDispose
- Auto-dispose system to manage Disposable instances and dispose all of them at once, or specific ones individually. Uses String tags to identify disposables. By assigning a new disposable using the same tag, any previously assigned disposable for the same tag is auto-disposed. Therefore, effectively replacing the previous disposable.
- KeyHandling
Extension Types
Extensions
Constants
-
defaultBorder
→ const List<
String> -
doubleBorder
→ const List<
String> -
inputBorder
→ const List<
String> -
roundedBorder
→ const List<
String>
Functions
-
addAutoHelp(
Desktop desktop, {String key = "<C-?>", List< String> aliases = const [], Position position = const RelativePosition.fromBottomRight()}) → void -
addDebugLog(
Desktop desktop, {required LogView log, String id = "log", String name = "Log", String? key, WindowState state = WindowState.normal, Size size = const Size.autoWidth(10), Position position = const RelativePosition.fromBottom(yOffset: -1), bool filter(String)?}) → Window -
bgBlack(
Object text) → String - Background Colors bgBlack style
-
bgBlackBright(
Object text) → String - bgBlackBright style
-
bgBlue(
Object text) → String - bgBlue style
-
bgBlueBright(
Object text) → String - bgBlueBright style
-
bgCyan(
Object text) → String - bgCyan style
-
bgCyanBright(
Object text) → String - bgCyanBright style
-
bgGreen(
Object text) → String - bgGreen style
-
bgGreenBright(
Object text) → String - bgGreenBright style
-
bgMagenta(
Object text) → String - bgMagenta style
-
bgMagentaBright(
Object text) → String - bgMagentaBright style
-
bgRed(
Object text) → String - bgRed style
-
bgRedBright(
Object text) → String - bgRedBright style
-
bgWhite(
Object text) → String - bgWhite style
-
bgWhiteBright(
Object text) → String - bgWhiteBright style
-
bgYellow(
Object text) → String - bgYellow style
-
bgYellowBright(
Object text) → String - bgYellowBright style
-
black(
Object text) → String - Colors black style
-
blackBright(
Object text) → String - blackBright style
-
blue(
Object text) → String - blue style
-
blueBright(
Object text) → String - blueBright style
-
bold(
Object text) → String - bold style
-
createTree(
dynamic input, {String prefix = '', Map? opts}) → String - Creates a Tree (this is like the npm dependency tree)
-
cyan(
Object text) → String - cyan style
-
cyanBright(
Object text) → String - cyanBright style
-
dim(
Object text) → String - dim style
-
format(
String input, {List< String> ? args, Map<String, String> ? replace, VariableStyle? style, VariableResolver? resolver}) → String -
getClipboard(
) → Clipboard? -
gray(
Object text) → String - gray style
-
green(
Object text) → String - green style
-
greenBright(
Object text) → String - greenBright style
-
grey(
Object text) → String - gray style
- hidden style
-
inheritIO(
Process process, {String? prefix, bool lineBased = true}) → void -
inverse(
Object text) → String - inverse style
-
italic(
Object text) → String - italic style
-
magenta(
Object text) → String - magenta style
-
magentaBright(
Object text) → String - magentaBright style
-
mouseWheelKind(
bool down) → MouseWheelKind -
overline(
Object text) → String - underline style
-
printTree(
dynamic input, {String prefix = '', Map? opts}) → void - Prints a tree. This is ported from the NPM code (the dependency tree)
-
readInput(
String message, {bool secret = false, ResponseChecker? checker}) → Future< String> -
red(
Object text) → String - red style
-
redBright(
Object text) → String - redBright style
-
reset(
Object text) → String - Motifiers rest style
-
scrolled(
Window window, OnRedraw content, {String? header, String nameExtension = " ≡ ▼/▲ j/k", bool extendName = true, bool defaultShortcuts = true, bool mouseWheel = true, bool ellipsize = true, List< String> ? borderStyle}) → ScrolledContent -
simpleBorderStyle(
String spec) → List< String> -
strikeThrough(
Object text) → String - strikethrough style
-
underline(
Object text) → String - underline style
-
white(
Object text) → String - white style
-
whiteBright(
Object text) → String - whiteBright style
-
yellow(
Object text) → String - yellow style
-
yellowBright(
Object text) → String - yellowBright style
Typedefs
- Callback = void Function()
- CanvasColor = String Function(String)
-
ChooserEntryFormatter<
T> = String Function(T choice, int index) - KeyHandler = dynamic Function(KeyEvent)
-
KeyMap
= Map<
String, Iterable< (String, String)> > - MouseHandler = dynamic Function(MouseEvent)
- NextPositionLoadingBar = dynamic Function()
- Specifies the next position of the loading bar
- OnMouseEvent = OngoingMouseAction? Function(MouseEvent)
- OnRedraw = String? Function()
-
Window buffers are simply Strings with newlines after every row.
Windows can return
null
in their Window.redrawBuffer method to indicate "no content atm". This typedef captures the function signature. - ResponseChecker = bool Function(String response)
- VariableResolver = String Function(String variable)