mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 02:32:11 +00:00
fix splash screen in light mode
This commit is contained in:
parent
fe360cb2bc
commit
ba2f9644c0
13 changed files with 142 additions and 146 deletions
|
|
@ -5,6 +5,8 @@
|
||||||
<!-- Show a splash screen on the activity. Automatically removed when
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
the Flutter engine draws its first frame -->
|
the Flutter engine draws its first frame -->
|
||||||
<item name="android:windowBackground">@drawable/launch_background</item>
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
<!-- Set the background color to the primary color so the white logo is visible -->
|
||||||
|
<item name="android:colorBackground">#FF57CC99</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
This theme determines the color of the Android Window while your
|
This theme determines the color of the Android Window while your
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||||
</imageView>
|
</imageView>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="0.341176" green="0.8" blue="0.6" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||||
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
||||||
|
|
||||||
import 'frb_generated.dart';
|
import 'frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
// These functions are ignored because they are not marked as `pub`: `get_twonly_flutter`
|
// These functions are ignored because they are not marked as `pub`: `get_twonly_flutter`
|
||||||
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `TwonlyFlutter`
|
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `TwonlyFlutter`
|
||||||
|
|
@ -14,14 +13,15 @@ Future<void> initializeTwonlyFlutter({required TwonlyConfig config}) =>
|
||||||
RustLib.instance.api.crateBridgeInitializeTwonlyFlutter(config: config);
|
RustLib.instance.api.crateBridgeInitializeTwonlyFlutter(config: config);
|
||||||
|
|
||||||
class AnnouncedUser {
|
class AnnouncedUser {
|
||||||
|
final PlatformInt64 userId;
|
||||||
|
final Uint8List publicKey;
|
||||||
|
final PlatformInt64 publicId;
|
||||||
|
|
||||||
const AnnouncedUser({
|
const AnnouncedUser({
|
||||||
required this.userId,
|
required this.userId,
|
||||||
required this.publicKey,
|
required this.publicKey,
|
||||||
required this.publicId,
|
required this.publicId,
|
||||||
});
|
});
|
||||||
final PlatformInt64 userId;
|
|
||||||
final Uint8List publicKey;
|
|
||||||
final PlatformInt64 publicId;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => userId.hashCode ^ publicKey.hashCode ^ publicId.hashCode;
|
int get hashCode => userId.hashCode ^ publicKey.hashCode ^ publicId.hashCode;
|
||||||
|
|
@ -37,6 +37,13 @@ class AnnouncedUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
class OtherPromotion {
|
class OtherPromotion {
|
||||||
|
final int promotionId;
|
||||||
|
final PlatformInt64 publicId;
|
||||||
|
final PlatformInt64 fromContactId;
|
||||||
|
final int threshold;
|
||||||
|
final Uint8List announcementShare;
|
||||||
|
final PlatformInt64? publicKeyVerifiedTimestamp;
|
||||||
|
|
||||||
const OtherPromotion({
|
const OtherPromotion({
|
||||||
required this.promotionId,
|
required this.promotionId,
|
||||||
required this.publicId,
|
required this.publicId,
|
||||||
|
|
@ -45,12 +52,6 @@ class OtherPromotion {
|
||||||
required this.announcementShare,
|
required this.announcementShare,
|
||||||
this.publicKeyVerifiedTimestamp,
|
this.publicKeyVerifiedTimestamp,
|
||||||
});
|
});
|
||||||
final int promotionId;
|
|
||||||
final PlatformInt64 publicId;
|
|
||||||
final PlatformInt64 fromContactId;
|
|
||||||
final int threshold;
|
|
||||||
final Uint8List announcementShare;
|
|
||||||
final PlatformInt64? publicKeyVerifiedTimestamp;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
|
|
@ -75,12 +76,13 @@ class OtherPromotion {
|
||||||
}
|
}
|
||||||
|
|
||||||
class TwonlyConfig {
|
class TwonlyConfig {
|
||||||
|
final String databasePath;
|
||||||
|
final String dataDirectory;
|
||||||
|
|
||||||
const TwonlyConfig({
|
const TwonlyConfig({
|
||||||
required this.databasePath,
|
required this.databasePath,
|
||||||
required this.dataDirectory,
|
required this.dataDirectory,
|
||||||
});
|
});
|
||||||
final String databasePath;
|
|
||||||
final String dataDirectory;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
|
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
||||||
|
|
||||||
import '../bridge.dart';
|
import '../bridge.dart';
|
||||||
import '../frb_generated.dart';
|
import '../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
// These functions are ignored because they are not marked as `pub`: `get_callbacks`
|
// These functions are ignored because they are not marked as `pub`: `get_callbacks`
|
||||||
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `FlutterCallbacks`, `Logging`, `UserDiscoveryCallbacks`
|
// These types are ignored because they are neither used by any `pub` functions nor (for structs and enums) marked `#[frb(unignore)]`: `FlutterCallbacks`, `Logging`, `UserDiscoveryCallbacks`
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: invalid_use_of_internal_member
|
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
||||||
|
|
||||||
import '../../frb_generated.dart';
|
import '../../frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
class FlutterUserDiscovery {
|
class FlutterUserDiscovery {
|
||||||
const FlutterUserDiscovery();
|
const FlutterUserDiscovery();
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,25 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: unused_import, annotate_overrides, non_constant_identifier_names, prefer_const_literals_to_create_immutables
|
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
|
||||||
|
|
||||||
import 'bridge.dart';
|
import 'bridge.dart';
|
||||||
import 'bridge/callbacks.dart';
|
import 'bridge/callbacks.dart';
|
||||||
import 'bridge/wrapper/user_discovery.dart';
|
import 'bridge/wrapper/user_discovery.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:convert';
|
||||||
import 'frb_generated.dart';
|
import 'frb_generated.dart';
|
||||||
import 'frb_generated.io.dart'
|
import 'frb_generated.io.dart'
|
||||||
if (dart.library.js_interop) 'frb_generated.web.dart';
|
if (dart.library.js_interop) 'frb_generated.web.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||||
|
|
||||||
/// Main entrypoint of the Rust API
|
/// Main entrypoint of the Rust API
|
||||||
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||||
RustLib._();
|
|
||||||
@internal
|
@internal
|
||||||
static final instance = RustLib._();
|
static final instance = RustLib._();
|
||||||
|
|
||||||
|
RustLib._();
|
||||||
|
|
||||||
/// Initialize flutter_rust_bridge
|
/// Initialize flutter_rust_bridge
|
||||||
static Future<void> init({
|
static Future<void> init({
|
||||||
RustLibApi? api,
|
RustLibApi? api,
|
||||||
|
|
@ -78,6 +77,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||||
stem: 'rust_lib_twonly',
|
stem: 'rust_lib_twonly',
|
||||||
ioDirectory: 'rust/target/release/',
|
ioDirectory: 'rust/target/release/',
|
||||||
webPrefix: 'pkg/',
|
webPrefix: 'pkg/',
|
||||||
|
wasmBindgenName: 'wasm_bindgen',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -184,7 +184,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
TaskConstMeta
|
TaskConstMeta
|
||||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetCurrentVersionConstMeta =>
|
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetCurrentVersionConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'flutter_user_discovery_get_current_version',
|
debugName: "flutter_user_discovery_get_current_version",
|
||||||
argNames: [],
|
argNames: [],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -222,8 +222,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
TaskConstMeta
|
TaskConstMeta
|
||||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetNewMessagesConstMeta =>
|
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetNewMessagesConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'flutter_user_discovery_get_new_messages',
|
debugName: "flutter_user_discovery_get_new_messages",
|
||||||
argNames: ['contactId', 'receivedVersion'],
|
argNames: ["contactId", "receivedVersion"],
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -260,8 +260,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
TaskConstMeta
|
TaskConstMeta
|
||||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryHandleNewMessagesConstMeta =>
|
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryHandleNewMessagesConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'flutter_user_discovery_handle_new_messages',
|
debugName: "flutter_user_discovery_handle_new_messages",
|
||||||
argNames: ['contactId', 'messages'],
|
argNames: ["contactId", "messages"],
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -300,8 +300,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
TaskConstMeta
|
TaskConstMeta
|
||||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryInitializeOrUpdateConstMeta =>
|
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryInitializeOrUpdateConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'flutter_user_discovery_initialize_or_update',
|
debugName: "flutter_user_discovery_initialize_or_update",
|
||||||
argNames: ['threshold', 'userId', 'publicKey'],
|
argNames: ["threshold", "userId", "publicKey"],
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -338,8 +338,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
TaskConstMeta
|
TaskConstMeta
|
||||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryShouldRequestNewMessagesConstMeta =>
|
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryShouldRequestNewMessagesConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'flutter_user_discovery_should_request_new_messages',
|
debugName: "flutter_user_discovery_should_request_new_messages",
|
||||||
argNames: ['contactId', 'version'],
|
argNames: ["contactId", "version"],
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -469,22 +469,22 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
|
|
||||||
TaskConstMeta get kCrateBridgeCallbacksInitFlutterCallbacksConstMeta =>
|
TaskConstMeta get kCrateBridgeCallbacksInitFlutterCallbacksConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'init_flutter_callbacks',
|
debugName: "init_flutter_callbacks",
|
||||||
argNames: [
|
argNames: [
|
||||||
'loggingGetStreamSink',
|
"loggingGetStreamSink",
|
||||||
'userDiscoverySignData',
|
"userDiscoverySignData",
|
||||||
'userDiscoveryVerifySignature',
|
"userDiscoveryVerifySignature",
|
||||||
'userDiscoveryVerifyStoredPubkey',
|
"userDiscoveryVerifyStoredPubkey",
|
||||||
'userDiscoverySetShares',
|
"userDiscoverySetShares",
|
||||||
'userDiscoveryGetShareForContact',
|
"userDiscoveryGetShareForContact",
|
||||||
'userDiscoveryPushOwnPromotion',
|
"userDiscoveryPushOwnPromotion",
|
||||||
'userDiscoveryGetOwnPromotionsAfterVersion',
|
"userDiscoveryGetOwnPromotionsAfterVersion",
|
||||||
'userDiscoveryStoreOtherPromotion',
|
"userDiscoveryStoreOtherPromotion",
|
||||||
'userDiscoveryGetOtherPromotionsByPublicId',
|
"userDiscoveryGetOtherPromotionsByPublicId",
|
||||||
'userDiscoveryGetAnnouncedUserByPublicId',
|
"userDiscoveryGetAnnouncedUserByPublicId",
|
||||||
'userDiscoveryGetContactVersion',
|
"userDiscoveryGetContactVersion",
|
||||||
'userDiscoverySetContactVersion',
|
"userDiscoverySetContactVersion",
|
||||||
'userDiscoveryPushNewUserRelation',
|
"userDiscoveryPushNewUserRelation",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -517,8 +517,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
|
|
||||||
TaskConstMeta get kCrateBridgeInitializeTwonlyFlutterConstMeta =>
|
TaskConstMeta get kCrateBridgeInitializeTwonlyFlutterConstMeta =>
|
||||||
const TaskConstMeta(
|
const TaskConstMeta(
|
||||||
debugName: 'initialize_twonly_flutter',
|
debugName: "initialize_twonly_flutter",
|
||||||
argNames: ['config'],
|
argNames: ["config"],
|
||||||
);
|
);
|
||||||
|
|
||||||
Future<void> Function(
|
Future<void> Function(
|
||||||
|
|
@ -535,7 +535,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw());
|
rawOutput = Box(await raw());
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -570,7 +570,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -605,7 +605,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -640,7 +640,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -675,7 +675,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -712,7 +712,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -749,7 +749,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -785,7 +785,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0, arg1));
|
rawOutput = Box(await raw(arg0, arg1));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -820,7 +820,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -855,7 +855,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -892,7 +892,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -927,7 +927,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
try {
|
try {
|
||||||
rawOutput = Box(await raw(arg0));
|
rawOutput = Box(await raw(arg0));
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||||
|
|
@ -1123,9 +1123,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
FlutterUserDiscovery dco_decode_flutter_user_discovery(dynamic raw) {
|
FlutterUserDiscovery dco_decode_flutter_user_discovery(dynamic raw) {
|
||||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||||
final arr = raw as List<dynamic>;
|
final arr = raw as List<dynamic>;
|
||||||
if (arr.isNotEmpty)
|
if (arr.length != 0)
|
||||||
throw Exception('unexpected arr length: expect 0 but see ${arr.length}');
|
throw Exception('unexpected arr length: expect 0 but see ${arr.length}');
|
||||||
return const FlutterUserDiscovery();
|
return FlutterUserDiscovery();
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
|
@ -1249,14 +1249,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
@protected
|
@protected
|
||||||
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
|
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final inner = sse_decode_String(deserializer);
|
var inner = sse_decode_String(deserializer);
|
||||||
return AnyhowException(inner);
|
return AnyhowException(inner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
Object sse_decode_DartOpaque(SseDeserializer deserializer) {
|
Object sse_decode_DartOpaque(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final inner = sse_decode_isize(deserializer);
|
var inner = sse_decode_isize(deserializer);
|
||||||
return decodeDartOpaque(inner, generalizedFrbRustBinding);
|
return decodeDartOpaque(inner, generalizedFrbRustBinding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1271,16 +1271,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
@protected
|
@protected
|
||||||
String sse_decode_String(SseDeserializer deserializer) {
|
String sse_decode_String(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final inner = sse_decode_list_prim_u_8_strict(deserializer);
|
var inner = sse_decode_list_prim_u_8_strict(deserializer);
|
||||||
return utf8.decoder.convert(inner);
|
return utf8.decoder.convert(inner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
AnnouncedUser sse_decode_announced_user(SseDeserializer deserializer) {
|
AnnouncedUser sse_decode_announced_user(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final var_userId = sse_decode_i_64(deserializer);
|
var var_userId = sse_decode_i_64(deserializer);
|
||||||
final var_publicKey = sse_decode_list_prim_u_8_strict(deserializer);
|
var var_publicKey = sse_decode_list_prim_u_8_strict(deserializer);
|
||||||
final var_publicId = sse_decode_i_64(deserializer);
|
var var_publicId = sse_decode_i_64(deserializer);
|
||||||
return AnnouncedUser(
|
return AnnouncedUser(
|
||||||
userId: var_userId,
|
userId: var_userId,
|
||||||
publicKey: var_publicKey,
|
publicKey: var_publicKey,
|
||||||
|
|
@ -1299,13 +1299,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
SseDeserializer deserializer,
|
SseDeserializer deserializer,
|
||||||
) {
|
) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
return sse_decode_announced_user(deserializer);
|
return (sse_decode_announced_user(deserializer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer) {
|
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
return sse_decode_i_64(deserializer);
|
return (sse_decode_i_64(deserializer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
|
@ -1313,7 +1313,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
SseDeserializer deserializer,
|
SseDeserializer deserializer,
|
||||||
) {
|
) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
return sse_decode_twonly_config(deserializer);
|
return (sse_decode_twonly_config(deserializer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
|
@ -1321,7 +1321,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
SseDeserializer deserializer,
|
SseDeserializer deserializer,
|
||||||
) {
|
) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
return const FlutterUserDiscovery();
|
return FlutterUserDiscovery();
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
|
@ -1342,8 +1342,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
) {
|
) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
final len_ = sse_decode_i_32(deserializer);
|
var len_ = sse_decode_i_32(deserializer);
|
||||||
final ans_ = <Uint8List>[];
|
var ans_ = <Uint8List>[];
|
||||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||||
ans_.add(sse_decode_list_prim_u_8_strict(deserializer));
|
ans_.add(sse_decode_list_prim_u_8_strict(deserializer));
|
||||||
}
|
}
|
||||||
|
|
@ -1356,8 +1356,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
) {
|
) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
final len_ = sse_decode_i_32(deserializer);
|
var len_ = sse_decode_i_32(deserializer);
|
||||||
final ans_ = <OtherPromotion>[];
|
var ans_ = <OtherPromotion>[];
|
||||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||||
ans_.add(sse_decode_other_promotion(deserializer));
|
ans_.add(sse_decode_other_promotion(deserializer));
|
||||||
}
|
}
|
||||||
|
|
@ -1367,14 +1367,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
@protected
|
@protected
|
||||||
List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) {
|
List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final len_ = sse_decode_i_32(deserializer);
|
var len_ = sse_decode_i_32(deserializer);
|
||||||
return deserializer.buffer.getUint8List(len_);
|
return deserializer.buffer.getUint8List(len_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
|
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final len_ = sse_decode_i_32(deserializer);
|
var len_ = sse_decode_i_32(deserializer);
|
||||||
return deserializer.buffer.getUint8List(len_);
|
return deserializer.buffer.getUint8List(len_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1385,7 +1385,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
if (sse_decode_bool(deserializer)) {
|
if (sse_decode_bool(deserializer)) {
|
||||||
return sse_decode_box_autoadd_announced_user(deserializer);
|
return (sse_decode_box_autoadd_announced_user(deserializer));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1396,7 +1396,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
if (sse_decode_bool(deserializer)) {
|
if (sse_decode_bool(deserializer)) {
|
||||||
return sse_decode_box_autoadd_i_64(deserializer);
|
return (sse_decode_box_autoadd_i_64(deserializer));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1409,7 +1409,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
if (sse_decode_bool(deserializer)) {
|
if (sse_decode_bool(deserializer)) {
|
||||||
return sse_decode_list_list_prim_u_8_strict(deserializer);
|
return (sse_decode_list_list_prim_u_8_strict(deserializer));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1422,7 +1422,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
if (sse_decode_bool(deserializer)) {
|
if (sse_decode_bool(deserializer)) {
|
||||||
return sse_decode_list_other_promotion(deserializer);
|
return (sse_decode_list_other_promotion(deserializer));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1433,7 +1433,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
|
|
||||||
if (sse_decode_bool(deserializer)) {
|
if (sse_decode_bool(deserializer)) {
|
||||||
return sse_decode_list_prim_u_8_strict(deserializer);
|
return (sse_decode_list_prim_u_8_strict(deserializer));
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -1442,12 +1442,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
@protected
|
@protected
|
||||||
OtherPromotion sse_decode_other_promotion(SseDeserializer deserializer) {
|
OtherPromotion sse_decode_other_promotion(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final var_promotionId = sse_decode_u_32(deserializer);
|
var var_promotionId = sse_decode_u_32(deserializer);
|
||||||
final var_publicId = sse_decode_i_64(deserializer);
|
var var_publicId = sse_decode_i_64(deserializer);
|
||||||
final var_fromContactId = sse_decode_i_64(deserializer);
|
var var_fromContactId = sse_decode_i_64(deserializer);
|
||||||
final var_threshold = sse_decode_u_8(deserializer);
|
var var_threshold = sse_decode_u_8(deserializer);
|
||||||
final var_announcementShare = sse_decode_list_prim_u_8_strict(deserializer);
|
var var_announcementShare = sse_decode_list_prim_u_8_strict(deserializer);
|
||||||
final var_publicKeyVerifiedTimestamp = sse_decode_opt_box_autoadd_i_64(
|
var var_publicKeyVerifiedTimestamp = sse_decode_opt_box_autoadd_i_64(
|
||||||
deserializer,
|
deserializer,
|
||||||
);
|
);
|
||||||
return OtherPromotion(
|
return OtherPromotion(
|
||||||
|
|
@ -1463,8 +1463,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
||||||
@protected
|
@protected
|
||||||
TwonlyConfig sse_decode_twonly_config(SseDeserializer deserializer) {
|
TwonlyConfig sse_decode_twonly_config(SseDeserializer deserializer) {
|
||||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||||
final var_databasePath = sse_decode_String(deserializer);
|
var var_databasePath = sse_decode_String(deserializer);
|
||||||
final var_dataDirectory = sse_decode_String(deserializer);
|
var var_dataDirectory = sse_decode_String(deserializer);
|
||||||
return TwonlyConfig(
|
return TwonlyConfig(
|
||||||
databasePath: var_databasePath,
|
databasePath: var_databasePath,
|
||||||
dataDirectory: var_dataDirectory,
|
dataDirectory: var_dataDirectory,
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,16 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: unused_import, unnecessary_import, non_constant_identifier_names, unused_field
|
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||||
|
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:ffi' as ffi;
|
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';
|
|
||||||
|
|
||||||
import 'bridge.dart';
|
import 'bridge.dart';
|
||||||
import 'bridge/callbacks.dart';
|
import 'bridge/callbacks.dart';
|
||||||
import 'bridge/wrapper/user_discovery.dart';
|
import 'bridge/wrapper/user_discovery.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:ffi' as ffi;
|
||||||
import 'frb_generated.dart';
|
import 'frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';
|
||||||
|
|
||||||
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||||
RustLibApiImplPlatform({
|
RustLibApiImplPlatform({
|
||||||
|
|
@ -492,14 +490,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||||
// Section: wire_class
|
// Section: wire_class
|
||||||
|
|
||||||
class RustLibWire implements BaseWire {
|
class RustLibWire implements BaseWire {
|
||||||
/// The symbols are looked up in [dynamicLibrary].
|
|
||||||
RustLibWire(ffi.DynamicLibrary dynamicLibrary)
|
|
||||||
: _lookup = dynamicLibrary.lookup;
|
|
||||||
|
|
||||||
factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) =>
|
factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) =>
|
||||||
RustLibWire(lib.ffiDynamicLibrary);
|
RustLibWire(lib.ffiDynamicLibrary);
|
||||||
|
|
||||||
/// Holds the symbol lookup function.
|
/// Holds the symbol lookup function.
|
||||||
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
|
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
|
||||||
_lookup;
|
_lookup;
|
||||||
|
|
||||||
|
/// The symbols are looked up in [dynamicLibrary].
|
||||||
|
RustLibWire(ffi.DynamicLibrary dynamicLibrary)
|
||||||
|
: _lookup = dynamicLibrary.lookup;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,18 @@
|
||||||
// This file is automatically generated, so please do not edit it.
|
// This file is automatically generated, so please do not edit it.
|
||||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||||
|
|
||||||
// ignore_for_file: unused_import, unnecessary_import, non_constant_identifier_names
|
// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field
|
||||||
|
|
||||||
// Static analysis wrongly picks the IO variant, thus ignore this
|
// Static analysis wrongly picks the IO variant, thus ignore this
|
||||||
|
// ignore_for_file: argument_type_not_assignable
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';
|
|
||||||
|
|
||||||
import 'bridge.dart';
|
import 'bridge.dart';
|
||||||
import 'bridge/callbacks.dart';
|
import 'bridge/callbacks.dart';
|
||||||
import 'bridge/wrapper/user_discovery.dart';
|
import 'bridge/wrapper/user_discovery.dart';
|
||||||
|
import 'dart:async';
|
||||||
|
import 'dart:convert';
|
||||||
import 'frb_generated.dart';
|
import 'frb_generated.dart';
|
||||||
|
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';
|
||||||
|
|
||||||
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||||
RustLibApiImplPlatform({
|
RustLibApiImplPlatform({
|
||||||
|
|
@ -493,7 +492,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||||
// Section: wire_class
|
// Section: wire_class
|
||||||
|
|
||||||
class RustLibWire implements BaseWire {
|
class RustLibWire implements BaseWire {
|
||||||
RustLibWire.fromExternalLibrary();
|
RustLibWire.fromExternalLibrary(ExternalLibrary lib);
|
||||||
}
|
}
|
||||||
|
|
||||||
@JS('wasm_bindgen')
|
@JS('wasm_bindgen')
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@ import 'package:twonly/src/utils/storage.dart';
|
||||||
void main() async {
|
void main() async {
|
||||||
SentryWidgetsFlutterBinding.ensureInitialized();
|
SentryWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
await RustLib.init();
|
|
||||||
await AppEnvironment.init();
|
await AppEnvironment.init();
|
||||||
|
Log.init();
|
||||||
|
|
||||||
initLogger();
|
await RustLib.init();
|
||||||
|
|
||||||
await initFlutterCallbacksForRust();
|
await initFlutterCallbacksForRust();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:mutex/mutex.dart';
|
import 'package:mutex/mutex.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/constants/keyvalue.keys.dart';
|
import 'package:twonly/src/constants/keyvalue.keys.dart';
|
||||||
|
|
@ -62,10 +61,8 @@ Future<bool> initBackgroundExecution() async {
|
||||||
}
|
}
|
||||||
|
|
||||||
SentryWidgetsFlutterBinding.ensureInitialized();
|
SentryWidgetsFlutterBinding.ensureInitialized();
|
||||||
AppEnvironment.cacheDir = (await getApplicationCacheDirectory()).path;
|
await AppEnvironment.init();
|
||||||
AppEnvironment.supportDir = (await getApplicationSupportDirectory()).path;
|
Log.init();
|
||||||
|
|
||||||
initLogger();
|
|
||||||
|
|
||||||
final user = await getUser();
|
final user = await getUser();
|
||||||
if (user == null) return false;
|
if (user == null) return false;
|
||||||
|
|
|
||||||
|
|
@ -8,25 +8,25 @@ import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/utils/exclusive_access.dart';
|
import 'package:twonly/src/utils/exclusive_access.dart';
|
||||||
|
|
||||||
bool _isInitialized = false;
|
|
||||||
|
|
||||||
void initLogger() {
|
|
||||||
if (_isInitialized) return;
|
|
||||||
_isInitialized = true;
|
|
||||||
Logger.root.level = Level.ALL;
|
|
||||||
Logger.root.onRecord.listen((record) async {
|
|
||||||
unawaited(_writeLogToFile(record));
|
|
||||||
if (!kReleaseMode) {
|
|
||||||
// ignore: avoid_print
|
|
||||||
print(
|
|
||||||
'${record.level.name} [twonly] ${record.loggerName} > ${record.message}',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cleanLogFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
class Log {
|
class Log {
|
||||||
|
static bool _isInitialized = false;
|
||||||
|
|
||||||
|
static void init() {
|
||||||
|
if (_isInitialized) return;
|
||||||
|
_isInitialized = true;
|
||||||
|
Logger.root.level = Level.ALL;
|
||||||
|
Logger.root.onRecord.listen((record) async {
|
||||||
|
unawaited(_writeLogToFile(record));
|
||||||
|
if (!kReleaseMode) {
|
||||||
|
// ignore: avoid_print
|
||||||
|
print(
|
||||||
|
'${record.level.name} [twonly] ${record.loggerName} > ${record.message}',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cleanLogFile();
|
||||||
|
}
|
||||||
|
|
||||||
static String filterLogMessage(String msg) {
|
static String filterLogMessage(String msg) {
|
||||||
if (msg.contains('SqliteException')) {
|
if (msg.contains('SqliteException')) {
|
||||||
// Do not log data which would be inserted into the DB.
|
// Do not log data which would be inserted into the DB.
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ macro_rules! callback_generator {
|
||||||
|
|
||||||
// 3. Generate the Automated Init Function
|
// 3. Generate the Automated Init Function
|
||||||
paste::paste! {
|
paste::paste! {
|
||||||
pub async fn init_flutter_callbacks(
|
pub fn init_flutter_callbacks(
|
||||||
$(
|
$(
|
||||||
$(
|
$(
|
||||||
// Parameters: sub-struct_field + _ + fn_name
|
// Parameters: sub-struct_field + _ + fn_name
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ fn wire__crate__bridge__callbacks__init_flutter_callbacks_impl(
|
||||||
rust_vec_len_: i32,
|
rust_vec_len_: i32,
|
||||||
data_len_: i32,
|
data_len_: i32,
|
||||||
) {
|
) {
|
||||||
FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec,_,_,_>(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "init_flutter_callbacks", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || {
|
FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec,_,_>(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "init_flutter_callbacks", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || {
|
||||||
let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) };
|
let message = unsafe { flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(ptr_, rust_vec_len_, data_len_) };
|
||||||
let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
let mut deserializer = flutter_rust_bridge::for_generated::SseDeserializer::new(message);
|
||||||
let api_logging_get_stream_sink = decode_DartFn_Inputs__Output_StreamSink_String_Sse_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
let api_logging_get_stream_sink = decode_DartFn_Inputs__Output_StreamSink_String_Sse_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
||||||
|
|
@ -148,10 +148,10 @@ let api_user_discovery_get_other_promotions_by_public_id = decode_DartFn_Inputs_
|
||||||
let api_user_discovery_get_announced_user_by_public_id = decode_DartFn_Inputs_i_64_Output_opt_box_autoadd_announced_user_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
let api_user_discovery_get_announced_user_by_public_id = decode_DartFn_Inputs_i_64_Output_opt_box_autoadd_announced_user_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
||||||
let api_user_discovery_get_contact_version = decode_DartFn_Inputs_i_64_Output_opt_list_prim_u_8_strict_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
let api_user_discovery_get_contact_version = decode_DartFn_Inputs_i_64_Output_opt_list_prim_u_8_strict_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
||||||
let api_user_discovery_set_contact_version = decode_DartFn_Inputs_i_64_list_prim_u_8_strict_Output_bool_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
let api_user_discovery_set_contact_version = decode_DartFn_Inputs_i_64_list_prim_u_8_strict_Output_bool_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));
|
||||||
let api_user_discovery_push_new_user_relation = decode_DartFn_Inputs_i_64_announced_user_opt_box_autoadd_i_64_Output_bool_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));deserializer.end(); move |context| async move {
|
let api_user_discovery_push_new_user_relation = decode_DartFn_Inputs_i_64_announced_user_opt_box_autoadd_i_64_Output_bool_AnyhowException(<flutter_rust_bridge::DartOpaque>::sse_decode(&mut deserializer));deserializer.end(); move |context| {
|
||||||
transform_result_sse::<_, ()>((move || async move {
|
transform_result_sse::<_, ()>((move || {
|
||||||
let output_ok = Result::<_,()>::Ok({ crate::bridge::callbacks::init_flutter_callbacks(api_logging_get_stream_sink, api_user_discovery_sign_data, api_user_discovery_verify_signature, api_user_discovery_verify_stored_pubkey, api_user_discovery_set_shares, api_user_discovery_get_share_for_contact, api_user_discovery_push_own_promotion, api_user_discovery_get_own_promotions_after_version, api_user_discovery_store_other_promotion, api_user_discovery_get_other_promotions_by_public_id, api_user_discovery_get_announced_user_by_public_id, api_user_discovery_get_contact_version, api_user_discovery_set_contact_version, api_user_discovery_push_new_user_relation).await; })?; Ok(output_ok)
|
let output_ok = Result::<_,()>::Ok({ crate::bridge::callbacks::init_flutter_callbacks(api_logging_get_stream_sink, api_user_discovery_sign_data, api_user_discovery_verify_signature, api_user_discovery_verify_stored_pubkey, api_user_discovery_set_shares, api_user_discovery_get_share_for_contact, api_user_discovery_push_own_promotion, api_user_discovery_get_own_promotions_after_version, api_user_discovery_store_other_promotion, api_user_discovery_get_other_promotions_by_public_id, api_user_discovery_get_announced_user_by_public_id, api_user_discovery_get_contact_version, api_user_discovery_set_contact_version, api_user_discovery_push_new_user_relation); })?; Ok(output_ok)
|
||||||
})().await)
|
})())
|
||||||
} })
|
} })
|
||||||
}
|
}
|
||||||
fn wire__crate__bridge__initialize_twonly_flutter_impl(
|
fn wire__crate__bridge__initialize_twonly_flutter_impl(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue