mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-24 23:32:13 +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
|
||||
the Flutter engine draws its first frame -->
|
||||
<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>
|
||||
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||
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>
|
||||
</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>
|
||||
<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"/>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
// This file is automatically generated, so please do not edit it.
|
||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
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 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);
|
||||
|
||||
class AnnouncedUser {
|
||||
final PlatformInt64 userId;
|
||||
final Uint8List publicKey;
|
||||
final PlatformInt64 publicId;
|
||||
|
||||
const AnnouncedUser({
|
||||
required this.userId,
|
||||
required this.publicKey,
|
||||
required this.publicId,
|
||||
});
|
||||
final PlatformInt64 userId;
|
||||
final Uint8List publicKey;
|
||||
final PlatformInt64 publicId;
|
||||
|
||||
@override
|
||||
int get hashCode => userId.hashCode ^ publicKey.hashCode ^ publicId.hashCode;
|
||||
|
|
@ -37,6 +37,13 @@ class AnnouncedUser {
|
|||
}
|
||||
|
||||
class OtherPromotion {
|
||||
final int promotionId;
|
||||
final PlatformInt64 publicId;
|
||||
final PlatformInt64 fromContactId;
|
||||
final int threshold;
|
||||
final Uint8List announcementShare;
|
||||
final PlatformInt64? publicKeyVerifiedTimestamp;
|
||||
|
||||
const OtherPromotion({
|
||||
required this.promotionId,
|
||||
required this.publicId,
|
||||
|
|
@ -45,12 +52,6 @@ class OtherPromotion {
|
|||
required this.announcementShare,
|
||||
this.publicKeyVerifiedTimestamp,
|
||||
});
|
||||
final int promotionId;
|
||||
final PlatformInt64 publicId;
|
||||
final PlatformInt64 fromContactId;
|
||||
final int threshold;
|
||||
final Uint8List announcementShare;
|
||||
final PlatformInt64? publicKeyVerifiedTimestamp;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
|
|
@ -75,12 +76,13 @@ class OtherPromotion {
|
|||
}
|
||||
|
||||
class TwonlyConfig {
|
||||
final String databasePath;
|
||||
final String dataDirectory;
|
||||
|
||||
const TwonlyConfig({
|
||||
required this.databasePath,
|
||||
required this.dataDirectory,
|
||||
});
|
||||
final String databasePath;
|
||||
final String dataDirectory;
|
||||
|
||||
@override
|
||||
int get hashCode => databasePath.hashCode ^ dataDirectory.hashCode;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
// This file is automatically generated, so please do not edit it.
|
||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
import '../bridge.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 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.
|
||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||
|
||||
// ignore_for_file: invalid_use_of_internal_member
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
|
||||
|
||||
import '../../frb_generated.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
|
||||
class FlutterUserDiscovery {
|
||||
const FlutterUserDiscovery();
|
||||
|
|
|
|||
|
|
@ -1,26 +1,25 @@
|
|||
// This file is automatically generated, so please do not edit it.
|
||||
// @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
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
// 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 'bridge.dart';
|
||||
import 'bridge/callbacks.dart';
|
||||
import 'bridge/wrapper/user_discovery.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'frb_generated.dart';
|
||||
import 'frb_generated.io.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
|
||||
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
||||
RustLib._();
|
||||
@internal
|
||||
static final instance = RustLib._();
|
||||
|
||||
RustLib._();
|
||||
|
||||
/// Initialize flutter_rust_bridge
|
||||
static Future<void> init({
|
||||
RustLibApi? api,
|
||||
|
|
@ -78,6 +77,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
|
|||
stem: 'rust_lib_twonly',
|
||||
ioDirectory: 'rust/target/release/',
|
||||
webPrefix: 'pkg/',
|
||||
wasmBindgenName: 'wasm_bindgen',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
TaskConstMeta
|
||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetCurrentVersionConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'flutter_user_discovery_get_current_version',
|
||||
debugName: "flutter_user_discovery_get_current_version",
|
||||
argNames: [],
|
||||
);
|
||||
|
||||
|
|
@ -222,8 +222,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
TaskConstMeta
|
||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryGetNewMessagesConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'flutter_user_discovery_get_new_messages',
|
||||
argNames: ['contactId', 'receivedVersion'],
|
||||
debugName: "flutter_user_discovery_get_new_messages",
|
||||
argNames: ["contactId", "receivedVersion"],
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
@ -260,8 +260,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
TaskConstMeta
|
||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryHandleNewMessagesConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'flutter_user_discovery_handle_new_messages',
|
||||
argNames: ['contactId', 'messages'],
|
||||
debugName: "flutter_user_discovery_handle_new_messages",
|
||||
argNames: ["contactId", "messages"],
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
@ -300,8 +300,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
TaskConstMeta
|
||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryInitializeOrUpdateConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'flutter_user_discovery_initialize_or_update',
|
||||
argNames: ['threshold', 'userId', 'publicKey'],
|
||||
debugName: "flutter_user_discovery_initialize_or_update",
|
||||
argNames: ["threshold", "userId", "publicKey"],
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
@ -338,8 +338,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
TaskConstMeta
|
||||
get kCrateBridgeWrapperUserDiscoveryFlutterUserDiscoveryShouldRequestNewMessagesConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'flutter_user_discovery_should_request_new_messages',
|
||||
argNames: ['contactId', 'version'],
|
||||
debugName: "flutter_user_discovery_should_request_new_messages",
|
||||
argNames: ["contactId", "version"],
|
||||
);
|
||||
|
||||
@override
|
||||
|
|
@ -469,22 +469,22 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
|
||||
TaskConstMeta get kCrateBridgeCallbacksInitFlutterCallbacksConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'init_flutter_callbacks',
|
||||
debugName: "init_flutter_callbacks",
|
||||
argNames: [
|
||||
'loggingGetStreamSink',
|
||||
'userDiscoverySignData',
|
||||
'userDiscoveryVerifySignature',
|
||||
'userDiscoveryVerifyStoredPubkey',
|
||||
'userDiscoverySetShares',
|
||||
'userDiscoveryGetShareForContact',
|
||||
'userDiscoveryPushOwnPromotion',
|
||||
'userDiscoveryGetOwnPromotionsAfterVersion',
|
||||
'userDiscoveryStoreOtherPromotion',
|
||||
'userDiscoveryGetOtherPromotionsByPublicId',
|
||||
'userDiscoveryGetAnnouncedUserByPublicId',
|
||||
'userDiscoveryGetContactVersion',
|
||||
'userDiscoverySetContactVersion',
|
||||
'userDiscoveryPushNewUserRelation',
|
||||
"loggingGetStreamSink",
|
||||
"userDiscoverySignData",
|
||||
"userDiscoveryVerifySignature",
|
||||
"userDiscoveryVerifyStoredPubkey",
|
||||
"userDiscoverySetShares",
|
||||
"userDiscoveryGetShareForContact",
|
||||
"userDiscoveryPushOwnPromotion",
|
||||
"userDiscoveryGetOwnPromotionsAfterVersion",
|
||||
"userDiscoveryStoreOtherPromotion",
|
||||
"userDiscoveryGetOtherPromotionsByPublicId",
|
||||
"userDiscoveryGetAnnouncedUserByPublicId",
|
||||
"userDiscoveryGetContactVersion",
|
||||
"userDiscoverySetContactVersion",
|
||||
"userDiscoveryPushNewUserRelation",
|
||||
],
|
||||
);
|
||||
|
||||
|
|
@ -517,8 +517,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
|
||||
TaskConstMeta get kCrateBridgeInitializeTwonlyFlutterConstMeta =>
|
||||
const TaskConstMeta(
|
||||
debugName: 'initialize_twonly_flutter',
|
||||
argNames: ['config'],
|
||||
debugName: "initialize_twonly_flutter",
|
||||
argNames: ["config"],
|
||||
);
|
||||
|
||||
Future<void> Function(
|
||||
|
|
@ -535,7 +535,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw());
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -570,7 +570,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -605,7 +605,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -640,7 +640,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -675,7 +675,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -712,7 +712,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -749,7 +749,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -785,7 +785,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0, arg1));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -820,7 +820,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -855,7 +855,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -892,7 +892,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0, arg1, arg2));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -927,7 +927,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
try {
|
||||
rawOutput = Box(await raw(arg0));
|
||||
} catch (e, s) {
|
||||
rawError = Box(AnyhowException('$e\n\n$s'));
|
||||
rawError = Box(AnyhowException("$e\n\n$s"));
|
||||
}
|
||||
|
||||
final serializer = SseSerializer(generalizedFrbRustBinding);
|
||||
|
|
@ -1123,9 +1123,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
FlutterUserDiscovery dco_decode_flutter_user_discovery(dynamic raw) {
|
||||
// Codec=Dco (DartCObject based), see doc to use other codecs
|
||||
final arr = raw as List<dynamic>;
|
||||
if (arr.isNotEmpty)
|
||||
if (arr.length != 0)
|
||||
throw Exception('unexpected arr length: expect 0 but see ${arr.length}');
|
||||
return const FlutterUserDiscovery();
|
||||
return FlutterUserDiscovery();
|
||||
}
|
||||
|
||||
@protected
|
||||
|
|
@ -1249,14 +1249,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
@protected
|
||||
AnyhowException sse_decode_AnyhowException(SseDeserializer deserializer) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
@protected
|
||||
Object sse_decode_DartOpaque(SseDeserializer deserializer) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
|
@ -1271,16 +1271,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
@protected
|
||||
String sse_decode_String(SseDeserializer deserializer) {
|
||||
// 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);
|
||||
}
|
||||
|
||||
@protected
|
||||
AnnouncedUser sse_decode_announced_user(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
final var_userId = sse_decode_i_64(deserializer);
|
||||
final var_publicKey = sse_decode_list_prim_u_8_strict(deserializer);
|
||||
final var_publicId = sse_decode_i_64(deserializer);
|
||||
var var_userId = sse_decode_i_64(deserializer);
|
||||
var var_publicKey = sse_decode_list_prim_u_8_strict(deserializer);
|
||||
var var_publicId = sse_decode_i_64(deserializer);
|
||||
return AnnouncedUser(
|
||||
userId: var_userId,
|
||||
publicKey: var_publicKey,
|
||||
|
|
@ -1299,13 +1299,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
SseDeserializer deserializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return sse_decode_announced_user(deserializer);
|
||||
return (sse_decode_announced_user(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
PlatformInt64 sse_decode_box_autoadd_i_64(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return sse_decode_i_64(deserializer);
|
||||
return (sse_decode_i_64(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
|
|
@ -1313,7 +1313,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
SseDeserializer deserializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return sse_decode_twonly_config(deserializer);
|
||||
return (sse_decode_twonly_config(deserializer));
|
||||
}
|
||||
|
||||
@protected
|
||||
|
|
@ -1321,7 +1321,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
SseDeserializer deserializer,
|
||||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
return const FlutterUserDiscovery();
|
||||
return FlutterUserDiscovery();
|
||||
}
|
||||
|
||||
@protected
|
||||
|
|
@ -1342,8 +1342,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
final len_ = sse_decode_i_32(deserializer);
|
||||
final ans_ = <Uint8List>[];
|
||||
var len_ = sse_decode_i_32(deserializer);
|
||||
var ans_ = <Uint8List>[];
|
||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||
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
|
||||
|
||||
final len_ = sse_decode_i_32(deserializer);
|
||||
final ans_ = <OtherPromotion>[];
|
||||
var len_ = sse_decode_i_32(deserializer);
|
||||
var ans_ = <OtherPromotion>[];
|
||||
for (var idx_ = 0; idx_ < len_; ++idx_) {
|
||||
ans_.add(sse_decode_other_promotion(deserializer));
|
||||
}
|
||||
|
|
@ -1367,14 +1367,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
@protected
|
||||
List<int> sse_decode_list_prim_u_8_loose(SseDeserializer deserializer) {
|
||||
// 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_);
|
||||
}
|
||||
|
||||
@protected
|
||||
Uint8List sse_decode_list_prim_u_8_strict(SseDeserializer deserializer) {
|
||||
// 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_);
|
||||
}
|
||||
|
||||
|
|
@ -1385,7 +1385,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return sse_decode_box_autoadd_announced_user(deserializer);
|
||||
return (sse_decode_box_autoadd_announced_user(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1396,7 +1396,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return sse_decode_box_autoadd_i_64(deserializer);
|
||||
return (sse_decode_box_autoadd_i_64(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1409,7 +1409,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
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 {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1422,7 +1422,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return sse_decode_list_other_promotion(deserializer);
|
||||
return (sse_decode_list_other_promotion(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1433,7 +1433,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
|
||||
if (sse_decode_bool(deserializer)) {
|
||||
return sse_decode_list_prim_u_8_strict(deserializer);
|
||||
return (sse_decode_list_prim_u_8_strict(deserializer));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1442,12 +1442,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
@protected
|
||||
OtherPromotion sse_decode_other_promotion(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
final var_promotionId = sse_decode_u_32(deserializer);
|
||||
final var_publicId = sse_decode_i_64(deserializer);
|
||||
final var_fromContactId = sse_decode_i_64(deserializer);
|
||||
final var_threshold = sse_decode_u_8(deserializer);
|
||||
final var_announcementShare = sse_decode_list_prim_u_8_strict(deserializer);
|
||||
final var_publicKeyVerifiedTimestamp = sse_decode_opt_box_autoadd_i_64(
|
||||
var var_promotionId = sse_decode_u_32(deserializer);
|
||||
var var_publicId = sse_decode_i_64(deserializer);
|
||||
var var_fromContactId = sse_decode_i_64(deserializer);
|
||||
var var_threshold = sse_decode_u_8(deserializer);
|
||||
var var_announcementShare = sse_decode_list_prim_u_8_strict(deserializer);
|
||||
var var_publicKeyVerifiedTimestamp = sse_decode_opt_box_autoadd_i_64(
|
||||
deserializer,
|
||||
);
|
||||
return OtherPromotion(
|
||||
|
|
@ -1463,8 +1463,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
|
|||
@protected
|
||||
TwonlyConfig sse_decode_twonly_config(SseDeserializer deserializer) {
|
||||
// Codec=Sse (Serialization based), see doc to use other codecs
|
||||
final var_databasePath = sse_decode_String(deserializer);
|
||||
final var_dataDirectory = sse_decode_String(deserializer);
|
||||
var var_databasePath = sse_decode_String(deserializer);
|
||||
var var_dataDirectory = sse_decode_String(deserializer);
|
||||
return TwonlyConfig(
|
||||
databasePath: var_databasePath,
|
||||
dataDirectory: var_dataDirectory,
|
||||
|
|
|
|||
|
|
@ -1,18 +1,16 @@
|
|||
// This file is automatically generated, so please do not edit it.
|
||||
// @generated by `flutter_rust_bridge`@ 2.12.0.
|
||||
|
||||
// ignore_for_file: unused_import, unnecessary_import, non_constant_identifier_names, 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';
|
||||
// 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 'bridge.dart';
|
||||
import 'bridge/callbacks.dart';
|
||||
import 'bridge/wrapper/user_discovery.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:ffi' as ffi;
|
||||
import 'frb_generated.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';
|
||||
|
||||
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
RustLibApiImplPlatform({
|
||||
|
|
@ -492,14 +490,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
|||
// Section: wire_class
|
||||
|
||||
class RustLibWire implements BaseWire {
|
||||
/// The symbols are looked up in [dynamicLibrary].
|
||||
RustLibWire(ffi.DynamicLibrary dynamicLibrary)
|
||||
: _lookup = dynamicLibrary.lookup;
|
||||
|
||||
factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) =>
|
||||
RustLibWire(lib.ffiDynamicLibrary);
|
||||
|
||||
/// Holds the symbol lookup function.
|
||||
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
|
||||
_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.
|
||||
// @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
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';
|
||||
// ignore_for_file: argument_type_not_assignable
|
||||
|
||||
import 'bridge.dart';
|
||||
import 'bridge/callbacks.dart';
|
||||
import 'bridge/wrapper/user_discovery.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'frb_generated.dart';
|
||||
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';
|
||||
|
||||
abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
||||
RustLibApiImplPlatform({
|
||||
|
|
@ -493,7 +492,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
|
|||
// Section: wire_class
|
||||
|
||||
class RustLibWire implements BaseWire {
|
||||
RustLibWire.fromExternalLibrary();
|
||||
RustLibWire.fromExternalLibrary(ExternalLibrary lib);
|
||||
}
|
||||
|
||||
@JS('wasm_bindgen')
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ import 'package:twonly/src/utils/storage.dart';
|
|||
void main() async {
|
||||
SentryWidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await RustLib.init();
|
||||
await AppEnvironment.init();
|
||||
Log.init();
|
||||
|
||||
initLogger();
|
||||
await RustLib.init();
|
||||
|
||||
await initFlutterCallbacksForRust();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'package:mutex/mutex.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
import 'package:twonly/globals.dart';
|
||||
import 'package:twonly/src/constants/keyvalue.keys.dart';
|
||||
|
|
@ -62,10 +61,8 @@ Future<bool> initBackgroundExecution() async {
|
|||
}
|
||||
|
||||
SentryWidgetsFlutterBinding.ensureInitialized();
|
||||
AppEnvironment.cacheDir = (await getApplicationCacheDirectory()).path;
|
||||
AppEnvironment.supportDir = (await getApplicationSupportDirectory()).path;
|
||||
|
||||
initLogger();
|
||||
await AppEnvironment.init();
|
||||
Log.init();
|
||||
|
||||
final user = await getUser();
|
||||
if (user == null) return false;
|
||||
|
|
|
|||
|
|
@ -8,25 +8,25 @@ import 'package:sentry_flutter/sentry_flutter.dart';
|
|||
import 'package:twonly/globals.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 {
|
||||
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) {
|
||||
if (msg.contains('SqliteException')) {
|
||||
// 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
|
||||
paste::paste! {
|
||||
pub async fn init_flutter_callbacks(
|
||||
pub fn init_flutter_callbacks(
|
||||
$(
|
||||
$(
|
||||
// Parameters: sub-struct_field + _ + fn_name
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ fn wire__crate__bridge__callbacks__init_flutter_callbacks_impl(
|
|||
rust_vec_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 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));
|
||||
|
|
@ -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_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_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 {
|
||||
transform_result_sse::<_, ()>((move || async 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)
|
||||
})().await)
|
||||
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 || {
|
||||
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)
|
||||
})())
|
||||
} })
|
||||
}
|
||||
fn wire__crate__bridge__initialize_twonly_flutter_impl(
|
||||
|
|
|
|||
Loading…
Reference in a new issue