recollect library

Ready-made Flutter widgets, theming, colours and fonts for desktop-first apps.

Import this one file to get everything:

import 'package:recollect/recollect.dart';

Highlights:

Classes

ActionButton
A flexible, theme-aware button with an icon, a label, or both.
ActionSwitch
A compact on/off control with a label and optional description, styled to match AppTheme.
AnsiSegment
A run of text that shares one style, produced by parseAnsiSegments.
AnsiStyle
The text style set by ANSI codes at one point in the input.
AppTheme
The package's warm, muted light and dark themes, plus helpers for picking theme colours.
CheckerPainter
Paints a grey-and-white checkerboard, the usual background for showing transparency.
Blue, underlined text that opens link when tapped.
CollectIcons
Icons for table and text editing, drawn from the CollectIcons icon font.
Colour
An RGB colour with 8-bit channels that can be used anywhere a Flutter Color is expected.
ColourIndicator
A circle filled with the current colour, over a checkerboard so transparency shows.
ColourPicker
A full colour picker: a palette area, sliders, a preview and colour labels, laid out side by side or stacked depending on the screen.
ColourPickerArea
The two-dimensional palette in a ColourPicker. Dragging or tapping in it picks two colour properties at once.
ColourPickerHueRing
A ring of every hue. Dragging around it changes the hue.
ColourPickerInput
A hex text field for typing an exact colour.
ColourPickerLabel
Shows the colour's values as text, in each format in colorLabelTypes (for example its red, green and blue values).
ColourPickerSlider
A slider for one colour property, drawn over a gradient of that property.
Colours
Named Colour constants based on the Material Design palette.
ColourSpace
The shared base of Colour, HSVColour and HSLColour, so any of them can be converted to the others.
Fifth
Placeholder page for the fifth tab of demoContent.
FilteredMenu<T>
A searchable dropdown: a text field that filters a list of options as the user types.
First
Placeholder page for the first tab of demoContent.
Fourth
Placeholder page for the fourth tab of demoContent.
HoverWidget
Rebuilds its child whenever the mouse enters or leaves it.
HoverWidgetState
State for HoverWidget. Tracks whether the mouse is over the widget.
HSLColour
A colour described by hue, saturation and lightness, usable anywhere a Flutter HSLColor is expected.
HSLWithHueColourPainter
Paints every HSL saturation (across) and lightness (down) for the hue of hslColor.
HSLWithLightnessColourPainter
Paints every hue (across) and HSL saturation (down) at the lightness of hslColor.
HSLWithSaturationColourPainter
Paints every hue (across) and lightness (down) at the HSL saturation of hslColor.
HSVColour
A colour described by hue, saturation and value (brightness), usable anywhere a Flutter HSVColor is expected.
HSVWithHueColourPainter
Paints every saturation (across) and value (down) for the hue of hsvColor.
HSVWithSaturationColourPainter
Paints every hue (across) and value (down) at the saturation of hsvColor.
HSVWithValueColourPainter
Paints every hue (across) and saturation (down) at the value of hsvColor.
HUEColorWheelPainter
Paints a colour wheel (hue around the circle, saturation from the centre out) at the value of hsvColor.
HueRingPainter
Paints the hue ring and its thumb for ColourPickerHueRing.
HueRingPicker
A compact colour picker with a hue ring around a saturation-and-brightness square.
IconMenu<T>
A small button showing the selected icon, which opens a column of other icons to choose from.
IconMenuItem<T>
One option in an IconMenu.
Idols
Text-formatting icons from the bundled Idols icon font, plus ready-made widgets that show them with a colour bar underneath.
IndicatorPainter
Paints a colour over a checkerboard, so transparent colours are visible. Used by ColourIndicator.
InsetBoxShadow
A shadow drawn inside a shape instead of outside it.
InsetShadowShapeDecoration
A ShapeDecoration that can also draw inner shadows.
ListBuilder
An editable list of strings that users can add to, remove from and reorder by dragging.
A dropdown arrow button that opens a list of items.
One option in a SimpleMenu or FilteredMenu.
NotificationData
One notification shown by NotificationManager.
NotificationManager
Shows toast notifications stacked in the top-right corner of the app.
NotificationOverlay
Draws the stack of notifications for NotificationManager.
NotificationOverlayState
State for NotificationOverlay. Runs the slide-in and fade-out animation for each notification.
RGBWithBlueColourPainter
Paints every combination of red and green at the blue level of color.
RGBWithGreenColourPainter
Paints every combination of red and blue at the green level of color.
RGBWithRedColourPainter
Paints every combination of green and blue at the red level of color.
RoundedCheckBox
A round checkbox with an optional text label beside it.
RoundedCheckBoxState
State for RoundedCheckBox.
ScrollContainer
A horizontally scrolling row that also scrolls with a normal vertical mouse wheel.
Second
Placeholder page for the second tab of demoContent.
SelectableGrid<GridItemType>
A grid of items that can be browsed with the arrow keys and picked with Enter or a tap.
A VS Code-style sidebar: a bar of icon buttons with a resizable panel that slides open next to it.
SidebarItem
A button in a Sidebar's icon bar, optionally with a panel of content.
SimpleMenu<T>
A basic dropdown: a box showing the selected option, which opens a list of options when tapped.
SizeConfig
Stores the current screen size so IntWidgets.dynamicHeight and IntWidgets.dynamicWidth can scale values to it.
SlidePicker
A colour picker made only of sliders, one per channel of colorModel, with an optional preview bar.
StyledBox
Paints a Decoration behind or in front of its child.
SuggestionField
A text field with a dropdown of suggested values beside it.
SurfaceContainer
A rounded, bordered panel coloured to match the current theme.
SystemFonts
Finds the .ttf and .otf fonts installed on the computer.
TabView
A set of pages with a row or column of tabs to switch between them.
TabViewContent
The list of tabs shown by a TabView, in order.
TabViewItem
One tab in a TabView: its label and the page it shows.
Third
Placeholder page for the third tab of demoContent.
ThumbPainter
Paints the round, shadowed thumb of a ColourPickerSlider.
TrackPainter
Paints the gradient track behind a ColourPickerSlider.
UpperCaseTextFormatter
A text field formatter that turns everything typed into capitals.
Word
The package's text widget: a Text that picks its style from the theme and accepts every TextStyle option directly.

Enums

ActionIconPosition
Where an ActionButton's icon goes relative to its label.
ActionSwitchLabelPosition
Which side of the control a label goes on.
ActionSwitchStyle
How an ActionSwitch draws its on/off control.
AlignType
How a dropdown list lines up with the field it belongs to.
ColorLabelType
A text format for showing a colour's value in a ColourPickerLabel.
ColorModel
The set of sliders a SlidePicker shows.
InputPosition
Where ListBuilder places its text field.
NotificationType
The kind of notification.
PaletteType
Which colour properties a ColourPicker palette area and its main slider control.
Side
A side of a rectangle, used to place things such as TabView's tabs.
SidebarPosition
Which edge of the screen a Sidebar is attached to.
TrackType
Which colour property a ColourPickerSlider controls.
Variant
The text styles Word can use, each based on a style from the app's TextTheme.

Extensions

AnsiTextStyle on AnsiStyle
Converts an AnsiStyle into a Flutter TextStyle.
ColourExtension on Color
Converts Flutter Colors to Colour and exposes their channels as 0–255 integers.
DoubleWidgets on double?
Layout helpers on nullable double.
Hslcolour on HSLColor
Converts Flutter's HSLColor to HSLColour.
Hsvcolour on HSVColor
Converts Flutter's HSVColor to HSVColour.
IntWidgets on int?
Layout shortcuts on nullable int for spacing, sizing and rounded corners.
NotificationExtension on BuildContext
Shortcuts for showing toast notifications from any BuildContext.
SystemFontsLoader on SystemFonts
Loads fonts found by SystemFonts into Flutter so they can be used in a TextStyle.
WidgetExtension on Widget?
Chainable shortcuts for wrapping a widget in common layout widgets.

Constants

ansiPalette → const List<int>
The 16 standard terminal colours as ARGB integers, matching VS Code's terminal.
APPLE_COLOUR_EMOJI → const String
Apple Color Emoji, the colour emoji font used on macOS and iOS.
CRIMSON_PRO → const String
Crimson Pro, a refined serif suited to body text and long reading.
demoContent → const TabViewContent
Five placeholder tabs for trying out TabView before you have real content.
DM_SANS → const String
DM Sans, a clean geometric sans-serif designed for small sizes.
IBM_PLEX_SANS → const String
IBM Plex Sans, a neutral and highly readable sans-serif.
INTER → const String
Inter, a versatile sans-serif built for screens.
JETBRAINS_MONO → const String
JetBrains Mono, a monospaced font designed for code.
KATEX → const String
The KaTeX font family prefix, used for mathematical typesetting.
kCompleteValidHexPattern → const String
Matches a complete hex colour: an optional # followed by exactly 3, 6 or 8 hex digits (RGB, RRGGBB or AARRGGBB).
kValidHexPattern → const String
Matches the start of a hex colour while it's being typed: an optional # followed by one to eight hex digits.
LATO → const String
Lato, a warm sans-serif that works at both body and display sizes.
LORA → const String
Lora, an elegant serif with calligraphic roots, good for editorial text.
MONTAGU_SLAB → const String
Montagu Slab, a sturdy contemporary slab-serif.
MONTSERRAT → const String
Montserrat, a bold geometric sans-serif.
OUTFIT → const String
Outfit, a friendly geometric sans-serif.
ROBOTO → const String
Roboto, Google's typeface and the Android default.
SOURCE_CODE_PRO → const String
Source Code Pro, Adobe's monospaced font for code.
TIMES_NEW_ROMAN → const String
Times New Roman, a classic serif.
WORK_SANS → const String
Work Sans, a sans-serif tuned for on-screen body text.
x11Colours → const Map<String, Color>
The standard named web colours, such as aliceblue and tomato, keyed by lower-case name without spaces.

Functions

colorFromHex(String inputString, {bool enableAlpha = true}) → Color?
Parses a hex string such as #F80, FF8800 or #80FF8800 into a Color.
colorFromName(String val) → Color?
Looks up a named web colour, such as 'Light Sea Green'.
colorToHex(Color color, {bool includeHashSign = false, bool enableAlpha = true, bool toUpperCase = true}) → String
Formats color as a hex string.
hslToHsv(HSLColor color) → HSVColour
Converts an HSL (hue, saturation, lightness) colour to HSV (hue, saturation, value).
hsvToHsl(HSVColor color) → HSLColour
Converts an HSV (hue, saturation, value) colour to HSL (hue, saturation, lightness).
parseAnsi(String input) → List<TextSpan>
Converts input into a list of TextSpans with the colours and styles its ANSI codes describe.
parseAnsiSegments(String input) → List<AnsiSegment>
Splits input into runs of text that share the same ANSI style.
stripAnsi(String input) → String
Removes every ANSI escape code from input, leaving plain text.
useWhiteForeground(Color backgroundColor, {double bias = 0.0}) → bool
Whether white text is easier to read than black text on backgroundColor.

Typedefs

AnimationBuilder = Widget Function(BuildContext context, Animation<double> animation, Widget child)
Builds an animated version of child, driven by animation running from 0.0 to 1.0.
BoolWidgetBuilder = Widget Function(BuildContext context, bool isHovering)
Builds a widget that depends on whether the mouse is over it.
Font = String
A font family name, such as 'Inter'.
ListItemBuilder = Widget Function(BuildContext context, String item, int index, VoidCallback remove)
Builds one row of a ListBuilder.custom list.
SelectableGridItemBuilder<T> = Widget Function(BuildContext context, T item, bool isActive, VoidCallback onTap)
Builds one cell of a SelectableGrid.