A minimalist Flutter app for counting mantras, prayers, or affirmations during meditation and spiritual practice. Designed for simplicity and focus, Counta provides a distraction-free counting experience with customizable alerts and session tracking.
- Resizable Tap Zone: Adjust the counting area to your preference with a simple drag handle
- Smart Alerts: Set threshold and repeat interval alerts with subtle haptic feedback
- Session Tracking: Save and review your meditation sessions with notes
- Resume Notifications: Get notified to resume from where you left off when the app is backgrounded
- Multiple Themes: Choose from 5 beautiful color schemes (Ocean, Forest, Sunset, Mono, Lavender)
- Haptic Feedback: Subtle vibrations for tap confirmation and milestone alerts
- Dark Mode: Full support for light and dark themes
- Persistent Settings: Your preferences and sessions are saved locally using Hive
- Undo Feature: Easily correct mistaken taps with the undo button
- Cross-Platform: Works on iOS, Android, macOS, Windows, Linux, and Web
- Flutter SDK (3.38.8 or higher)
- Dart SDK (3.10.7 or higher)
- For iOS: Xcode and CocoaPods
- For Android: Android Studio and SDK
-
Clone the repository
git clone https://github.com/olamide226/counta.git cd counta -
Install dependencies
flutter pub get
-
Generate code for Hive models
dart run build_runner build --delete-conflicting-outputs
-
Run the app
flutter run
Or for a specific platform:
flutter run -d chrome # Web flutter run -d macos # macOS flutter run -d ios # iOS flutter run -d android # Android
- Start Counting: Tap the main counting area to increment your count
- Set Alerts: Tap the Alert button to configure threshold and repeat interval alerts
- Adjust Tap Zone: Drag the handle between the counter and controls to resize the tap area
- Save Sessions: When finished, tap Save to store your session with optional notes
- Review History: View all your saved sessions from the Sessions screen
- Customize: Access Settings to change themes, sound modes, and other preferences
- Undo Mistakes: Tap the Undo button to decrease the count by one
- Resume Notifications: When you background the app during a counting session, you'll receive a notification showing your current count and session duration. Tap it to resume your practice.
- Framework: Flutter 3.38.8
- State Management: Riverpod 2.6.1
- Local Database: Hive 2.2.3
- Notifications: flutter_local_notifications 18.0.1
- Audio: audioplayers 6.1.0
- Haptics: Flutter's HapticFeedback API
- Code Generation: build_runner, hive_generator
lib/
βββ main.dart # App entry point
βββ app.dart # Root MaterialApp widget
βββ core/
β βββ services/ # Alert, feedback, and notification services
β βββ theme/ # Theme registry and color schemes
βββ data/
β βββ hive/ # Hive initialization
β βββ repositories/ # Data repositories
βββ domain/
β βββ models/ # Data models (Hive entities)
βββ state/
β βββ providers/ # Riverpod state providers
βββ ui/
βββ screens/ # App screens
βββ sheets/ # Bottom sheets
βββ widgets/ # Reusable widgets
Counta helps you maintain your practice with smart resume notifications:
When you minimize or background the app during a counting session (count > 0), Counta automatically:
-
Tracks Your Progress: Records your current count and session duration
-
Sends a Notification: Displays a notification showing:
- Your current count
- Session duration
- A prompt to resume
-
Resume Seamlessly: Tap the notification to return to your session exactly where you left off
- Title: "Resume Counting"
- Content: "You were at [X] counts. Session duration: [Y]m"
- Auto-Cancel: Notifications are automatically cleared when you return to the app
- Privacy: All notifications are local - no data is sent to external servers
iOS/macOS:
- Notification permissions are requested on first launch
- You can manage permissions in Settings > Notifications
Android:
- Notification permission is requested on Android 13+ (API 33+)
- Notifications use a dedicated "Resume Notifications" channel
- High priority for immediate visibility
The app requires notification permissions to function:
- Android:
POST_NOTIFICATIONSpermission (Android 13+) - iOS: Alert, Badge, and Sound permissions
These are requested automatically when the app first launches.
Contributions are welcome! Here's how you can help:
-
Fork the repository
git clone https://github.com/olamide226/counta.git cd counta -
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow the existing code style and architecture
- Use Riverpod for state management
- Add comments for complex logic
- Ensure Hive models have proper type adapters
-
Format your code
dart format . -
Run code generation if needed
dart run build_runner build --delete-conflicting-outputs
-
Test your changes
flutter test flutter run -
Commit and push
git add . git commit -m "feat: add your feature description" git push origin feature/your-feature-name
-
Create a Pull Request
- Describe your changes clearly
- Reference any related issues
- Include screenshots for UI changes
- Architecture: Follow clean architecture principles with domain/data/state/ui separation
- State Management: Use Riverpod providers for all state
- Models: Annotate with Hive type adapters for persistence
- UI: Use Material 3 components and respect theme colors
- Platform Support: Test on both iOS and Android for haptic/audio features
- Accessibility: Consider screen readers and semantic labels
- Unit tests for counter logic and alert service
- Integration tests for session workflows
- Custom sound files for tap feedback
- Additional theme color schemes
- Accessibility improvements
- Localization/internationalization
- Widget animations (count bump, milestone celebration)
- Export sessions to CSV/JSON
The project includes comprehensive unit tests for core business logic. Run tests using:
make test # Run all tests
make test-coverage # Run tests with coverage reportCurrent Coverage: ~27% (51 tests passing)
While overall coverage is moderate, all critical business logic is thoroughly tested:
β Fully Tested Components:
- CounterProvider (13 tests) - Core counter logic, increment/decrement, reset, session management
- CounterAlertService (16 tests) - Alert triggering at thresholds and repeat intervals
- Domain Models (26 tests) - AppSettings, CountSession, CounterState, Enums validation
- ThemeRegistry (8 tests) - All 5 color themes in light/dark modes
- UI screens/widgets (requires complex Flutter widget testing)
- Hive data persistence layer (requires database mocking)
- Platform-specific services (haptic feedback, audio playback)
The core application logic that determines app behavior is well-tested and reliable. UI components are manually tested during development.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with Flutter and inspired by the need for a simple, focused meditation companion.
Made with β€οΈ for mindful practice