sd_utils 1.0.1
sd_utils: ^1.0.1 copied to clipboard
A Flutter package providing customizable chip UI components and utility formatters (date, amount, nullable handling)
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.