freedome_flutter 1.0.1
freedome_flutter: ^1.0.1 copied to clipboard
Flutter glue for freedome_client: UI-kit port bindings, secure token store, prefs cache and outbox, Bonjour discovery, lifecycle hooks and the dome sound engine.
example/example.dart
// A dome's player controls in a Flutter app: tokens in the platform keystore, every kit port bound to one client.
// NativeMindNONC.
import 'package:flutter/material.dart' hide ConnectionState;
import 'package:freedome_client/freedome_client.dart';
import 'package:freedome_flutter/freedome_flutter.dart';
import 'package:nativemind_core/nativemind_core.dart';
import 'package:nativemind_freedome/nativemind_freedome.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final client = FreedomeClient(
endpoint: FreedomeEndpoint.parse('http://dome.local:8080'),
credentials: const PasswordCredentials('operator', 'secret'),
tokenStore: SecureTokenStore(),
);
await client.open();
final binding = FreedomeScopeBinding(client: client, ownsClient: true);
runApp(
binding.scope(
child: MaterialApp(
localizationsDelegates: NmApp.delegates([NmFreedomeL10n.delegate]),
supportedLocales: const [Locale('en')],
theme: const NmTheme().toThemeData(Brightness.light),
home: const Scaffold(
body: SingleChildScrollView(child: NmDomePlayerControls()),
),
),
),
);
}