auto_suggest_box 0.1.2 copy "auto_suggest_box: ^0.1.2" to clipboard
auto_suggest_box: ^0.1.2 copied to clipboard

A highly customizable, performance-optimized auto-suggest/autocomplete widget for Flutter with Fluent UI design. Features debounced search, LRU caching, keyboard navigation, form validation, advanced [...]

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

0.1.0 - 2024-12-23 #

Added #

Core Widget - FluentAutoSuggestBox

  • FluentAutoSuggestBox<T> - Main autocomplete widget with generic type support
  • FluentAutoSuggestBox.form() - Form-enabled constructor with validation support
  • Debounced search with configurable delay (default: 300ms)
  • Minimum search length requirement to prevent unnecessary searches
  • Custom item builders for full control over suggestion rendering
  • Custom sorter function for controlling match logic
  • Loading and error state builders
  • Overlay direction control (above/below)
  • Clear button toggle
  • Keyboard type and input formatters support

State Management - AutoSuggestController

  • AutoSuggestController<T> - Centralized state management
  • Debounce timer management
  • Loading/error state tracking
  • Overlay visibility control
  • Recent searches history with configurable limit
  • Search metrics and statistics (success rate, total searches)
  • getStats() method for performance monitoring
  • Proper disposal and cleanup

Caching System - SearchResultsCache

  • SearchResultsCache<T> - LRU cache implementation
  • Time-To-Live (TTL) expiration for cached entries
  • Automatic LRU eviction when cache is full
  • Prefix matching for better cache hit rates
  • Cache statistics (hit rate, size, evictions)
  • CacheStats class for detailed metrics

Item Model - FluentAutoSuggestBoxItem

  • Generic type support for any data model
  • Label and custom child widget support
  • Subtitle widget for additional information
  • Selection state tracking
  • Focus change callbacks
  • Semantic labels for accessibility
  • Enabled/disabled state

Overlay System - AutoSuggestOverlay

  • Smooth overlay positioning with CompositedTransformFollower
  • Race condition prevention for async searches
  • Automatic scroll to selected item
  • Loading indicator during server search
  • Empty state with helpful message
  • Bidirectional display support

Keyboard Navigation

  • Arrow Up/Down for item selection
  • Enter to confirm selection
  • Escape to close overlay
  • Tab/Shift+Tab for focus navigation
  • Keyboard shortcuts for advanced search

Advanced Search Dialog

  • AdvancedSearchDialog<T> - Full-featured search dialog
  • AdvancedSearchDialog.show() - Single selection mode
  • AdvancedSearchDialog.showMultiSelect() - Multi-selection mode
  • Three view modes: List, Grid, Compact
  • Custom filter builder support
  • Search statistics display
  • Pagination support
  • Custom animations with configurable duration and curves
  • Keyboard shortcut trigger (default: F3)

Configuration Classes

  • AdvancedSearchConfig - Main dialog configuration
  • AdvancedSearchTheme - Visual theming (colors, spacing, radius)
  • AdvancedSearchIcons - Icon customization
  • AdvancedSearchLayout - Layout dimensions
  • AdvancedSearchAnimation - Animation settings

Common Utilities

  • FluentTextField - Fluent-styled text field wrapper
  • FluentTextFormField - Form field with validation support
  • ValidatorFormField - Custom form field with error display

Performance Optimizations

  • Reduced widget rebuilds (only when necessary)
  • Efficient memory usage with proper disposal
  • Smart caching with prefix matching
  • Debouncing to minimize API calls
  • Race condition prevention for async operations

Accessibility

  • Semantic labels throughout
  • Screen reader support
  • Proper focus management
  • ARIA-like attributes

BLoC/Cubit State Management

  • FluentAutoSuggestBoxCubit<T> - Cubit for managing FluentAutoSuggestBox state
  • FluentAutoSuggestBoxState<T> - State class with:
    • items - List of suggestion items
    • selectedItem - Currently selected item
    • text - Current input text
    • isLoading - Loading state
    • error - Error object
    • isEnabled / isReadOnly - Widget state
  • Item management methods: setItems, addItem, addItems, removeItem, clearItems
  • Selection methods: selectItem, selectByValue, selectByIndex, clearSelection
  • State methods: setLoading, setError, clearError, setEnabled, setReadOnly
  • Helper methods: reset, clear, search, getItemAt, getItemByValue

Dependencies #

  • fluent_ui: ^4.13.0 - Fluent UI design system
  • flutter_bloc: ^8.1.6 - BLoC state management
  • equatable: ^2.0.5 - Value equality for states
  • gap: ^3.0.1 - Spacing utilities

Future Releases #

0.2.0 Planned #

Planned Features

  • Pagination support for large datasets
  • RTL language improvements
  • Voice search support
  • Grouped suggestions
  • Inline suggestions (ghost text)
1
likes
0
points
340
downloads

Publisher

unverified uploader

Weekly Downloads

A highly customizable, performance-optimized auto-suggest/autocomplete widget for Flutter with Fluent UI design. Features debounced search, LRU caching, keyboard navigation, form validation, advanced search dialog, and BLoC/Cubit state management.

Repository (GitHub)
View/report issues

Topics

#autocomplete #autosuggest #search #fluent-ui #bloc

License

unknown (license)

Dependencies

equatable, fluent_ui, flutter, flutter_bloc, gap

More

Packages that depend on auto_suggest_box