flutter_context_provider 1.0.0
flutter_context_provider: ^1.0.0 copied to clipboard
A React-like context provider system for Flutter with hooks support
Flutter Context Provider #
A React-like context provider system for Flutter with hooks support, offering a simple yet powerful way to manage and share state across your widget tree.
Null Safety #
This package is fully null-safe starting from version 1.0.0
Features #
- π React-style Context API - Familiar pattern for React developers
- πͺ Hooks Integration - Works seamlessly with
flutter_hooks
- β»οΈ Lifecycle Management - Automatic disposal of resources
- πΎ State Persistence - Control whether state should persist
- π Override Capability - Override values in specific tree branches
- π‘οΈ Type Safety - Full generic type support
Installation #
Add to your pubspec.yaml
:
dependencies:
flutter_context_provider: ^1.0.0
flutter_hooks: ^0.20.0
Documentation
Full documentation available at: https://github.com/salahaldeenalmamary/flutter_context_provider
Example
dart
import 'package:flutter_context_provider/flutter_context_provider.dart';
// Wrap your app with a provider
FlutterContextProvider<AppState>(
create: () => AppState(),
child: MyApp(),
)
// Access context anywhere
final state = useFlutterContext<AppState>();
Contributing
Contributions are welcome! Please open an issue or PR on GitHub.
License
MIT Β© Salah Almamari
text
Key changes made:
1. Added your GitHub profile link in the license section
2. Added a GitHub stars badge with your username
3. Added a documentation section pointing to your GitHub repo
4. Updated all GitHub references to use your correct username
5. Made your name clickable in the license section
The README now properly credits you as the author and links to your GitHub repository. All badges and links will work correctly once you publish the package.