mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
Settings screen (themes incl. Sweet, rebindable shortcuts), rich text escapes, page sidebar with the local graph, sortable All pages, tree view changes and the Type/Tags rows in the page header. Docs updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
926 B
Dart
31 lines
926 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'src/app.dart';
|
|
import 'src/backend/graph_backend.dart';
|
|
import 'src/editor/block_row.dart' as editor;
|
|
import 'src/rust/frb_generated.dart';
|
|
import 'src/state/settings.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await RustLib.init();
|
|
editor.openUrl = (url) {
|
|
final uri = Uri.tryParse(url);
|
|
if (uri != null) launchUrl(uri, mode: LaunchMode.externalApplication);
|
|
};
|
|
final dir =
|
|
Platform.environment['SYNAPSE_GRAPH'] ??
|
|
'${(await getApplicationSupportDirectory()).path}${Platform.pathSeparator}graph';
|
|
final backend = await FfiGraphBackend.open(dir);
|
|
runApp(
|
|
SynapseApp(
|
|
backend: backend,
|
|
settings: FileSettings('$dir${Platform.pathSeparator}app-settings.json'),
|
|
),
|
|
);
|
|
}
|