recollect library

Collect — The Developer's Repertoire

A comprehensive Flutter toolkit providing reusable utilities, extensions, custom datatypes, and UI widgets for rapid application development.

Overview

Collect bundles commonly-used functionality into a single, well-organized package. It is structured into two main areas:

  • Core — Fundamental utilities, extensions, constants, helpers, and presentation widgets that extend Flutter's built-in capabilities.
  • Modules — Feature-specific, self-contained modules including a Colour system, a ColourPicker widget, and a searchable Menu.

Feature Highlights

Category Description
Extensions 100+ extension methods on int, double, String,
Widget, List, BuildContext, and more.
Datatypes Moment (rich DateTime wrapper) and Period
(duration with year/month support).
Colour Multi-format colour class supporting RGB, HSL, HSV,
Hex, and Base-256 representations.
ColourPicker Interactive colour picker with wheel, square, ring, and
slider picker styles.
Menu Searchable dropdown menu with filtering and custom items.
Theming Material 3 theme system (Sage & Terracotta palettes).
Fonts 16 bundled font families ready for use.
Notifications Toast-style notification system.
Radix Base conversion utilities (binary, octal, hex, base-256).

Quick Start

import 'package:recollect/recollect.dart';

// Use extension methods
final greeting = 'hello world'.toTitleCase(); // 'Hello World'
final binary = 42.toBinary();                 // '101010'

// Work with Moments
final now = Moment.now();
print(now.format('MMMM dd, yyyy'));           // 'February 19, 2026'

// Create colours in any format
final red = Colour.fromHex('#FF0000');
final blue = Colour.fromRGB(0, 0, 255);

Architecture

recollect/
├── core/
│   ├── constants/    — Static values, enums, and lookup tables
│   ├── datatypes/    — Moment and Period custom types
│   ├── extensions/   — Extension methods on built-in types
│   ├── helpers/      — Icon and font helper utilities
│   ├── presentation/ — Ready-to-use UI widgets
│   └── utils/        — Notifications, radix conversion, string processing
└── modules/
    ├── colour/        — Colour class and colour-space types
    ├── colour_picker/  — Interactive colour picker widgets
    └── menu/          — Searchable dropdown menu component

See also:

Classes

ActionButton
ActionIcon
AppTheme
CheckerPainter
Painter for chess type alpha background in slider track widget.
CollectIcons
Custom icon data bundled with the Collect package.
Colour
A rich colour class that implements Flutter's Color interface while adding multi-format input/output and colour space conversions.
ColourIndicator
Simple round color indicator.
ColourPicker
The default layout of Color Picker.
ColourPickerArea
Provide Rectangle & Circle 2 categories, 10 variations of palette widget.
ColourPickerHueRing
Provide Hue Ring with HSV Rectangle of palette widget.
ColourPickerInput
Provide hex input wiget for 3/6/8 digits.
ColourPickerLabel
Provide label for color information.
ColourPickerSlider
9 track types for slider picker widget.
Colours
A palette of pre-defined Colour constants, mirroring Flutter's Colors class but using the Collect Colour type.
ColourSpace
The sealed base class for all colour space representations in Collect.
Failure<T>
Fifth
Placeholder widget for the fifth demo tab. Displays "Fifth" centered.
FilteredMenu<T>
A searchable dropdown menu with keyboard navigation and text filtering.
First
Placeholder widget for the first demo tab. Displays "First" centered.
FolderMeta
Fourth
Placeholder widget for the fourth demo tab. Displays "Fourth" centered.
HoverWidget
A simple wrapper that tracks whether the mouse is hovering over its child and rebuilds via a BoolWidgetBuilder.
HoverWidgetState
HSLColour
A colour represented in the HSL (Hue, Saturation, Lightness) colour space.
HSLWithHueColourPainter
Painter for SL mixture.
HSLWithLightnessColourPainter
Painter for HS mixture.
HSLWithSaturationColourPainter
Painter for HL mixture.
HSVColour
A colour represented in the HSV (Hue, Saturation, Value) colour space.
HSVWithHueColourPainter
Painter for SV mixture.
HSVWithSaturationColourPainter
Painter for HV mixture.
HSVWithValueColourPainter
Painter for HS mixture.
HUEColorWheelPainter
Painter for hue color wheel.
HueRingPainter
Painter for hue ring.
HueRingPicker
The Color Picker with HUE Ring & HSV model.
IconMenu<T>
IconMenuItem<T>
Idols
IndicatorPainter
Painter for chess type alpha background in color indicator widget.
InsetBoxShadow
A BoxShadow variant that is rendered inside the shape by InsetShadowShapeDecoration.
InsetShadowShapeDecoration
A ShapeDecoration that supports inset (inner) shadows.
A single selectable entry in a SimpleMenu dropdown.
MetadataKeys
Centralized constants for metadata keys used in XTX nodes
Moment
A rich, human-friendly wrapper around date and time values.
NotificationData
Internal data model for a single notification.
NotificationManager
A singleton toast-notification system that renders animated overlay messages in the top-right corner of the screen.
NotificationOverlay
The overlay widget that renders the stacked notification cards.
NotificationOverlayState
Period
A duration of time that understands human-scale units — including years and months.
Radix
Converts integers between numeral bases — from binary (base-2) all the way up to base-256.
Result<T>
RGBWithBlueColourPainter
Painter for RG mixture.
RGBWithGreenColourPainter
Painter for RB mixture.
RGBWithRedColourPainter
Painter for GB mixture.
RoundedCheckBox
A circular, animated checkbox with an optional text label.
RoundedCheckBoxState
Second
Placeholder widget for the second demo tab. Displays "Second" centered.
SidebarItem
SimpleMenu<T>
SizeConfig
Captures the screen's dimensions and orientation from the current BuildContext so that responsive layout helpers (like Int.dynamicHeight and Int.dynamicWidth) can work.
SlidePicker
The Color Picker with sliders only. Support HSV, HSL and RGB color mod el.
Strings
A set of String utility functions that aim to extend the set of functions available the core String class as well as provding safe methods when working with nullable Strings. A Strings method will never thrown an NPE and aims to provide the expected result by treating the null as an empty String or a space filled String where a range access is applied.
StyledBox
A lightweight alternative to DecoratedBox that paints a Decoration on either the background or foreground of its child.
Success<T>
SuggestionField
A text input field with an attached dropdown menu for quick suggestions.
SystemFonts
Singleton that discovers, indexes, and dynamically loads system fonts at runtime.
TabView
A flexible tab view that supports tabs on any edge — top, bottom, left, or right.
TabViewContent
The data model for a TabView, holding the list of tabs and their associated page widgets.
TabViewItem
A single tab entry pairing a title with a view widget.
Third
Placeholder widget for the third demo tab. Displays "Third" centered.
ThumbPainter
Painter for thumb of slider.
TrackPainter
Painter for all kinds of track types.
UpperCaseTextFormatter
Uppercase text formater
Word

Enums

AlignType
Defines alignment and sizing options for dropdown menus.
Attributions
Bases
All supported numeral bases for radix conversion, from base-2 up to base-256.
ColorLabelType
Color information label type.
ColorModel
Types for slider picker widget.
CompressionType
NotificationType
The severity level of a notification, used to control auto-dismiss duration and (potentially) visual styling.
Pad
Control the padding on functions that allow the result to be padded.
PaletteType
Palette types for color picker area widget.
Side
Which edge of the TabView the tab strip should appear on.
SidebarPosition
TextAlignmentType
TrackType
Track types for slider picker.
Variant

Extensions

Ba on int
Quick base-conversion getters on non-nullable int.
c on Color
Convenience extension to convert any Flutter Color to a Colour.
Double on double?
Helpful extensions on nullable double values.
Hslcolour on HSLColor
Convenience extension to convert a Flutter HSLColor to an HSLColour.
Hsvcolour on HSVColor
Convenience extension to convert a Flutter HSVColor to an HSVColour.
Int on int?
A wide range of extensions on nullable int — from null-safe defaults and layout helpers to duration shortcuts and date utilities.
ListExtensions on Iterable<T>?
Extensions on nullable Iterable for safe access, indexed iteration, and aggregate calculations.
NotificationExtension on BuildContext
Convenience extension on BuildContext for showing toast-style notifications without wiring up a NotificationManager yourself.
Num on num?
Extensions on nullable num for validation, range checks, formatting, and mathematical helpers.
StringEx on String
Extensions on String for case conversion, validation, truncation, and general text manipulation.
WidgetExtension on Widget?
A big collection of layout and transform extensions on nullable Widget.

Constants

A → const String
AM/PM
a → const String
AM/PM (Lowercase)
alphaMask → const int
Combined bitmask matching any alphabetic character (upper or lower).
alphaNumMask → const int
Combined bitmask matching any alphanumeric character (letters or digits).
APPLE_COLOUR_EMOJI → const String
Apple Color Emoji — the system emoji font on macOS and iOS.
ascii → const List<int>
A lookup table mapping each ASCII code point (0-127) to its character category bitmask.
asciiEnd → const int
The code point of the last ASCII character (DEL, 0x7F).
asciiStart → const int
The code point of the first ASCII character (NUL, 0x00).
At → const String
at → const String
backSlash → const String
c0End → const int
The last code point in the C0 control character range (0x1F).
c0Start → const int
The first code point in the C0 control character range (0x00).
colon → const String
comma → const String
CRIMSON_PRO → const String
Crimson Pro — a refined serif typeface, great for body text and long reads.
D → const String
Day of Month
dash → const String
dateNumeric → const String
Date (Numeric)
DD → const String
Day of Month (Padded)
ddd → const String
Day of Week (Short)
dddd → const String
Day of Week (Full)
defaultFormatStyle → const List<String>
demoContent → const TabViewContent
A ready-made TabViewContent with five placeholder tabs.
digitMask → const int
Bitmask for digit characters (0-9).
DM_SANS → const String
DM Sans — a clean, geometric sans-serif designed for small text sizes.
Do → const String
Day of Month (Ordinal)
dot → const String
H → const String
Hour (24-Hour Clock)
h → const String
Hour (12-Hour Clock)
HH → const String
Hour (24-Hour Clock, Padded)
hh → const String
Hour (12-Hour Clock, Full)
IBM_PLEX_SANS → const String
IBM Plex Sans — IBM's corporate typeface; neutral and highly readable.
INTER → const String
Inter — a versatile sans-serif built specifically for screens.
JETBRAINS_MONO → const String
JetBrains Mono — a monospaced font designed for developers and code editors.
KATEX → const String
KaTeX — the font family used by KaTeX for mathematical typesetting.
kCompleteValidHexPattern → const String
Regex pattern that matches complete, valid hex colour strings (3, 6, or 8 hex chars, optional leading #).
kValidHexPattern → const String
Regex pattern that matches partial hex colour strings (1-8 hex chars, optional leading #).
LATO → const String
Lato — a warm, friendly sans-serif that works well in both body and display sizes.
LORA → const String
Lora — an elegant serif with roots in calligraphy, perfect for editorial use.
lowerMask → const int
Bitmask for lowercase ASCII letters (a-z).
M → const String
Month (Number)
m → const String
Minute
magicBytes → const List<int>
MM → const String
Month (Padded)
mm → const String
Minute (Long)
MMM → const String
Month (Short)
mmmm → const String
Month (Full)
Mo → const String
Month (Ordinal)
MONTAGU_SLAB → const String
Montagu Slab — a sturdy slab-serif with a contemporary feel.
monthNames → const Map<int, String>
MONTSERRAT → const String
Montserrat — inspired by Buenos Aires signage; bold and modern.
Of → const String
of → const String
OUTFIT → const String
Outfit — a geometric sans-serif with a friendly personality.
ROBOTO → const String
Roboto — Google's signature typeface; the default on Android.
s → const String
Second
semicolon → const String
slash → const String
SOURCE_CODE_PRO → const String
Source Code Pro — Adobe's monospaced font, designed for code readability.
space → const String
ss → const String
Second (Long)
T → const String
Time (12-Hour)
t → const String
Time (24-Hour)
The → const String
the → const String
TIMES_NEW_ROMAN → const String
Times New Roman — the classic serif workhorse, included as a system fallback.
underscoreMask → const int
Bitmask for the underscore character (_).
unicodeEnd → const int
The highest valid Unicode code point (U+10FFFF).
upperMask → const int
Bitmask for uppercase ASCII letters (A-Z).
weekDayNames → const Map<int, String>
WORK_SANS → const String
Work Sans — optimised for on-screen body text at medium sizes.
x11Colours → const Map<String, Color>
yy → const String
Year (Short)
yyyy → const String
Year (Full)

Functions

colorFromHex(String inputString, {bool enableAlpha = true}) Color?
Parses a hex colour string into a Flutter Color, or returns null if the string is invalid.
colorFromName(String val) Color?
colorToHex(Color color, {bool includeHashSign = false, bool enableAlpha = true, bool toUpperCase = true}) String
Converts a Flutter Color to a hex string.
hslToHsv(HSLColor color) HSVColour
Converts an HSLColor to an HSVColour.
hsvToHsl(HSVColor color) HSLColour
Converts an HSVColor to an HSLColour.
useWhiteForeground(Color backgroundColor, {double bias = 0.0}) bool
Returns true if white text should be used on the given backgroundColor for readability.

Typedefs

AnimationBuilder = Widget Function(BuildContext context, Animation<double> animation, Widget child)
Base = Bases
A convenient shorthand alias for Bases.
BoolWidgetBuilder = Widget Function(BuildContext context, bool isHovering)
A builder function that receives the current hover state.
Font = String
A type alias that makes font-family parameters self-documenting.