swiss_army_component library

Classes

AlwaysDisabledFocusNode
Helper class to disable keyboard focus
AppBarSecurityConfig
AppChipTheme
AppColors
AppDropdown<T>
AppElevatedButton
A secure elevated button with debouncing, loading states, and accessibility.
AppGradientButton
Gradient button with debouncing and security features.
AppIconButton
Icon button with debouncing and security features.
AppMultiLineTextField
Multiline text field for longer text input
AppOutlinedButton
Outlined button with debouncing and security features.
AppPasswordField
Convenience wrapper for password text field
AppPhoneTextField
App Phone Text Field with international phone input
AppRoundedTextField
Rounded/pill shaped text field for search and modern UIs
AppSecondaryElevatedButton
Secondary elevated button with debouncing and security features.
AppText
A highly customizable text widget with extensive configuration options.
AppTextButton
Text button with debouncing and security features.
AppTextField
A highly customizable text form field with extensive configuration options.
AppTheme
Legacy aliases for backward compatibility
BigAppText
Convenience widget for large/big text
BioField
Bio/message text field - backwards compatibility wrapper
BrandNameText
A text widget for brand names with customizable styling.
ButtonSecurityConfig
CityDropdown
ConfigElevatedButton
Configurable elevated button with debouncing and security features.
ConfigOutlinedButton
Configurable outlined button with debouncing and security features.
CountryDropdown
A dropdown to select a Country.
CustomAppBar
A secure, customizable AppBar with input validation and safe callbacks.
CustomSearchBar
A highly customizable search bar widget with extensive configuration options.
CustomSliverAppBar
A secure sliver version of CustomAppBar for use in CustomScrollView.
ExpandableSearchBar
A search bar that expands from an icon when tapped.
ExpandableText
A text widget that automatically truncates with "Read More" functionality.
FilterableSearchBar
A search bar with filter chips for category/tag filtering.
FormValidator
HighlightedText
A rich text widget with highlighted portions.
ImportantAppText
A text widget with a required field indicator (asterisk).
MedAppText
Convenience widget for medium text
NormalAppTextFormField
Simple text field without label - backwards compatibility wrapper
NormalElevatedButton
A simple elevated button with debouncing and security features.
OTPAttemptTracker
Rate limiter for OTP verification attempts.
OTPSecurityConfig
Security configuration for OTP/PIN input fields.
OTPTextField
OTPVerificationWidget
A complete OTP verification widget with resend timer and visual feedback.
PriceText
A customizable price/currency text widget with formatting.
ProductTitleText
A text widget for product titles with customizable styling.
SACTheme
Swiss Army Component Theme Factory
SACThemeBase
Base class to create your own themed variants while reusing SACTheme builders.
SACThemeConfig
Configuration class for customizing Swiss Army Component theme colors.
SACThemeExtension
Theme extension for Swiss Army Component specific properties
SearchAppBar
Secure SearchAppBar with input validation and safe callbacks.
SearchBarSecurityConfig
Security configuration for SearchBar widgets.
SearchRateLimiter
Rate limiter for search queries to prevent abuse.
SlashedPriceText
A text widget with strikethrough for showing original/discounted prices.
SmallAppText
Convenience widget for small text
SocialButton
A highly customizable button for social login interactions.
StateDropdown
TabbedAppBar
Secure TabbedAppBar with input validation and safe callbacks.
TextFieldSecurityConfig
Security configuration for TextField widgets.
TextSecurityConfig
Security configuration for Text widgets.
TransparentAppBar
A simple transparent AppBar for overlaying content.

Enums

AppTextDecoration
Text decoration style variants
AppTextStyle
Text style preset variants
BrandNameSize
Size presets for brand name text
Currency
Supported currency types for price formatting
CurrencyPosition
Currency position relative to the amount
IndicatorPosition
Position of the required indicator
LabelPosition
TextField label position
OTPAnimationType
Animation types for OTP input
OTPStyle
A highly customizable OTP/PIN input field with extensive configuration options.
ProductTitleSize
Size presets for product title text
SearchBarAnimationType
SearchBar animation types
SearchBarStyle
SearchBar style variants
SocialButtonStyle
Visual style for the social button.
SocialProvider
Supported social login providers.
TextFieldStyle
TextField style variants

Extensions

InputSanitizer on String
Extension for sanitizing user input
OTPValidation on String
Extension for easy OTP validation on String
SACThemeContext on BuildContext
SecureAppBarCallbackExtension on VoidCallback?
Extension to add security features to AppBar callbacks.
SecureCallbackExtension on VoidCallback?
Extension to add security features to VoidCallback.
SecureValueChangedExtension on ValueChanged<T>?
Extension for ValueChanged with safety.

Functions

appLog(dynamic data, [dynamic data2]) → void
hSpace(double width) Widget
safeAppBarCallback(VoidCallback? callback, {String? context}) → void
Safe callback execution for AppBar callbacks.
safeExecute(VoidCallback? callback, {String? context}) → void
safeExecuteAsync(Future<void> callback()?, {String? context}) Future<void>
safeOTPCallback(void callback(String)?, String value, {String context = 'OTP callback'}) → void
Safely executes an OTP callback with error handling.
safeOTPVoidCallback(VoidCallback? callback, {String context = 'OTP void callback'}) → void
Safely executes a void callback with error handling.
safeSearchCallback(void callback(String)?, String value, {String context = 'Search callback'}) → void
Safely executes a search callback with error handling.
safeSearchVoidCallback(VoidCallback? callback, {String context = 'Search void callback'}) → void
Safely executes a void callback with error handling.
safeTextCallback(VoidCallback? callback, {String context = 'Text callback'}) → void
Safely executes a text tap callback with error handling.
safeTextFieldCallback(void callback(String)?, String value, {String context = 'TextField callback'}) → void
Safely executes a text field callback with error handling.
safeTextFieldVoidCallback(VoidCallback? callback, {String context = 'TextField void callback'}) → void
Safely executes a void callback with error handling.
safeValueChanged<T>(ValueChanged<T>? callback, T value, {String? context}) → void
Safe value changed callback execution.
sanitizeButtonText(String? text, {int maxLength = 500, bool? enableSecurity}) String
Sanitize text input to prevent potential issues.
sanitizeHintText(String? text, {String defaultHint = 'Search...', bool? enableSecurity}) String
Sanitize hint text for search bars. Pass enableSecurity to override global setting, or leave null to use global.
sanitizeTitleText(String? text, {bool? enableSecurity}) String
Sanitize title text to prevent overflow and potential issues. Pass enableSecurity to override global setting, or leave null to use global.
simPad(double v, double h) EdgeInsetsGeometry
validateActions<T>(List<T>? actions, {bool? enableSecurity}) List<T>?
Validate actions list is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateAppBarElevation(double? value, {required double defaultValue, bool? enableSecurity}) double
Validate elevation is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateAppBarHeight(double? value, {required double defaultValue, bool? enableSecurity}) double
Validate AppBar height is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateBorderRadius(double? value, {double? defaultValue, bool? enableSecurity}) double?
validateContentPadding(double? padding, {double? defaultValue, bool? enableSecurity}) double?
Validates content padding within configured bounds.
validateDebounceDuration(int? duration, {int defaultValue = 300, bool? enableSecurity}) int
Validates debounce duration within configured bounds.
validateDecorationThickness(double? thickness, {double? defaultValue, bool? enableSecurity}) double?
Validates decoration thickness within configured bounds.
validateElevation(double? value, {double? defaultValue, bool? enableSecurity}) double?
validateFontSize(double? value, {double? defaultValue, bool? enableSecurity}) double?
validateGradientColors(List<Color>? colors, {bool? enableSecurity}) List<Color>?
Validate gradient colors list. Pass enableSecurity to override global setting, or leave null to use global.
validateIconSize(double? value, {required double defaultValue, bool? enableSecurity}) double
Validate icon size is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateInputLength(int? length, {int? defaultValue, bool? enableSecurity}) int
Validates input length.
validateLabelSpacing(double? spacing, {double? defaultValue, bool? enableSecurity}) double?
Validates label spacing within configured bounds.
validateLetterSpacing(double? spacing, {double? defaultValue, bool? enableSecurity}) double?
Validates letter spacing within configured bounds.
validateLineHeight(double? height, {double? defaultValue, bool? enableSecurity}) double?
Validates line height within configured bounds.
validateMaxLines(int? maxLines, {int? defaultValue, bool? enableSecurity}) int
Validates max lines within configured bounds.
validateOTPBorderRadius(double? radius, {required double defaultValue, bool? enableSecurity}) double
Validates border radius within configured bounds.
validateOTPBorderWidth(double? width, {double defaultValue = 1.5, bool? enableSecurity}) double
Validates border width within configured bounds.
validateOTPFontSize(double? fontSize, {required double defaultValue, bool? enableSecurity}) double
Validates font size within configured bounds.
validateOTPLength(int? length, {int defaultValue = 6, bool? enableSecurity}) int
Validates OTP length within configured bounds. Returns the validated length.
validateOTPSpacing(double? spacing, {required double defaultValue, bool? enableSecurity}) double
Validates spacing between pins.
validatePinSize(double? size, {required double defaultValue, bool? enableSecurity}) double
Validates pin box size within configured bounds.
validateSearchBarBorderRadius(double? radius, {required double defaultValue, bool? enableSecurity}) double
Validates border radius within configured bounds.
validateSearchBarFontSize(double? fontSize, {required double defaultValue, bool? enableSecurity}) double
Validates font size within configured bounds.
validateSearchBarHeight(double? height, {required double defaultValue, bool? enableSecurity}) double
Validates search bar height within configured bounds.
validateSearchBarIconSize(double? size, {required double defaultValue, bool? enableSecurity}) double
Validates icon size within configured bounds.
validateSearchBarPadding(double? padding, {required double defaultValue, bool? enableSecurity}) double
Validates padding within configured bounds.
validateSearchQuery(String? query, {bool? enableSecurity}) String
Validates and sanitizes search query. Returns the validated query string.
validateSize(double? value, {double? defaultValue, double? min, double? max, bool? enableSecurity}) double?
validateSystemOverlayStyle(SystemUiOverlayStyle? style) SystemUiOverlayStyle?
Validate system overlay style for security.
validateTabs<T>(List<T> tabs, {bool? enableSecurity}) List<T>
Validate tabs list is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateTextContent(String? text, {bool? enableSecurity}) String
Validates and sanitizes text content. Returns the validated text string.
validateTextFieldBorderRadius(double? radius, {double? defaultValue, bool? enableSecurity}) double?
Validates border radius within configured bounds.
validateTextFieldBorderWidth(double? width, {double? defaultValue, bool? enableSecurity}) double?
Validates border width within configured bounds.
validateTextFieldFontSize(double? fontSize, {double? defaultValue, bool? enableSecurity}) double?
Validates font size within configured bounds.
validateTextFieldHeight(double? height, {double? defaultValue, bool? enableSecurity}) double
Validates height within configured bounds.
validateTextFieldIconSize(double? size, {double? defaultValue, bool? enableSecurity}) double?
Validates icon size within configured bounds.
validateTextFieldMaxLines(int? maxLines, {int defaultValue = 1, bool? enableSecurity}) int
Validates max lines within configured bounds.
validateTextFieldMinLines(int? minLines, {int defaultValue = 1, bool? enableSecurity}) int
Validates min lines within configured bounds.
validateTextFontSize(double? fontSize, {double? defaultValue, bool? enableSecurity}) double?
Validates font size within configured bounds.
validateTextScaleFactor(double? scaleFactor, {double? defaultValue, bool? enableSecurity}) double?
Validates text scale factor within configured bounds.
validateTextShadows(List<Shadow>? shadows, {bool? enableSecurity}) List<Shadow>?
Validates and limits shadow list.
validateTitleFontSize(double? value, {required double defaultValue, bool? enableSecurity}) double
Validate title font size is within bounds. Pass enableSecurity to override global setting, or leave null to use global.
validateWordSpacing(double? spacing, {double? defaultValue, bool? enableSecurity}) double?
Validates word spacing within configured bounds.
vSpace(double height) Widget