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.

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.

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.

Cursor’s multi-file editing generates native code alongside TypeScript simultaneously.

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.

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