I wanted to build a Pomodoro app that I would actually use. Not just a timer. A productivity tool with an AI assistant that understands your work patterns. Treating it as a real product, planning to publish on the Play Store.
What It Does
A focus timer (25 min work, 5 min break) with session tracking, streaks, and daily/weekly goals. The interesting part is the built-in AI chatbot powered by OpenAI. You can ask things like “how many hours did I focus this week?” or “what’s my most productive time of day?” and it pulls real data from your local database.
Live countdown in the notification bar with pause/resume buttons. Full session history with search, editing, and stats.
The AI Tool System
The AI does not just generate text. It has 6 tools that query your local SQLite database directly. Sessions, stats, goals, patterns. When you ask a question, the AI decides which tools to call, pulls real data, and gives you an answer grounded in your actual usage.
This was the most interesting part to build. Getting the AI to work with structured local data through tool calls required careful schema design. Each tool has a specific purpose and returns data the AI can reason about.
If there is no internet, the AI still works. A keyword-based fallback system handles common queries offline using local data. Not as flexible as the full AI, but functional.
Timer Design
Wall-clock based timer. Instead of relying on Timer.periodic which can drift when the app is backgrounded, the timer calculates elapsed time from actual wall clock timestamps. Simple approach but it means the timer never drifts regardless of what the OS does.
Testing Without Flutter
Wrote 46+ pure Dart tests for the backend logic. No Flutter dependency needed. Services, repositories, AI tools, timer logic. All testable as plain Dart.
This was a deliberate architecture decision. Keeping business logic in pure Dart means tests run fast, no widget testing overhead, no emulator needed. Claude Opus helped significantly with both the AI integration code and the test coverage.
Tech Stack
- Flutter for the UI
- Riverpod for state management
- Drift (SQLite) for local persistence
- OpenAI API for the AI chatbot
- 6 custom AI tools for data querying
What I Learned
Building AI features into a mobile app is different from building a web-based AI tool. You deal with offline states, local databases, background execution, notification systems. The AI needs to work with what is available on the device.
The tool-based approach for AI works well. Instead of dumping all data into the prompt, you let the AI decide what data it needs and fetch it through specific tools. Keeps token usage low and responses accurate.
Riverpod made state management clean. Timer state, session state, AI chat state, all separate providers that compose well.
Planning to ship this on the Play Store. Building something you use every day keeps the quality bar high.