🚀 flutter_ex_kit
The Ultimate Flutter Productivity & Extension Suite
Write cleaner, faster, and more readable Flutter code with zero boilerplate.
An expressive, lightweight extension toolkit covering BuildContext, Widgets, Spacing, Navigation, Strings, Dates, and Responsive UI.
🌐 Quick Navigation & Links
🌐 Main Website • 📖 Full Documentation • 📦 pub.dev Package • 💡 Report Issue • 💖 Sponsor
Tip
📖 In-Depth Official Documentation
Comprehensive API references, interactive examples, and tutorials are available at:
👉 https://docs.puneetdev.in/flutter/dependencies/flutter_ex_kit
(Detailed method guides, copy-paste snippets, and advanced recipes are continuously updated there).
⚡ Why flutter_ex_kit?
Flutter UI code often suffers from deeply nested widget trees, redundant constructors, and repetitive syntax. flutter_ex_kit transforms verbose code into fluent, readable one-liners:
| Traditional Flutter Verbosity | With flutter_ex_kit Clean Syntax |
|---|---|
SizedBox(height: 16) |
16.height |
Padding(padding: EdgeInsets.all(12), child: widget) |
widget.all(12) |
MediaQuery.of(context).size.width |
context.width |
Theme.of(context).brightness == Brightness.dark |
context.isDarkMode |
Navigator.of(context).push(MaterialPageRoute(...)) |
context.push(MyScreen()) |
Color(int.parse("FF4A90E2", radix: 16)) |
'#4A90E2'.toColor() |
Future.delayed(Duration(seconds: 2)) |
await 2.delay() |
date.difference(DateTime.now()).inDays... |
date.timeAgo |
items.firstWhere((e) => ..., orElse: () => null) |
items.firstWhereOrNull((e) => ...) |
✨ Features at a Glance
|
📱 BuildContext Extensions Immediate access to context.width, context.height, context.theme, context.isDarkMode, context.push(), context.pop(), and snackbars.
|
📏 Spacing & Number Helpers Generate sized boxes on the fly with 16.height and 24.width. English ordinals (22.ordinal) and Roman numerals (12.roman).
|
|
🎨 Widget Layout & Modifiers Fluent inline chaining: .all(), .symmetric(), .expanded(), .flexible(), .onTap(), .safeArea(), and .center().
|
🔤 String & Color Utilities Fluent text styling ( 'Hello'.style(...)), hex color parser ('#4A90E2'.toColor()), and casing transforms (capitalize()).
|
|
⏱️ Duration & Async Delays Readable time durations: 5.seconds, 300.milliseconds, 2.minutes, and async sleep via await 2.delay().
|
📅 DateTime & Relative Time Social-media style relative time ( date.timeAgo), day status checks (isToday, isYesterday), and formatted dates.
|
|
📦 Collections & Iterables Null-safe search ( firstWhereOrNull), indexed mapping (mapIndexed, forEachIndexed), and isNullOrEmpty checks.
|
🔒 Input Validation & Animations Stateless SingleSpaceFormatter for text fields, regex validators, FadeInAnimation, and double-tap exit helpers.
|
📦 Getting Started
1. Add Dependency
Add flutter_ex_kit to your pubspec.yaml:
flutter pub add flutter_ex_kit
Or declare it manually:
dependencies:
flutter_ex_kit: ^0.0.8
2. Import Package
Import everything with a single line:
import 'package:flutter_ex_kit/flutter_ex_kit.dart';
3. Quick Code Preview
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
16.height, // Quick SizedBox spacing
'Welcome to flutter_ex_kit'.style(
size: 20,
bold: true,
color: '#1E88E5'.toColor(),
),
8.height,
ElevatedButton(
onPressed: () => context.push(const DetailScreen()),
child: const Text('Go to Details'),
).expanded(), // Quick layout modifier
],
).all(16), // Quick padding modifier
);
}
}
📚 Official In-Depth Documentation
Need detailed API references, advanced recipes, and full tutorials? Everything is thoroughly documented on the official documentation portal:
👨💻 Author & Connect
Crafted with ❤️ by Puneet Sharma
- 🌐 Personal Website: puneetdev.in
- 📖 Documentation Hub: docs.puneetdev.in
- 🐙 GitHub: @iamapuneet
- 💖 Support / Sponsor: Sponsor on GitHub
📄 License
This package is licensed under the MIT License.