chain_ui 0.0.1
chain_ui: ^0.0.1 copied to clipboard
Lightweight Flutter extensions for adaptive layouts, animations, accessibility, and gesture handling with clean, chainable APIs.
Chain UI #
Lightweight Flutter extensions for adaptive layouts, animations, accessibility, and gesture handling with clean, chainable APIs.
Features #
Chain UI provides a set of extensions that make Flutter UI code more readable and maintainable:
- Spacing Extensions: Create SizedBox widgets with a clean, chainable API
- Padding Extensions: Add padding to widgets with a clean, chainable API
- Visibility Extensions: Control widget visibility with a clean, chainable API
Getting Started #
Add Chain UI to your pubspec.yaml
:
dependencies:
chain_ui:
git:
url: https://github.com/vijaykarthiktk/chain_ui.git
Import the package:
import 'package:chain_ui/chain_ui.dart';
Usage #
Spacing Extensions #
// Create vertical spacing
16.height
// Create horizontal spacing
24.width
Padding Extensions #
// Add padding on all sides
Text("Hello").paddingAll(16)
// Add symmetric padding
Text("Hello").paddingSymmetric(horizontal: 16, vertical: 8)
// Add padding only on specific sides
Text("Hello").paddingOnly(left: 16, top: 8)
// Direction-specific padding
Text("Hello").paddingTop(16)
Text("Hello").paddingRight(16)
Text("Hello").paddingBottom(16)
Text("Hello").paddingLeft(16)
// Axis-specific padding
Text("Hello").paddingVertical(16)
Text("Hello").paddingHorizontal(16)
Visibility Extensions #
// Show or hide a widget based on a condition
Text("Hello").visible(isVisible)
// Show error message only when there's an error
Text("Error: Something went wrong").visible(hasError)
// Show loading indicator only when loading
CircularProgressIndicator().visible(isLoading)
Example #
Check out the example directory for a complete example app that demonstrates all the features of Chain UI.