sd_utils
sd_utils is a Flutter package that combines reusable chip UI components with utility formatters, extensions, and text input formatters in one scalable SDK-style library.
Features
- Animated chip UI system built on
BaseChip - 10+ chip variants for selection, filtering, avatars, gradients, outlines, and toggles
- Theme-aware styling with
ChipStyleandSdChipThemeData - Date and amount formatters with null-safe fallbacks
- Extensions for nullable strings, numbers, and dates
- Input formatters for amount and date text fields
- Interactive example app for UI and formatter workflows
Installation
dependencies:
sd_utils: ^1.0.0
Usage
Chip Usage
import 'package:flutter/material.dart';
import 'package:sd_utils/sd_utils.dart';
Wrap(
spacing: 12,
runSpacing: 12,
children: const [
BasicChip(label: 'Default'),
SelectableChip(
label: 'Verified',
icon: Icons.verified_rounded,
initialSelected: true,
),
GradientChip(label: 'Premium'),
OutlinedChip(label: 'Invite only'),
],
);
Date Formatting
final apiDate = DateFormatter.fromApi('2026-04-20T10:15:30Z');
final readable = DateTime(2026, 4, 20).toFormatted(pattern: 'dd MMM, yyyy');
Currency Formatting
final total = AmountFormatter.format(1250000);
final compact = AmountFormatter.formatCompact(1250000);
final viaExtension = 1250000.toCurrency();
Nullable Text Handling
final username = nullableName.orDash();
final title = 'sd utils package'.toTitleCase();
Screenshots
Recommended screenshot slots for pub.flutter-io.cn and GitHub:
docs/screenshots/chips-demo.pngdocs/screenshots/formatters-demo.png
See the live demo source in example/lib/main.dart.
Contributing
- Fork the repository.
- Create a feature branch.
- Run
dart format .,flutter analyze, andflutter test. - Open a pull request with a clear summary and screenshots for UI changes.
License
MIT License. See LICENSE.
Libraries
- core/chip_style
- core/chip_theme
- core/core
- extensions/date_extensions
- extensions/extensions
- extensions/num_extensions
- extensions/string_extensions
- formatters/amount_formatter
- formatters/amount_input_formatter
- formatters/date_formatter
- formatters/date_input_formatter
- formatters/formatters
- formatters/input_formatters
- models/chip_data
- models/chip_style
- models/models
- Models for the Chip widget library. This file exports all model classes for easy importing.
- sd_utils
- utils/animations
- utils/chip_constants
- utils/chip_extensions
- utils/utils
- Utility files for the Chip widget library. This file exports all utility classes and extensions for easy importing.
- widgets/avatar_chip
- widgets/base_chip
- widgets/base_chip_widget
- widgets/basic_chip
- widgets/choice_chip
- widgets/disabled_chip
- widgets/filter_chip
- widgets/gradient_chip
- widgets/icon_chip
- widgets/input_chip
- widgets/multi_select_chip
- widgets/outlined_chip
- widgets/selectable_chip
- widgets/toggle_chip
- widgets/widgets
- Widgets for the Chip widget library. This file exports all chip widget classes for easy importing.