Thank you for your interest in contributing to TensorFlow Lite Plus! This document outlines the guidelines for contributing to this project.
- Search existing issues first to avoid duplicates
- Use the issue template when creating new issues
- Provide detailed information including:
- Flutter version
- Platform (Android/iOS)
- Device information
- Steps to reproduce
- Expected vs actual behavior
- Code samples or screenshots
- Check the roadmap to see if the feature is already planned
- Create a feature request with:
- Clear description of the feature
- Use case and benefits
- Proposed API design (if applicable)
- Implementation considerations
-
Fork the repository
git clone https://github.com/yourusername/tflite_plus.git cd tflite_plus -
Install dependencies
flutter pub get cd example && flutter pub get
-
Run tests
flutter test
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Write clean code following our coding standards:
- Use proper Dart formatting (
dart format) - Add comprehensive documentation
- Follow existing code patterns
- Add tests for new functionality
- Use proper Dart formatting (
-
Test your changes
# Run all tests flutter test # Test on both platforms cd example flutter run # Android flutter run -d ios # iOS (macOS only)
-
Update documentation
- Update README.md if needed
- Add/update API documentation
- Update CHANGELOG.md
- Dart: Follow the Dart Style Guide
- Android: Follow Android Kotlin Style Guide
- iOS: Follow Swift API Design Guidelines
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(android): add GPU delegate supportfix(ios): resolve memory leak in model loadingdocs(readme): add pose estimation examples
-
Ensure all tests pass
-
Update documentation as needed
-
Create a pull request with:
- Clear title and description
- Reference related issues
- List of changes made
- Screenshots/GIFs for UI changes
-
Respond to feedback promptly
-
Maintain a clean commit history
The plugin follows a layered architecture:
┌─────────────────────┐
│ Dart API │ ← Public API
├─────────────────────┤
│ Platform Interface │ ← Abstract interface
├─────────────────────┤
│ Method Channel │ ← Implementation
├─────────────────────┤
│ Native Platforms │ ← Android/iOS
└─────────────────────┘
-
Update the platform interface
abstract class TflitePlusPlatform { Future<ReturnType?> newFeature(Parameters params); }
-
Implement in method channel
class MethodChannelTflitePlus { Future<ReturnType?> newFeature(Parameters params) async { return await methodChannel.invokeMethod('newFeature', params.toMap()); } }
-
Add to main API
class TflitePlus { static Future<ReturnType?> newFeature(Parameters params) { return TflitePlusPlatform.instance.newFeature(params); } }
-
Implement native code
- Android: Update
TflitePlusPlugin.kt - iOS: Update
TflitePlusPlugin.swift
- Android: Update
-
Add comprehensive tests
-
Update documentation
- Test all public APIs
- Mock platform-specific code
- Test error handling
- Aim for >90% code coverage
- Test on real devices
- Test with actual models
- Test hardware acceleration
- Test memory management
test('loadModel should return success message', () async {
final result = await TflitePlus.loadModel(
model: 'test_model.tflite',
);
expect(result, contains('success'));
});- API Documentation: Use proper dartdoc comments
- README Updates: Keep examples current
- Code Comments: Explain complex logic
- Changelog: Document all changes
This project follows a Code of Conduct. By participating, you agree to:
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Maintain professional communication
- Respect different viewpoints
- Documentation: Check README and API docs first
- Issues: Search existing issues
- Discussions: Use GitHub Discussions for questions
- Email: Contact support@codebumble.net for private matters
Contributors will be:
- Listed in the Contributors section
- Mentioned in release notes for significant contributions
- Invited to join the maintainer team for exceptional contributions
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
Thank you for helping make TensorFlow Lite Plus better for everyone! 🚀