The Flutter → Android Mental Model
You already build high-quality apps. This guide maps your Flutter instincts to Kotlin, Android OS, and the Compose runtime so you can ship native confidently.
1Core UI Concepts
Rendering & UI Primitives
Flutter
Android (Kotlin/Compose)
Key Differences
Widget
Composable (Jetpack Compose) / View (XML)
Composables are functions, not classes. They describe UI declaratively like Flutter Widgets.
build() method
@Composable function body
Compose recomposes functions when State changes. No direct build method is needed.
StatelessWidget
Composable w/ no state
Pure Composables are effectively stateless when they only depend on inputs.
StatefulWidget
remember / mutableStateOf
Compose keeps state via `remember` and `mutableStateOf`.
BuildContext
CompositionLocal / Ambient
Compose uses CompositionLocal to pass dependencies down the tree.
Critical Difference: Lifecycle Ownership
Flutter owns the UI lifecycle. Android has a real OS lifecycle for Activities/Fragments. Compose respects that lifecycle and can be disposed at any time when configuration changes occur.
2State Management & Logic
Business Logic
Flutter
Android (Kotlin/Compose)
Key Differences
Cubit / BLoC
ViewModel (AndroidX)
Android standard is ViewModel + StateFlow/LiveData.
State Class
UiState data class
Compose consumes immutable UiState and recomposes when StateFlow emits.
Stream<State>
Flow / StateFlow
Kotlin Flow is the idiomatic reactive stream in Android.
BlocProvider
Hilt / Koin DI
Dependency injection at Activity/Composable boundary.
BlocListener
LaunchedEffect / collect
Handle navigation and one-off events with SharedFlow or Channel.
3Concurrency & Threading
Async Operations
Flutter
Android (Kotlin/Compose)
Key Differences
Isolate
Coroutine Dispatchers
Coroutines run on Dispatchers (Main, IO, Default). Heavy work runs on Default/IO.
Future<T>
suspend functions
Kotlin suspend is the equivalent of async/await in Dart.
compute()
withContext(Dispatchers.Default)
Offload CPU-heavy work to background threads.
Next Section
Widget-to-Compose MapProject Structure
Files & Entry Points
Flutter
Android (Kotlin/Compose)
Key Differences
lib/main.dart
MainActivity.kt + setContent{}
Compose UI starts in MainActivity via setContent.
pubspec.yaml
build.gradle.kts
Gradle (Kotlin DSL) manages dependencies and build config.
android/ & ios/ folders
app/ module
Android is a multi-module Gradle project; `app` is the entry module.
Assets (pubspec)
res/ + assets/
Android resources live in res/ (xml, drawables, strings) and assets/.
Dependency Management
Flutter: Pub
- pubspec.yaml: Central declarative file.
- pub.dev: The central repository.
- Lockfile: pubspec.lock.
Android: Gradle
- Gradle (Kotlin DSL): build.gradle.kts per module.
- Maven Central: Primary artifact source.
- Version Catalogs: libs.versions.toml for centralized versions.
Build Environments
Flavors vs Build Variants
Flutter
Android (Kotlin/Compose)
Key Differences
--flavor dev
Build Variants (debug/release)
Android build variants are a matrix of buildTypes + productFlavors.
main_dev.dart
ProductFlavors + buildConfigField
Use flavors + buildConfigField for env-specific constants.
.env files
Gradle + local.properties
Sensitive values stored in local.properties or CI secrets.