Skip to main content

nativemind_copilot_media 0.1.0 copy "nativemind_copilot_media: ^0.1.0" to clipboard
nativemind_copilot_media: ^0.1.0 copied to clipboard

Native media for nativemind_copilot: microphone recording, on-device speech recognition, text-to-speech and file / photo / camera picking, implementing the copilot's voice, speech and attachment ports [...]

example/lib/main.dart

// The nativemind_copilot_media example: the copilot panel over a scripted engine with native voice input, speech output,
// attachments and the voice assistant mode (on the web the copilot's browser implementations).
// written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
import 'package:flutter/material.dart';
import 'package:nativemind_copilot/nativemind_copilot.dart';
import 'package:nativemind_copilot_media/nativemind_copilot_media.dart';
import 'package:nativemind_core/nativemind_core.dart';

// written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
void main() => runApp(const NmMediaExampleApp());

/// A scripted reply that echoes what was said or attached.
// written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
NmScriptedTurn nmExampleReply() => NmScriptedTurn.events([
  (Duration.zero, const NmTurnEvent('demo')),
  (const Duration(milliseconds: 400), const NmTextDeltaEvent('I heard you. Attach a file or press the voice button to talk to me.')),
  (Duration.zero, const NmDoneEvent()),
]);

/// The example app.
// written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
class NmMediaExampleApp extends StatefulWidget {
  /// Creates the app.
  // written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
  const NmMediaExampleApp({super.key});

  // written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
  @override
  State<NmMediaExampleApp> createState() => _NmMediaExampleAppState();
}

// written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
class _NmMediaExampleAppState extends State<NmMediaExampleApp> {
  late final NmScriptedEngine _engine = NmScriptedEngine(const [], fallback: nmExampleReply(), transcript: 'Hello from the server');
  late final NmCopilotController _controller = NmCopilotController(
    NmCopilotConfig(
      engine: _engine,
      voice: NmCopilotMedia.voice(engine: _engine),
      attachments: NmCopilotMedia.attachments(),
      voiceAssistant: NmCopilotMedia.assistant(),
    ),
  );

  // written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  // written by Claude Code (generated by Claude Code), 2026-11-12; SDD: consilium.nativemind.net flows/sdd-konsilium-nativemind-framework
  @override
  Widget build(BuildContext context) => MaterialApp(
    title: 'nativemind_copilot_media',
    supportedLocales: const [Locale('en'), Locale('ru'), Locale('th'), Locale('hi'), Locale('zh')],
    localizationsDelegates: NmApp.delegates([NmCopilot.delegate]),
    theme: const NmTheme(palette: NmPalette.blue).toThemeData(Brightness.light),
    home: Scaffold(
      body: SafeArea(
        child: NmCopilotScope(
          controller: _controller,
          child: const NmCopilotPanel(title: 'Media copilot'),
        ),
      ),
    ),
  );
}
0
likes
0
points
197
downloads

Publisher

verified publisherframework.nativemind.net

Weekly Downloads

Native media for nativemind_copilot: microphone recording, on-device speech recognition, text-to-speech and file / photo / camera picking, implementing the copilot's voice, speech and attachment ports on plugins.

Homepage
Repository (GitLab)
View/report issues

Topics

#ai #copilot #voice #speech #attachments

License

unknown (license)

Dependencies

file_picker, flutter, flutter_tts, image_picker, nativemind_copilot, nativemind_core, record, speech_to_text, web

More

Packages that depend on nativemind_copilot_media