๐ Flutter Unify - The Ultimate Unified API
The "Bloc for Everything Else" - One unified API for auth, networking, storage, AI, and more across all platforms.
Features โข Quick Start โข Documentation โข Examples โข Contributing
Flutter Unify is not just another package - it's a complete development platform that provides a single, consistent API surface for all your cross-platform development needs. Think of it as Bloc for everything else - authentication, notifications, storage, networking, AI, and so much more.
๐ฏ Why Choose Flutter Unify?
| Feature | Flutter Unify | Firebase | Other Packages |
|---|---|---|---|
| Multi-Provider Support | โ Switch between providers easily | โ Locked to Firebase | โ ๏ธ Usually single provider |
| Unified API | โ One API for all platforms | โ ๏ธ Platform-specific code needed | โ ๏ธ Different APIs per platform |
| Reactive Streams | โ Everything is a stream | โ ๏ธ Limited streams | โ ๏ธ Varies by package |
| AI Integration | โ Built-in AI capabilities | โ Requires separate packages | โ Not available |
| Bundle Size | โ Tree-shaking, only include what you need | โ ๏ธ Large SDK | โ ๏ธ Varies |
| Zero Vendor Lock-in | โ Switch providers without code changes | โ Locked to Firebase | โ ๏ธ Usually locked |
| Developer Tools | โ Dev dashboard, CLI, debugging tools | โ ๏ธ Limited tools | โ ๏ธ Basic tools |
| Cross-Platform | โ iOS, Android, Web, Desktop | โ ๏ธ Mobile-focused | โ ๏ธ Usually platform-specific |
๐ Why Flutter Unify is Legendary
๐งฉ One API, All Platforms
// Authentication - works the same everywhere
await Unify.auth.signInWithGoogle();
await Unify.auth.signInWithApple();
await Unify.auth.signInWithBiometrics();
// Notifications - unified across all platforms
await Unify.notifications.show('Hello World!');
// System monitoring - reactive streams everywhere
Unify.system.onConnectivityChanged.listen((state) {
print('Network: ${state.description}');
});
๐ Everything is Reactive
Just like BlocBuilder for state management, everything in Flutter Unify is stream-based:
// Listen to auth state changes
StreamBuilder<AuthStateChangeEvent>(
stream: Unify.auth.onAuthStateChanged,
builder: (context, snapshot) {
if (snapshot.hasData && snapshot.data!.user != null) {
return DashboardScreen();
}
return LoginScreen();
},
);
// Monitor battery level
StreamBuilder<BatteryState>(
stream: Unify.system.onBatteryChanged,
builder: (context, snapshot) {
final battery = snapshot.data;
return Text('Battery: ${battery?.percentage ?? 0}%');
},
);
๐ Pluggable Architecture
Swap backends without changing a single line of your app code:
// Switch from Firebase to Supabase
Unify.registerAdapter('auth', SupabaseAuthAdapter());
// Use different storage backends
Unify.registerAdapter('storage', HiveStorageAdapter());
Unify.registerAdapter('storage', SqliteStorageAdapter());
// Custom implementations
Unify.registerAdapter('auth', MyCustomAuthAdapter());
๐๏ธ Legendary Developer Experience
Powerful CLI Tools:
# Create a new project with everything set up
dart run flutter_unify:cli create my_app --template=full
# Add features to existing project
dart run flutter_unify:cli add auth notifications storage
# Generate custom adapters
dart run flutter_unify:cli generate adapter --type=auth --name=MyAuthAdapter
# Validate your setup
dart run flutter_unify:cli doctor
# Run cross-platform tests
dart run flutter_unify:cli test --platforms=web,android,ios
๐ Features
๐ค AI Integration (NEW!)
Built-in AI capabilities with support for multiple providers:
// Initialize AI
await Unify.ai.initialize(
config: AIAdapterConfig(apiKey: 'your-key'),
provider: AIProvider.openai,
);
// Simple chat
final response = await Unify.ai.chat('Explain Flutter in one sentence');
// Advanced usage with streaming
await for (final chunk in Unify.ai.streamChat('Tell me a story')) {
print(chunk); // Real-time responses
}
// Multi-provider with automatic fallback
Unify.ai.addFallback(anthropicAdapter); // Falls back if OpenAI fails
Supported Providers:
- โ OpenAI (GPT-3.5, GPT-4, GPT-4 Vision)
- โ Anthropic Claude (Opus, Sonnet, Haiku)
- ๐ Google Gemini (Coming soon)
- ๐ Local LLMs (Coming soon)
๐น Web Enhancements
Smart Bundling & Compression
- Advanced tree-shaking & compression strategies (leveraging esbuild/rollup under the hood)
- Splits core Flutter engine from app logic โ only downloads once, cached separately
- Intelligent code splitting for optimal loading performance
SEO-friendly Rendering Layer
- Hybrid rendering: Canvas for UI but also exports semantic HTML "ghost DOM" for crawlers
- Works like a built-in version of seo_renderer, but official and maintained
- Automatic meta tag generation and structured data support
Progressive Loading (Lite Mode)
- Ships a lightweight HTML/JS "skeleton" that loads instantly on low-bandwidth
- Flutter app hydrates later for full functionality
- Think of it like Next.js SSR โ but for Flutter
Cross-browser Polyfills
- Provides stable wrappers for APIs (FileSystem, Bluetooth, WebRTC) with graceful fallbacks
- Consistent behavior across all modern browsers
๐น Desktop Enhancements
Unified System Menus & Tray API
- One API โ maps to macOS menu bar, Windows system tray, Linux DBus indicators
- Global shortcuts supported out of the box
- Context menus with native look and feel
Native Drag & Drop
- First-class drag-drop API (text, files, URLs) that works consistently across macOS/Win/Linux
- Custom drag indicators and drop zones
- Multi-selection support
Window & Multi-monitor Manager
- Advanced window snapping, tiling, multi-window support
- Auto-detects OS capabilities (Aero Snap on Windows, Mission Control on macOS)
- Per-monitor DPI awareness
System Services Bridge
- Clipboard, notifications, file dialogs, screen capture โ exposed via one stable API
- No need to import 5+ separate packages
- Native system integration without complexity
๐ฆ Installation
Add this to your package's pubspec.yaml file:
dependencies:
flutter_unify: ^0.1.0
Then run:
flutter pub get
๐ฏ Quick Start
Basic Setup
import 'package:flutter_unify/flutter_unify.dart';
void main() async {
// Initialize Flutter Unify
await Unify.initialize();
runApp(MyApp());
}
Cross-Platform System Operations
import 'package:flutter_unify/flutter_unify.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return UnifiedScaffold(
body: ElevatedButton(
onPressed: () async {
// Works on all platforms
await Unify.system.clipboardWriteText('Hello World!');
await Unify.system.showNotification(
title: 'Success',
body: 'Text copied to clipboard!',
);
},
child: Text('Copy to Clipboard'),
),
);
}
}
Platform-Specific Features
class PlatformSpecificFeatures extends StatefulWidget {
@override
_PlatformSpecificFeaturesState createState() => _PlatformSpecificFeaturesState();
}
class _PlatformSpecificFeaturesState extends State<PlatformSpecificFeatures> {
@override
void initState() {
super.initState();
_setupPlatformFeatures();
}
void _setupPlatformFeatures() async {
// Web-specific optimizations
if (PlatformDetector.isWeb) {
Unify.web.seo.setPageTitle('My Flutter App');
Unify.web.seo.setPageDescription('A unified Flutter experience');
await Unify.web.progressiveLoader.initialize();
}
// Desktop integration
if (PlatformDetector.isDesktop) {
await Unify.desktop.systemTray.create(
icon: 'assets/tray_icon.png',
tooltip: 'My Flutter App',
);
await Unify.desktop.shortcuts.register(
'Ctrl+Shift+A',
() => print('Global shortcut activated!'),
);
}
// Mobile features
if (PlatformDetector.isMobile) {
final deviceInfo = await Unify.mobile.deviceInfo.getDeviceInfo();
print('Running on: ${deviceInfo.model}');
}
}
@override
Widget build(BuildContext context) {
return UnifiedScaffold(
enableDragAndDrop: true,
onFilesDropped: (files) => print('Files dropped: ${files.length}'),
body: PlatformAdaptiveWidget(
mobile: Text('Mobile UI'),
web: Text('Web UI'),
desktop: Text('Desktop UI'),
fallback: Text('Universal UI'),
),
);
}
}
๐ Documentation
- ๐ Getting Started Guide
- ๐ค AI Integration Guide
- ๐ Web Optimizations Guide
- ๐ฅ๏ธ Desktop Integration Guide
- ๐ก API Reference
- ๐ก Examples
- ๐ฏ Strategy & Roadmap
๐ฌ Examples
Real-World Usage
// Complete app example
import 'package:flutter_unify/flutter_unify.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize with AI support
await Unify.initialize();
await Unify.ai.initialize(
config: AIAdapterConfig(apiKey: 'your-key'),
);
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: StreamBuilder<AuthStateChangeEvent>(
stream: Unify.auth.onAuthStateChanged,
builder: (context, snapshot) {
if (snapshot.hasData?.user != null) {
return DashboardScreen();
}
return LoginScreen();
},
),
);
}
}
Showcase Apps
- ๐จ Demo App - Full-featured demo showcasing all capabilities
- ๐ค AI Chat Example - Complete AI integration example
- ๐ฑ Production Examples - Real apps using Flutter Unify
๐ Why Developers Love Flutter Unify
- โก Fast: Optimized for performance, minimal overhead
- ๐ Reliable: Comprehensive error handling, graceful degradation
- ๐จ Beautiful: Clean, intuitive API design
- ๐ Well-Documented: Extensive docs, examples, and guides
- ๐ค Community-Driven: Built by developers, for developers
- ๐ Actively Maintained: Regular updates and new features
๐ค Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Related Packages
- window_manager - Window management (complementary)
- system_tray - System tray integration (alternative)
- seo_renderer - SEO rendering (alternative)
๐ Support & Community
- ๐ Report Issues
- ๐ฌ Discussions
- ๐ง Email Support
- ๐ Stack Overflow
- ๐ฆ Twitter - Follow for updates
๐ค Contributing
We welcome contributions! See our Contributing Guide for details.
Quick Contribution Ideas:
- ๐จ Create adapters for popular services (Firebase, Supabase, AWS)
- ๐ Improve documentation
- ๐ Fix bugs
- โจ Add new features
- ๐งช Write tests
๐ Project Status
- โ Core Features: Complete and stable
- โ AI Integration: OpenAI & Anthropic support
- โ Cross-Platform: iOS, Android, Web, Desktop
- ๐ Firebase Adapter: In progress
- ๐ Dev Dashboard: Coming soon
- ๐ More AI Providers: Gemini, Local LLMs planned
โญ Star History
If you find Flutter Unify useful, please consider giving it a โญ on GitHub!
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by the Flutter community
Libraries
- flutter_unify
- ๐ Flutter Unify - The Ultimate Unified API