mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-06-25 07:10:48 -04:00
flutter work
This commit is contained in:
parent
8c96373cfd
commit
a44794ab98
11 changed files with 387 additions and 361 deletions
34
veilid-flutter/example/lib/veilid_init.dart
Normal file
34
veilid-flutter/example/lib/veilid_init.dart
Normal file
|
@ -0,0 +1,34 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:veilid/veilid.dart';
|
||||
|
||||
// Initialize Veilid
|
||||
// Call only once.
|
||||
void veilidInit() {
|
||||
if (kIsWeb) {
|
||||
var platformConfig = VeilidWASMConfig(
|
||||
logging: VeilidWASMConfigLogging(
|
||||
performance: VeilidWASMConfigLoggingPerformance(
|
||||
enabled: true,
|
||||
level: VeilidConfigLogLevel.debug,
|
||||
logsInTimings: true,
|
||||
logsInConsole: true),
|
||||
api: VeilidWASMConfigLoggingApi(
|
||||
enabled: true, level: VeilidConfigLogLevel.info)));
|
||||
Veilid.instance.initializeVeilidCore(platformConfig.json);
|
||||
} else {
|
||||
var platformConfig = VeilidFFIConfig(
|
||||
logging: VeilidFFIConfigLogging(
|
||||
terminal: VeilidFFIConfigLoggingTerminal(
|
||||
enabled: false,
|
||||
level: VeilidConfigLogLevel.debug,
|
||||
),
|
||||
otlp: VeilidFFIConfigLoggingOtlp(
|
||||
enabled: false,
|
||||
level: VeilidConfigLogLevel.trace,
|
||||
grpcEndpoint: "localhost:4317",
|
||||
serviceName: "VeilidExample"),
|
||||
api: VeilidFFIConfigLoggingApi(
|
||||
enabled: true, level: VeilidConfigLogLevel.info)));
|
||||
Veilid.instance.initializeVeilidCore(platformConfig.json);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue