Thank you for your interest in contributing to mayr_flutter_extensions! We welcome contributions from the community and appreciate your help in making this package better.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Guidelines
- Pull Request Process
- Style Guide
- Testing
- Questions?
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors. Please be kind, professional, and considerate in all interactions.
- Flutter SDK (latest stable version)
- Dart SDK ^3.7.0
- Git
- A code editor (VS Code, Android Studio, IntelliJ, etc.)
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/mayr_flutter_extensions.git cd mayr_flutter_extensions - Install dependencies:
flutter pub get
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
If you find a bug, please create an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior vs actual behavior
- Flutter and Dart version information
- Any relevant code snippets or error messages
We love new ideas! To suggest a feature:
- Check if the feature already exists or has been requested
- Create an issue with a clear description of the feature
- Explain the use case and why it would be valuable
- Important: Only suggest Flutter-specific extensions (not general Dart extensions)
We actively welcome your pull requests!
This package focuses exclusively on Flutter-specific extensions. General Dart extensions belong in the companion package mayr_dart_extensions.
- Extensions on
Widget,BuildContext,TextStyle,ThemeData - Flutter UI/UX utilities
- Flutter-specific helpers (e.g.,
InkWellManager)
- Extensions on
String,int,DateTime,Duration - Extensions on
List,Map,Set - General Dart utilities without Flutter dependencies
lib/
├── mayr_flutter_extensions.dart # Main export file
└── src/
├── extensions.dart # Extension imports
└── extensions/
├── build_context.dart # BuildContext extensions
├── widget.dart # Widget extensions
├── image_widget.dart # Image extensions
├── text_widget.dart # Text extensions
├── text_style.dart # TextStyle extensions
├── stateless_widget.dart # StatelessWidget extensions
└── utils/
└── inkwell_manager.dart # Helper classes
- Follow the Effective Dart style guide
- Use
dart format .to format your code before committing - Run
dart analyze .to check for issues - Keep methods focused and single-purpose (SRP)
- Add comprehensive dartdoc comments for all public APIs
- Include usage examples in documentation
- Use clear, concise language
- Document all parameters and return values
Example:
/// Returns the width of the widget associated with this [BuildContext].
///
/// This is a convenience getter that accesses [MediaQuery.of(context).size.width].
///
/// Example:
/// ```dart
/// final width = context.widgetWidth;
/// print('Widget width: $width');
/// ```
double get widgetWidth => mediaQuery.size.width;- Use descriptive, clear names
- Extensions should be prefixed with
Mayr(e.g.,MayrWidgetExtensions) - Boolean getters should start with
isorhas - Methods that return a modified widget should be verbs (e.g.,
center(),expanded())
- All new features must include tests
- Tests should be placed in the
test/directory mirroring thelib/structure - Use descriptive test names
- Test edge cases and error conditions
Example test structure:
import 'package:flutter_test/flutter_test.dart';
import 'package:mayr_flutter_extensions/mayr_flutter_extensions.dart';
void main() {
group('BuildContext Extensions', () {
testWidgets('widgetWidth returns correct width', (tester) async {
// Test implementation
});
});
}# Run all tests
flutter test
# Run specific test file
flutter test test/extensions/widget_test.dart
# Run with coverage
flutter test --coverage- Update Documentation: Ensure README and dartdocs are updated
- Add Tests: Include tests for new functionality
- Run Quality Checks:
flutter test dart format . dart analyze .
- Commit Your Changes:
git add . git commit -m "feat: add new extension for X"
- Use Conventional Commits format
- Common prefixes:
feat:,fix:,docs:,test:,refactor:
- Push to Your Fork:
git push origin feature/your-feature-name
- Create Pull Request on GitHub with:
- Clear title describing the change
- Description of what was changed and why
- Link to any relevant issues
- Screenshots if UI-related
- Maintainers will review your PR
- Address any requested changes
- Once approved, your PR will be merged
If you have questions:
- Check existing issues
- Create a new issue with the "question" label
- Reach out to the maintainers
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to MayR Flutter Extensions! 🎉
Made with ❤️ by the MayR Labs community