nomos_flutter 0.61.3 copy "nomos_flutter: ^0.61.3" to clipboard
nomos_flutter: ^0.61.3 copied to clipboard

Drive the real Nomos GitHolon from a Flutter app — a local-first domain runtime. iOS + macOS run the native-AOT kernel (no WebView memory cap); Android uses a hidden secure WebView. Write TypeScript d [...]

example/lib/main.dart

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

const cloud = 'https://nomos.captainapp.co.uk';
const application = String.fromEnvironment('NOMOS_APPLICATION');
const authToken = String.fromEnvironment('NOMOS_AUTH_TOKEN');

void main() {
  runApp(const MaterialApp(debugShowCheckedModeBanner: false, home: _Root()));
}

class _Root extends StatelessWidget {
  const _Root();

  @override
  Widget build(BuildContext context) {
    if (application.isEmpty || authToken.isEmpty) {
      return const Scaffold(
        body: Center(
          child: Text(
            'Run with NOMOS_APPLICATION and NOMOS_AUTH_TOKEN '
            'provided using --dart-define.',
            textAlign: TextAlign.center,
          ),
        ),
      );
    }

    return NomosScope.home(
      cloud: cloud,
      application: application,
      authToken: authToken,
      loadingBuilder: (context, _) =>
          const Scaffold(body: Center(child: CircularProgressIndicator())),
      errorBuilder: (context, error) =>
          Scaffold(body: Center(child: Text(error.toString()))),
      builder: (context, nomos) => _Connected(client: nomos),
    );
  }
}

class _Connected extends StatelessWidget {
  const _Connected({required this.client});

  final NomosClient client;

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(title: const Text('Nomos application')),
    body: Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text('Ready as ${client.actor}'),
          const SizedBox(height: 16),
          FilledButton(
            onPressed: () => client.bridge.sync(admit: true),
            child: const Text('Sync'),
          ),
        ],
      ),
    ),
  );
}
0
likes
0
points
4.18k
downloads

Publisher

unverified uploader

Weekly Downloads

Drive the real Nomos GitHolon from a Flutter app — a local-first domain runtime. iOS + macOS run the native-AOT kernel (no WebView memory cap); Android uses a hidden secure WebView. Write TypeScript domains, get a typesafe Dart client, build Flutter widgets.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, flutter, flutter_inappwebview, flutter_js, nomos_client, path_provider, web

More

Packages that depend on nomos_flutter

Packages that implement nomos_flutter