omi-flutter-patterns

Guide Flutter app development for Omi with BLE integration and Provider state management.

13.1k|2.2k|Updated Mar 22, 2024
One-click install
npx skills add https://github.com/BasedHardware/omi --skill omi-flutter-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: omi-flutter-patterns
Source: https://github.com/BasedHardware/omi/tree/main/.cursor/skills/omi-flutter-patterns
Command: npx skills add https://github.com/BasedHardware/omi --skill omi-flutter-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Flutter developers design and implement BLE device communication, Provider-based state management, and localization patterns for the Omi app, reducing boilerplate and ensuring consistency across platforms.

Core Features & Use Cases

  • BLE Device Communication: Guidance for discovering and connecting to Omi BLE devices, handling services and characteristics, and processing audio data streams.
  • State Management: Provider-based architecture to manage UI state and propagate changes efficiently across screens.
  • Localization: All user-facing strings should use localization keys and ARB files to enable multi-language support.
  • Backend Integration: Patterns for REST/WebSocket communication with the app's backend and data models.
  • Cross-Platform UI: Guidance for shared code and platform-specific adjustments for iOS, Android, macOS, and Windows.
  • Use Case: When adding a new screen that interacts with a BLE device, use Provider to reflect state, localize strings, and connect to backend APIs.

Quick Start

Start by inspecting app/ for existing Flutter structure, ensure Flutter SDK is installed, and run the app with flutter run --flavor dev after configuring Firebase and API endpoints.

Frequently Asked Questions about omi-flutter-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Flutter BLE device communication with Provider state management?

To integrate Flutter BLE device communication, use a Provider-based architecture to manage UI state and propagate device connection changes efficiently across screens. This pattern ensures UI updates automatically when discovering or connecting to BLE devices.

What is the best way to handle Flutter localization with ARB files in a cross-platform app?

Flutter localization with ARB files requires mapping all user-facing strings to localization keys. This enables multi-language support across iOS, Android, macOS, and Windows, ensuring consistent translations throughout the cross-platform application.

Can I use Flutter for cross-platform UI development targeting iOS, Android, macOS, and Windows?

Yes, Flutter cross-platform development supports iOS, Android, macOS, and Windows. You can maintain shared code while applying platform-specific adjustments to ensure the app interfaces correctly with Omi devices and backend services.

How do I connect a Flutter app to a backend using REST and WebSocket APIs?

To connect a Flutter app to a backend, implement REST and WebSocket communication patterns alongside your data models. This backend wiring works with Provider state management to sync data streams and API responses across the app.

How do I process audio data streams from a BLE device in a Flutter app?

Processing BLE audio data streams in Flutter involves discovering and connecting to Omi BLE devices, handling their specific services and characteristics, and then processing the incoming audio data within your Provider state management architecture.