Contents
CWCoding With DhrumilCW Practical Flutter and Kotlin tutorials for working mobile developers

Home › Articles

Flutter for Android and iOS: One Codebase, Two Apps

By Priya Shah · Published · 5 min read

Two smartphones side by side representing Android and iOS app platforms.
Two smartphones side by side representing Android and iOS app platforms. · Foto: markusspiske / Pixabay

Flutter's pitch is simple: write your app once in Dart, run it on Android and iOS, and keep the UI identical on both. In practice that promise holds well for most screens, but only if you understand where the shared code ends and the platform-specific work begins. This walkthrough covers the parts that actually matter when you commit a real product to a single codebase.

We will go from a fresh project to a testable, shippable structure: how the widget tree builds, where Android and iOS genuinely diverge, how to bridge native APIs, and what release builds cost you in time and binary size. Numbers below are typical ranges from everyday projects, not benchmarks from a lab.

One Dart Codebase, Two Rendering Targets

A Flutter app is a Dart program that owns its own rendering. The framework draws every pixel itself through Skia or Impeller instead of mapping widgets to Android Views or UIKit controls. That is why a button looks and behaves the same on a Pixel and an iPhone, and why you do not write two layout files. Your Dart code, assets, and business logic are shared; only the thin host shell around them is platform-specific.

The trade-off is that anything the framework does not draw must come from the host. Status bar styling, permission dialogs, keyboard behaviour, and native SDKs all cross the boundary. Plan for that boundary early: keep platform calls behind a small interface so the shared UI never imports a plugin directly, and swapping or mocking it in tests stays cheap.

  • Shared: widgets, state, networking, storage logic
  • Platform-specific: app entry shells, manifests, permissions, signing
  • Bridged: camera, biometrics, push, payments, file pickers

Setting Up a Project That Ships to Both Stores

Use the Flutter CLI to scaffold, then treat the generated android/ and ios/ folders as real projects you own. Set the application ID and bundle identifier deliberately at the start, because changing them later means touching signing, push certificates, and deep links. Pin your Flutter SDK version in a file the team commits, and keep dependency versions locked so a fresh clone builds identically on every machine.

Flutter bundles its own Dart runtime, so you do not manage separate language versions per platform. What you do manage is toolchain: a recent Android SDK and Xcode on the build machine. A typical cold build of a mid-sized app takes roughly 60 to 180 seconds on a recent laptop; incremental hot reload lands under a second or two. iOS builds generally run slower than Android because of Xcode's linking step.

  • Set applicationId and bundle ID before the first release
  • Commit the SDK version constraint and lockfile
  • Keep release signing configs out of version control
  • Verify builds on both platforms in CI, not just locally

The Widget Build Cycle in Plain Terms

Everything on screen is a widget, and widgets are immutable descriptions. When state changes, Flutter rebuilds a subtree and diffs it, so the cost of a rebuild depends on how much you recreate. Deep widget trees that rebuild from the root on every keystroke feel fine on a flagship and sluggish on a three-year-old mid-range phone, which is still a large slice of the install base.

Keep rebuild scope tight: lift state no higher than necessary, use const constructors wherever possible, and split large build methods into smaller widgets. If you are coming from Android, the mental model shift is significant, and it helps to read the widget lifecycle as a separate topic before optimising anything. StatelessWidget vs StatefulWidget: Which One Should You Pick? is a good starting point for that shift.

Typical Flutter project figures across the two target platforms
AspectAndroidiOSNotes
Release binary size15-30 MB30-60 MBGrows with assets and native libs
Cold build time60-150 s90-180 sRecent laptop, mid-sized app
Hot reloadUnder 2 sUnder 2 sSame Dart tooling on both
Store reviewHours to 1 day1-3 daysFirst submission often longer
Permission setupManifest + runtimeInfo.plist stringsMissing iOS strings can crash
Back navigationSystem button, gesturesEdge swipe, nav barsNeeds explicit handling

Where Android and iOS Really Diverge

Shared UI does not mean shared behaviour. Back navigation differs: Android users expect the system back button and predictive back gestures, while iOS relies on edge swipes and navigation bars. Scrolling physics, text selection handles, and date pickers follow platform conventions, and Flutter gives you adaptive constructors for most of them. Ignoring these makes an app feel foreign on one platform even when it looks fine.

Permissions are the other big split. Android declares them in the manifest and asks at runtime; iOS requires usage description strings in Info.plist and will reject or crash without them. Push notifications, background location, and Bluetooth all have distinct setup paths. Budget real time for these, and test on a physical device of each type before you call a feature done.

  • Adaptive widgets for pickers, dialogs, and navigation
  • Handle Android back gestures explicitly
  • Write Info.plist usage strings for every iOS permission
  • Test permissions after a fresh install, not just an upgrade

Reaching Native APIs Without Forking Your Code

Most native needs are covered by maintained plugins, and adding one is a line in the dependency file. When no plugin fits, platform channels let you call Kotlin or Swift from Dart and return a result. Keep channels narrow: a single method that takes a typed request and returns a typed response is far easier to maintain than a dozen one-off calls scattered through the UI.

On the Android side, expect to write Kotlin inside your own module rather than a separate library at first. If you already maintain a Kotlin codebase, the integration patterns look familiar, and the same care about lifecycle and threading applies. For networking choices specifically, Retrofit vs Ktor Client: Small App Comparison Guide covers where a Dart-side client fits versus calling your existing native stack.

Testing, Releases, and What It Costs

Widget tests run fast and catch most layout and state regressions without a device. Integration tests are slower but catch the platform-boundary problems that widget tests cannot see, such as permission prompts and channel responses. A practical split is many widget tests, a handful of integration flows covering login, purchase, and onboarding, and manual passes on one physical device per platform before each release.

Release builds add time and size. A typical Flutter release binary lands around 15 to 30 MB for Android and 30 to 60 MB for iOS depending on assets and native libraries, with split-per-ABI builds trimming Android noticeably. Store review adds a day or more on iOS. If you are scoping budget for a product, What Does a Flutter App Cost to Build in 2026? breaks down where the hours actually go.

Structuring the Codebase for Two Targets

A flat lib/ folder works for a demo and hurts by month three. Separate features from shared infrastructure: one folder per feature, a core folder for networking, storage, and theming, and a thin platform folder for channel code. Keep the dependency direction one way, from features toward core, so you can delete a feature without untangling imports.

State management choice matters less than consistency. Pick one approach, apply it everywhere, and document the rule in the repository. The same discipline applies to navigation: scattered route pushes become impossible to reason about as screens multiply. Whatever you choose, write it down before the second developer joins.

  • Feature-first folders with a shared core
  • One state management approach, documented
  • Platform channel code isolated behind interfaces
  • Delete-friendly modules over clever abstractions
  • One Dart codebase covers both platforms, but permissions, navigation, and native SDKs still need per-platform work.
  • Keep platform channel calls behind small interfaces so the shared UI stays testable.
  • Widget tests catch most regressions cheaply; reserve device testing for boundary problems.
  • Expect iOS builds and review to take longer, and size binaries accordingly.
Priya Shah · Android and Kotlin author
Covers Kotlin, Jetpack libraries and Android architecture with a hands-on approach. Focuses on migration guides, database work and networking patterns for small teams.

Related articles

↑