SuperAPI AI Directory

mobile-hybrid

General & other

View repository

Updated 10-16 09:30

About this skill

Cross-platform mobile development (Mobile & Hybrid)

Use cases

  • React Native / Expo app development
  • Flutter app development
  • Ionic / Capacitor hybrid app
  • Tauri desktop application
  • Cross-platform architecture selection
  • Native module bridging

Division of labor with other skills

Scenario What to use
Mobile app / desktop application This skill
Mini program (WeChat/Alipay) miniprogram-development/
Web page component-architecture/
API call data-fetching/

Tech stack decisions

┌─ 跨平台选型决策 ───────────────────────────────────────────┐
│                                                             │
│  Q1: 性能要求?                                             │
│    极致原生感 → Flutter / 原生                              │
│    够用就行   → React Native / Ionic                       │
│                                                             │
│  Q2: 团队技术栈?                                           │
│    React/TS → React Native + Expo                          │
│    Dart 可学 → Flutter                                      │
│    Web 技术  → Ionic + Capacitor                           │
│    Rust      → Tauri(桌面)                                │
│                                                             │
│  Q3: 需要哪些端?                                           │
│    iOS + Android → RN / Flutter                            │
│    iOS + Android + Web → Flutter / Ionic                    │
│    桌面(Win/Mac/Linux) → Tauri / Electron                │
│    全部 → Flutter(最多端)                                 │
└─────────────────────────────────────────────────────────────┘

Framework comparison

Framework Language Performance Hot update Bundle size Ecosystem Suitable for
React Native TypeScript Good CodePush 8~15MB Huge React teams
Expo TypeScript Good EAS Update 15~25MB Expo ecosystem Rapid RN development
Flutter Dart Excellent Shorebird 10~20MB Google High-fidelity UI
Ionic TypeScript Average Direct deployment 5~10MB Web ecosystem Building apps with web technologies
Capacitor TypeScript Average - 5~10MB Made by Ionic Web→App shell
Tauri Rust+TS Excellent - 3~8MB Rust Desktop applications
Electron TypeScript Average - 100MB+ Huge Desktop (not recommended for new projects)

React Native + Expo quick start

# 创建项目(Expo 推荐)
npx create-expo-app@latest my-app
cd my-app
npx expo start

# 导航(必备)
npx expo install expo-router

# 状态管理
pnpm add zustand

# UI 组件库
pnpm add tamagui  # 或 react-native-paper / nativebase

Project structure (Expo Router)

app/
├── (tabs)/              # Tab 导航组
│   ├── index.tsx        # 首页 Tab
│   ├── explore.tsx      # 探索 Tab
│   └── _layout.tsx      # Tab Layout
├── modal.tsx            # Modal 页面
├── [id].tsx             # 动态路由
├── _layout.tsx          # 根 Layout
└── +not-found.tsx       # 404
components/
├── ui/                  # 基础组件
└── features/            # 业务组件

Flutter quick start

# 创建项目
flutter create my_app
cd my_app
flutter run

# 常用包
flutter pub add go_router        # 路由
flutter pub add riverpod         # 状态管理
flutter pub add dio              # 网络请求
flutter pub add freezed          # 数据类

Component library selection

React Native

Library Stars Style Suitable for
Tamagui 10K+ Cross-platform universal High performance + Web reuse
React Native Paper 13K+ Material Design MD style
NativeBase 20K+ Universal Full-featured
Gluestack UI 3K+ Modern NativeBase successor
RN UI Lib 6K+ Made by Wix Enterprise-grade

Flutter

Library Description
Material 3 Built into Flutter, Material Design 3
Cupertino Built into Flutter, iOS style
FlutterFlow Low-code Flutter UI
GetWidget 1000+ prebuilt components

Common pitfalls

1. Expo 托管工作流 vs 裸工作流选错 → 后期迁移痛苦
2. React Native 原生模块版本冲突 → 锁版本 + patch-package
3. Flutter 热重载失效 → 有状态 Widget 注意 key
4. 不测真机 → 模拟器表现不一致
5. iOS 审核被拒 → 提前读 Apple Guidelines
6. Android 权限不声明 → 运行时崩溃
7. 包大小不控制 → 用户不愿下载
8. 不做离线缓存 → 弱网体验差
9. 推送证书过期 → 推送静默失效
10. 不做崩溃监控 → 线上问题无感知

Companion templates

  • templates/mobile-hybrid-template.md

Collaboration with other skills

上游:
  ui-ux-designer → APP 设计稿(iOS/Android 规范差异)
  api-designer → API 契约

下游:
  testing-frontend → APP 自动化测试(Detox/Appium)
  build-deploy → APP 构建发布(EAS/Fastlane)
  devops-engineer → APP CI/CD