Flutter Development & Compliance-First Architecture

FileMyTax.lk: A Tax Filing App Whose Engine Is Verified Against a Licensed Accountant’s Own Numbers

An on-device Flutter tax engine and a consent-gated handoff to BPC, a licensed Sri Lankan accounting firm, built so nothing is guessed at

Knovik built FileMyTax.lk for BPC, a licensed Sri Lankan accounting firm: a Flutter app whose on-device tax engine computes personal income tax entirely offline, structured and numerically reconciled to match BPC's own individual income tax computation template rather than a textbook simplification, with a consent-gated handoff to a licensed accountant for anything the client chooses to formally file.

Overview

BPC needed a way for individual taxpayers to work out their Sri Lankan personal income tax without exposing sensitive financial and identity data to a server by default, while still giving BPC's own accountants a clean, consent-gated path to review and formally submit a return. Knovik built FileMyTax.lk around that split: a free tier where the entire calculation runs on-device against a deterministic Dart tax engine, and a paid tier where a taxpayer can explicitly hand a filing off to BPC for human verification and IRD e-Services submission. The engine's category structure, reliefs, and its capital-gains treatment were not designed from general tax knowledge — they were built and numerically reconciled against BPC's own real AY 2025/2026 individual income tax computation spreadsheet until every figure matched to the cent, and every category the engine can't confidently compute (terminal benefits, partnership-share income, betting/gambling winnings, crypto trading, foreign-remitted income) is explicitly flagged for BPC rather than silently guessed at.

Tech StackFlutterDartDrift (SQLite)RiverpodDart ShelfSupabase (Postgres, Auth, pgvector)Flutter Web

Our Approach

What we delivered

An Engine Reconciled to a Real Accountant’s Spreadsheet, Not a Generic Tax Calculator

BPC's own AY 2025/2026 individual income tax computation template became the engine's golden test case: every threshold, relief, and the unusual mechanic behind capital gains (included in the progressive slab base, taxed again at a flat rate, then credited back) was implemented to reproduce that spreadsheet's own cached results exactly, not a simplified textbook version of Sri Lankan tax law.

A Guided Profile That Customizes Every Filing, Not Just the First One

A short onboarding flow (personal details, occupation, and revenue sources) builds a persistent taxpayer profile that pre-filters which income categories a filing shows, editable any time from Settings, with an always-available "show all categories" option so an incomplete profile never blocks a filer from entering something it didn't anticipate.

Consent-Gated Handoff, Not Silent Data Collection

The free tier never makes a network call to complete a filing — all data lives on-device in a local Drift database. The paid tier only transmits a filing after an explicit, per-filing consent action, to a backend that stores it under an automatically enforced, scheduled purge policy rather than indefinitely.

For Technical Readers

Architecture & technical details

The parts that matter to a technical or compliance evaluator: how the engine's numbers were actually verified, how a genuinely unusual tax mechanic was confirmed rather than assumed, and how two separate login systems stay scoped to identity only.

One spreadsheet as the correctness gate, not a suite of guessed test cases

Rather than writing unit tests against assumed correct values, BPC's own benchmark spreadsheet was fully reconciled by hand first — every line traced to the cent — and then turned into the engine's strongest test: it reproduces that worked example end-to-end and asserts every intermediate figure (assessable income, each relief, slab tax, capital gains tax, credits applied, balance payable), not just the final number.

A capital gains mechanic that would have been wrong if assumed from general knowledge

The textbook-simple approach to capital gains in Sri Lanka is a separate final flat tax. BPC's own spreadsheet does something different: the gain is included in the progressive slab base, taxed again separately at a flat 10%, and then credited back in full — a combination that only nets out correctly because of the specific order of operations. This was only discovered, not assumed, by fully reconciling the real spreadsheet's cached values; the engine replicates that exact mechanic.

Flag it, don’t guess it

Four income categories (terminal benefits/EPF/ETF/gratuity, partnership-share income, betting/gambling/lottery winnings, foreign-currency-remitted income) and crypto trading income are deliberately excluded from computation because neither BPC's spreadsheet nor the official IRD tax chart corroborated their exact mechanics closely enough to encode without guessing. The app flags them, carries a note through to the review screen and the generated report, and routes them to BPC rather than silently omitting or miscalculating them.

Two logins, one identity-only boundary

Taxpayers log in via Supabase Auth to use the app; BPC's reviewers log in via Supabase Auth on a completely separate Flutter Web portal. In both cases, Supabase holds nothing but the login identity (email, hashed password, user id) — no filing, profile, or tax data is ever written to Supabase Postgres for either app. The taxpayer's on-device Drift database remains the sole system of record for free-tier data, and paid-tier filings live only in the backend's own ephemeral, purge-scheduled storage after explicit consent.

Ephemeral by construction, not by policy document

The backend's purge logic runs as a Postgres function scheduled directly via Supabase's pg_cron extension — no separate always-on process to keep running — and was confirmed active by checking the live scheduled job against a real Supabase project, not just reading the migration that creates it.

Delivered & Verified

Results, as of July 2026

FileMyTax.lk hasn't launched publicly yet — it's gated on BPC's chartered-accountant sign-off on the tax engine's rates, a requirement this project treats as non-negotiable regardless of how well-sourced the engine's figures already are. What's below is what has actually been built and verified against real infrastructure and a real device, not a projected business outcome.

Golden benchmark test matches BPC’s own spreadsheet to the cent

Every intermediate figure in a full worked example — reliefs, slab tax, the capital gains credit-back, final balance payable — reproduced exactly against BPC’s own cached computation, not just the final total.

On-device and backend calculations independently agreed

Driven end-to-end on a physical Pixel 7 Pro against a live Supabase-backed server: the app’s own on-device figure and the backend’s independent recomputation of the same filing matched exactly.

A real UI bug found and fixed during that same device pass

A category dropdown overflow that no automated test caught — found, fixed, and re-verified on the physical device before being considered resolved.

Ephemeral data policy confirmed live, not just in a migration file

The pg_cron-scheduled purge job was checked directly against the running Supabase project and confirmed active, alongside a full consent → intake → status round-trip against the real backend.

Related Services

The services behind this work

Related Industries

Where this work applies

Frequently Asked Questions

Got questions? We have answers

Building compliance-first fintech software with a hard verification gate?

Talk to our team about a build where every consequential rule is source-verified instead of assumed, and sensitive data never leaves the device without explicit consent.