Permissionix
A lightweight and flexible package for managing user permissions in Flutter applications.
Features ✨
- Define and manage permissions dynamically.
- Check user permissions before displaying UI components.
- Easily integrate with backend-driven permission systems.
Installation 💻
❗ Ensure that you have the Flutter SDK installed before using Permissionix.
Add Permissionix to your project using:
dart pub add permissionix
Or add it manually to your pubspec.yaml:
dependencies:
permissionix: latest_version
Then, run:
flutter pub get
Usage 🚀
Import the package:
import 'package:permissionix/permissionix.dart';
Checking Permissions
final permissionManager = PermissionixManager<String>();
permissionManager.userPermissions = ['view_dashboard'];
if (permissionManager.hasPermission('view_dashboard')) {
print('User has access to the dashboard');
} else {
print('Access denied');
}
Using Permissionix Widget
Permissionix<String>(
permission: 'view_dashboard',
child: Text('Dashboard Content'),
replacement: Text('Access Denied'),
)
Continuous Integration 🤖
Permissionix includes a GitHub Actions workflow powered by Very Good Workflows. The CI setup ensures that code is consistently formatted, linted, and tested before merging changes.
By default, every push and pull request triggers:
- Code formatting checks
- Linting (using Very Good Analysis)
- Unit tests with coverage enforcement
License 📄
Permissionix is released under the MIT License.
Libraries
- permissionix
- A simple package to handle user permissions for accessing a feature