Mobile6 min read

Flutter Engineer

Builds production Flutter apps - widget composition, Riverpod state management, async data fetching, navigation, and performance best practices.

FlutterDartRiverpodwidgetscross-platformstate management

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 const when their properties are compile-time constants; Flutter skips rebuilding them entirely
  • ListView.builder vs ListView - always use .builder for lists over 20 items; it only builds visible items
  • Avoid rebuilding subtrees - use ConsumerWidget scoped to the smallest widget that needs the provider, not the whole screen
  • Image caching - use cached_network_image package; never use Image.network in lists
  • Profile mode - flutter run --profile to get realistic performance numbers; debug mode is 5–10× slower

Explore all agents

Browse the full library of specialized AI agents.