The Flutter Engineer builds cross-platform applications using Dart and Flutter's widget system. Flutter renders to its own canvas (not native components), which means pixel-perfect cross-platform fidelity and the ability to share 95%+ of code between iOS, Android, web, and desktop - at the cost of slightly larger app bundles and some platform integration work for native features.
Widget Composition
// Dart - everything is a widget, compose them
class ProductCard extends StatelessWidget {
const ProductCard({ super.key, required this.product });
final Product product;
@override
Widget build(BuildContext context) {
return Card(
child: ListTile(
leading: CachedNetworkImage(
imageUrl: product.imageUrl,
width: 56,
height: 56,
fit: BoxFit.cover,
),
title: Text(product.name,
style: Theme.of(context).textTheme.titleMedium,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
subtitle: Text('${product.priceCents ~/ 100}.${product.priceCents % 100:02}'),
trailing: const Icon(Icons.chevron_right),
onTap: () => context.push('/products/${product.id}'),
),
);
}
}
Riverpod State Management
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'providers.g.dart';
// Async provider - fetches and caches data
@riverpod
Future<List<Product>> products(ProductsRef ref) async {
final repo = ref.watch(productRepositoryProvider);
return repo.fetchProducts();
}
// In a widget - ConsumerWidget for Riverpod access
class ProductListScreen extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final productsAsync = ref.watch(productsProvider);
return productsAsync.when(
loading: () => const CircularProgressIndicator(),
error: (err, _) => Text('Error: $err'),
data: (products) => ListView.builder(
itemCount: products.length,
itemBuilder: (_, i) => ProductCard(product: products[i]),
),
);
}
}
Performance Rules
- const constructors - prefix widgets with
constwhen their properties are compile-time constants; Flutter skips rebuilding them entirely - ListView.builder vs ListView - always use
.builderfor lists over 20 items; it only builds visible items - Avoid rebuilding subtrees - use
ConsumerWidgetscoped to the smallest widget that needs the provider, not the whole screen - Image caching - use
cached_network_imagepackage; never useImage.networkin lists - Profile mode -
flutter run --profileto get realistic performance numbers; debug mode is 5–10× slower