open-index/open-npm huggingface dataset:
npm package: @flutter-daemon/server
Description: flutter daemon server for nodejs
Latest version: 0.0.3

# Flutter Daemon & WS Server

## APIs

- writeFile
- createProject
- run

## Local dev server

```ts
import Server from "@flutter-builder/daemon/server";

const server = Server();
server.serve();
```

## Client (web app or IDE)

```ts
import Client from "@flutter-builder/daemon/client";

const client = client("ws://localhost:8080").connect();

const app = client.project("tmp");

app.writeFile("lib/main.dart", "void main() {}", {
  save: true,
});

app.on("weblaunchUrl", () => {
  //
});

app.on("restart", () => {
  //
});

// app.log
app.on("log", (log: string, error?: boolean) => {});
// app.progress
app.on("progress", (id: string, message?: string, finished?: boolean) => {});
// app.stop
app.on("stop", (appId: string) => {});

const devices = client.getDevices();

// .addFile("index.html", "<h1>Hello World</h1>");
```

## References

- https://github.com/flutter/flutter/blob/master/packages/flutter_tools/doc/daemon.md
- https://github.com/Dart-Code/Dart-Code/issues/4085
- https://github.com/Dart-Code/Dart-Code

```

```
npm package: @flutter-preview/core
Description: [Flutter Preview] core module
Author: Grida, Inc.
Latest version: 0.0.2

# Flutter preview

## How It works

- input: flutter project path, target widget info
- sync: sync flutter project to preview project on local temp dir
  - modes: symlink, watch & copy
- daemon: start flutter daemon on preview project

## Root app & theme

**default main**

```dart
import 'package:flutter/material.dart';

class FlutterPreview extends StatelessWidget {
  const FlutterPreview({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Preview',
      theme: ThemeData(),
      home: const PreviewWidget(),
    );
  }
}
```

**custom main**