Skip to content

React Native and Flutter UI Recipes

Mobile development with AI tools is tricky because platform-specific behavior matters. A component that works in a web preview will crash on a real device if it uses unsupported APIs. These recipes produce code that accounts for iOS/Android differences, handles safe areas, respects platform conventions, and uses native modules correctly.

  • React Native component recipes with platform-specific handling
  • Flutter widget recipes with Material and Cupertino design
  • Navigation patterns for both frameworks with deep linking
  • Performance recipes for lists, animations, and image loading

Recipe 1: Platform-Adaptive Navigation (React Native)

Section titled “Recipe 1: Platform-Adaptive Navigation (React Native)”

Scenario: Your app needs tab navigation on iOS and drawer navigation on Android, following each platform’s conventions.

Navigation scaffolding touches many files at once — the navigator, every screen, the param types, and the deep-link config — so the tool you reach for changes how you drive it.

Open the navigation folder and use agent mode so it edits RootNavigator.tsx, the screen files, and linking.ts in one pass. Drop a checkpoint before accepting — platform-split navigators are the classic case where the AI gets the iOS branch right and silently breaks the Android headerShown defaults, and you want a one-click rollback.

Expected output: Root navigator, iOS tabs, Android drawer, deep linking config, typed params, and tests.


Recipe 2: Responsive Layout System (React Native)

Section titled “Recipe 2: Responsive Layout System (React Native)”

Scenario: Your app must work on phones, tablets, and foldables with different layouts at each breakpoint.

Expected output: useResponsive hook, three layout components, useScaledSize hook, and tests.


Scenario: Your Flutter app needs a branded design system working across iOS and Android.

Expected output: Five widget files, theme class, widget book, and widget tests.


Recipe 4: Performant Feed List (React Native)

Section titled “Recipe 4: Performant Feed List (React Native)”

Scenario: Your feed screen shows 1000+ items with images and stutters when scrolling. Pull-to-refresh feels laggy.

Expected output: Feed screen with FlashList, memoized FeedItem, FastImage loading, and performance test.


Recipe 5: Offline-First Architecture (React Native)

Section titled “Recipe 5: Offline-First Architecture (React Native)”

Scenario: Your field service app must work without connectivity. Users enter data offline and it syncs when connected.

A sync engine spans models, an adapter, hooks, and UI — and the tricky part is the last-write-wins conflict logic, which is easy to get subtly wrong. How you supervise that differs by tool.

Build it in agent mode across the model and adapter files, but checkpoint right before the sync-adapter step and review that diff on its own — conflict resolution is where the AI quietly drops the syncStatus reconciliation. The inline diff view makes the timestamp-comparison logic easy to scan line by line.

Expected output: WatermelonDB models, sync engine, network hooks, offline banner, and sync tests.


Recipe 6: State Management with Riverpod (Flutter)

Section titled “Recipe 6: State Management with Riverpod (Flutter)”

Scenario: Your Flutter app uses Provider everywhere. Migrate to Riverpod for testability and type safety.

Expected output: Three provider files, widget tree integration, and widget tests with mock overrides.


Recipe 7: Native Module Integration (React Native)

Section titled “Recipe 7: Native Module Integration (React Native)”

Scenario: You need NFC tag reading not covered by existing libraries.

Use agent mode so it generates NativeNfc.ts, the Swift class, and the Kotlin class in one edit, then keep the iOS Simulator and an Android emulator in split panes to eyeball both bridges. Because native changes do not hot-reload, accept the checkpoint and trigger a full rebuild rather than expecting Fast Refresh to pick them up.

Expected output: TurboModule spec, iOS Swift, Android Kotlin, useNfc hook, and tests.


Recipe 8: Card Swipe Animations (React Native)

Section titled “Recipe 8: Card Swipe Animations (React Native)”

Scenario: You need smooth 60fps animations for a swipeable card stack.

Expected output: SwipeableCard, CardStack, undo logic, haptic integration, and gesture tests.


Recipe 9: Platform-Adaptive Design (Flutter)

Section titled “Recipe 9: Platform-Adaptive Design (Flutter)”

Scenario: Your Flutter app looks identical on iOS and Android. Users expect platform-native patterns.

Expected output: Six adaptive widgets, PlatformHelper, base page class, and cross-platform tests.


Recipe 10: Push Notifications (React Native)

Section titled “Recipe 10: Push Notifications (React Native)”

Scenario: Your app needs push notifications on both platforms with deep linking to specific screens.

Expected output: Firebase config, setup, handlers, deep link parser, hook, and tests.


Scenario: Your navigation is scattered Navigator.push calls with no type safety. You need declarative routing.

Expected output: Router config, typed helpers, deep link config, guards, and navigation tests.


Recipe 12: App Store Submission Preparation

Section titled “Recipe 12: App Store Submission Preparation”

Scenario: Your app is feature-complete. Prepare for App Store and Play Store submission.

Submission prep is mostly config edits plus a verification script, so this is the recipe where a scripted, repeatable run pays off most.

Let agent mode edit Info.plist and build.gradle together, then run the build-verification script from the integrated terminal. The visual diff is handy for catching a wrong versionCode or a stray debug entitlement before you ship.

Expected output: Updated native configs, icon script, build verification script, and release checklist.