mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:48:41 +00:00
fix #348
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
82f4c9af9f
commit
027871290d
11 changed files with 151 additions and 122 deletions
10
lib/app.dart
10
lib/app.dart
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
@ -157,11 +158,13 @@ class _AppMainWidgetState extends State<AppMainWidget> {
|
||||||
bool _showOnboarding = true;
|
bool _showOnboarding = true;
|
||||||
bool _isLoaded = false;
|
bool _isLoaded = false;
|
||||||
bool _skipBackup = false;
|
bool _skipBackup = false;
|
||||||
|
int _initialPage = 0;
|
||||||
|
|
||||||
(Future<int>?, bool) _proofOfWork = (null, false);
|
(Future<int>?, bool) _proofOfWork = (null, false);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
|
_initialPage = widget.initialPage;
|
||||||
initAsync();
|
initAsync();
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
@ -173,6 +176,9 @@ class _AppMainWidgetState extends State<AppMainWidget> {
|
||||||
if (gUser.appVersion < 62) {
|
if (gUser.appVersion < 62) {
|
||||||
_showDatabaseMigration = true;
|
_showDatabaseMigration = true;
|
||||||
}
|
}
|
||||||
|
if (!gUser.startWithCameraOpen) {
|
||||||
|
_initialPage = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_isUserCreated && !_showDatabaseMigration) {
|
if (!_isUserCreated && !_showDatabaseMigration) {
|
||||||
|
|
@ -205,7 +211,7 @@ class _AppMainWidgetState extends State<AppMainWidget> {
|
||||||
if (_showDatabaseMigration) {
|
if (_showDatabaseMigration) {
|
||||||
child = const DatabaseMigrationView();
|
child = const DatabaseMigrationView();
|
||||||
} else if (_isUserCreated) {
|
} else if (_isUserCreated) {
|
||||||
if (gUser.twonlySafeBackup == null && !_skipBackup) {
|
if (gUser.twonlySafeBackup == null && !_skipBackup && kReleaseMode) {
|
||||||
child = TwonlyIdentityBackupView(
|
child = TwonlyIdentityBackupView(
|
||||||
callBack: () {
|
callBack: () {
|
||||||
_skipBackup = true;
|
_skipBackup = true;
|
||||||
|
|
@ -214,7 +220,7 @@ class _AppMainWidgetState extends State<AppMainWidget> {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
child = HomeView(
|
child = HomeView(
|
||||||
initialPage: widget.initialPage,
|
initialPage: _initialPage,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (_showOnboarding) {
|
} else if (_showOnboarding) {
|
||||||
|
|
|
||||||
|
|
@ -7111,10 +7111,7 @@ class $GroupHistoriesTable extends GroupHistories
|
||||||
@override
|
@override
|
||||||
late final GeneratedColumn<int> affectedContactId = GeneratedColumn<int>(
|
late final GeneratedColumn<int> affectedContactId = GeneratedColumn<int>(
|
||||||
'affected_contact_id', aliasedName, true,
|
'affected_contact_id', aliasedName, true,
|
||||||
type: DriftSqlType.int,
|
type: DriftSqlType.int, requiredDuringInsert: false);
|
||||||
requiredDuringInsert: false,
|
|
||||||
defaultConstraints:
|
|
||||||
GeneratedColumn.constraintIsAlways('REFERENCES contacts (user_id)'));
|
|
||||||
static const VerificationMeta _oldGroupNameMeta =
|
static const VerificationMeta _oldGroupNameMeta =
|
||||||
const VerificationMeta('oldGroupName');
|
const VerificationMeta('oldGroupName');
|
||||||
@override
|
@override
|
||||||
|
|
@ -7896,6 +7893,22 @@ final class $$ContactsTableReferences
|
||||||
return ProcessedTableManager(
|
return ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: cache));
|
manager.$state.copyWith(prefetchedData: cache));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static MultiTypedResultKey<$GroupHistoriesTable, List<GroupHistory>>
|
||||||
|
_groupHistoriesRefsTable(_$TwonlyDB db) =>
|
||||||
|
MultiTypedResultKey.fromTable(db.groupHistories,
|
||||||
|
aliasName: $_aliasNameGenerator(
|
||||||
|
db.contacts.userId, db.groupHistories.contactId));
|
||||||
|
|
||||||
|
$$GroupHistoriesTableProcessedTableManager get groupHistoriesRefs {
|
||||||
|
final manager = $$GroupHistoriesTableTableManager($_db, $_db.groupHistories)
|
||||||
|
.filter(
|
||||||
|
(f) => f.contactId.userId.sqlEquals($_itemColumn<int>('user_id')!));
|
||||||
|
|
||||||
|
final cache = $_typedResult.readTableOrNull(_groupHistoriesRefsTable($_db));
|
||||||
|
return ProcessedTableManager(
|
||||||
|
manager.$state.copyWith(prefetchedData: cache));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$ContactsTableFilterComposer
|
class $$ContactsTableFilterComposer
|
||||||
|
|
@ -8078,6 +8091,27 @@ class $$ContactsTableFilterComposer
|
||||||
));
|
));
|
||||||
return f(composer);
|
return f(composer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Expression<bool> groupHistoriesRefs(
|
||||||
|
Expression<bool> Function($$GroupHistoriesTableFilterComposer f) f) {
|
||||||
|
final $$GroupHistoriesTableFilterComposer composer = $composerBuilder(
|
||||||
|
composer: this,
|
||||||
|
getCurrentColumn: (t) => t.userId,
|
||||||
|
referencedTable: $db.groupHistories,
|
||||||
|
getReferencedColumn: (t) => t.contactId,
|
||||||
|
builder: (joinBuilder,
|
||||||
|
{$addJoinBuilderToRootComposer,
|
||||||
|
$removeJoinBuilderFromRootComposer}) =>
|
||||||
|
$$GroupHistoriesTableFilterComposer(
|
||||||
|
$db: $db,
|
||||||
|
$table: $db.groupHistories,
|
||||||
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
));
|
||||||
|
return f(composer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$ContactsTableOrderingComposer
|
class $$ContactsTableOrderingComposer
|
||||||
|
|
@ -8311,6 +8345,27 @@ class $$ContactsTableAnnotationComposer
|
||||||
));
|
));
|
||||||
return f(composer);
|
return f(composer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Expression<T> groupHistoriesRefs<T extends Object>(
|
||||||
|
Expression<T> Function($$GroupHistoriesTableAnnotationComposer a) f) {
|
||||||
|
final $$GroupHistoriesTableAnnotationComposer composer = $composerBuilder(
|
||||||
|
composer: this,
|
||||||
|
getCurrentColumn: (t) => t.userId,
|
||||||
|
referencedTable: $db.groupHistories,
|
||||||
|
getReferencedColumn: (t) => t.contactId,
|
||||||
|
builder: (joinBuilder,
|
||||||
|
{$addJoinBuilderToRootComposer,
|
||||||
|
$removeJoinBuilderFromRootComposer}) =>
|
||||||
|
$$GroupHistoriesTableAnnotationComposer(
|
||||||
|
$db: $db,
|
||||||
|
$table: $db.groupHistories,
|
||||||
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
||||||
|
joinBuilder: joinBuilder,
|
||||||
|
$removeJoinBuilderFromRootComposer:
|
||||||
|
$removeJoinBuilderFromRootComposer,
|
||||||
|
));
|
||||||
|
return f(composer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$ContactsTableTableManager extends RootTableManager<
|
class $$ContactsTableTableManager extends RootTableManager<
|
||||||
|
|
@ -8330,7 +8385,8 @@ class $$ContactsTableTableManager extends RootTableManager<
|
||||||
bool groupMembersRefs,
|
bool groupMembersRefs,
|
||||||
bool receiptsRefs,
|
bool receiptsRefs,
|
||||||
bool signalContactPreKeysRefs,
|
bool signalContactPreKeysRefs,
|
||||||
bool signalContactSignedPreKeysRefs})> {
|
bool signalContactSignedPreKeysRefs,
|
||||||
|
bool groupHistoriesRefs})> {
|
||||||
$$ContactsTableTableManager(_$TwonlyDB db, $ContactsTable table)
|
$$ContactsTableTableManager(_$TwonlyDB db, $ContactsTable table)
|
||||||
: super(TableManagerState(
|
: super(TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
|
|
@ -8411,7 +8467,8 @@ class $$ContactsTableTableManager extends RootTableManager<
|
||||||
groupMembersRefs = false,
|
groupMembersRefs = false,
|
||||||
receiptsRefs = false,
|
receiptsRefs = false,
|
||||||
signalContactPreKeysRefs = false,
|
signalContactPreKeysRefs = false,
|
||||||
signalContactSignedPreKeysRefs = false}) {
|
signalContactSignedPreKeysRefs = false,
|
||||||
|
groupHistoriesRefs = false}) {
|
||||||
return PrefetchHooks(
|
return PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [
|
explicitlyWatchedTables: [
|
||||||
|
|
@ -8421,7 +8478,8 @@ class $$ContactsTableTableManager extends RootTableManager<
|
||||||
if (receiptsRefs) db.receipts,
|
if (receiptsRefs) db.receipts,
|
||||||
if (signalContactPreKeysRefs) db.signalContactPreKeys,
|
if (signalContactPreKeysRefs) db.signalContactPreKeys,
|
||||||
if (signalContactSignedPreKeysRefs)
|
if (signalContactSignedPreKeysRefs)
|
||||||
db.signalContactSignedPreKeys
|
db.signalContactSignedPreKeys,
|
||||||
|
if (groupHistoriesRefs) db.groupHistories
|
||||||
],
|
],
|
||||||
addJoins: null,
|
addJoins: null,
|
||||||
getPrefetchedDataCallback: (items) async {
|
getPrefetchedDataCallback: (items) async {
|
||||||
|
|
@ -8501,6 +8559,19 @@ class $$ContactsTableTableManager extends RootTableManager<
|
||||||
referencedItemsForCurrentItem:
|
referencedItemsForCurrentItem:
|
||||||
(item, referencedItems) => referencedItems
|
(item, referencedItems) => referencedItems
|
||||||
.where((e) => e.contactId == item.userId),
|
.where((e) => e.contactId == item.userId),
|
||||||
|
typedResults: items),
|
||||||
|
if (groupHistoriesRefs)
|
||||||
|
await $_getPrefetchedData<Contact, $ContactsTable,
|
||||||
|
GroupHistory>(
|
||||||
|
currentTable: table,
|
||||||
|
referencedTable: $$ContactsTableReferences
|
||||||
|
._groupHistoriesRefsTable(db),
|
||||||
|
managerFromTypedResult: (p0) =>
|
||||||
|
$$ContactsTableReferences(db, table, p0)
|
||||||
|
.groupHistoriesRefs,
|
||||||
|
referencedItemsForCurrentItem:
|
||||||
|
(item, referencedItems) => referencedItems
|
||||||
|
.where((e) => e.contactId == item.userId),
|
||||||
typedResults: items)
|
typedResults: items)
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
@ -8526,7 +8597,8 @@ typedef $$ContactsTableProcessedTableManager = ProcessedTableManager<
|
||||||
bool groupMembersRefs,
|
bool groupMembersRefs,
|
||||||
bool receiptsRefs,
|
bool receiptsRefs,
|
||||||
bool signalContactPreKeysRefs,
|
bool signalContactPreKeysRefs,
|
||||||
bool signalContactSignedPreKeysRefs})>;
|
bool signalContactSignedPreKeysRefs,
|
||||||
|
bool groupHistoriesRefs})>;
|
||||||
typedef $$GroupsTableCreateCompanionBuilder = GroupsCompanion Function({
|
typedef $$GroupsTableCreateCompanionBuilder = GroupsCompanion Function({
|
||||||
required String groupId,
|
required String groupId,
|
||||||
Value<bool> isGroupAdmin,
|
Value<bool> isGroupAdmin,
|
||||||
|
|
@ -13600,21 +13672,6 @@ final class $$GroupHistoriesTableReferences
|
||||||
return ProcessedTableManager(
|
return ProcessedTableManager(
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
manager.$state.copyWith(prefetchedData: [item]));
|
||||||
}
|
}
|
||||||
|
|
||||||
static $ContactsTable _affectedContactIdTable(_$TwonlyDB db) =>
|
|
||||||
db.contacts.createAlias($_aliasNameGenerator(
|
|
||||||
db.groupHistories.affectedContactId, db.contacts.userId));
|
|
||||||
|
|
||||||
$$ContactsTableProcessedTableManager? get affectedContactId {
|
|
||||||
final $_column = $_itemColumn<int>('affected_contact_id');
|
|
||||||
if ($_column == null) return null;
|
|
||||||
final manager = $$ContactsTableTableManager($_db, $_db.contacts)
|
|
||||||
.filter((f) => f.userId.sqlEquals($_column));
|
|
||||||
final item = $_typedResult.readTableOrNull(_affectedContactIdTable($_db));
|
|
||||||
if (item == null) return manager;
|
|
||||||
return ProcessedTableManager(
|
|
||||||
manager.$state.copyWith(prefetchedData: [item]));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$GroupHistoriesTableFilterComposer
|
class $$GroupHistoriesTableFilterComposer
|
||||||
|
|
@ -13630,6 +13687,10 @@ class $$GroupHistoriesTableFilterComposer
|
||||||
column: $table.groupHistoryId,
|
column: $table.groupHistoryId,
|
||||||
builder: (column) => ColumnFilters(column));
|
builder: (column) => ColumnFilters(column));
|
||||||
|
|
||||||
|
ColumnFilters<int> get affectedContactId => $composableBuilder(
|
||||||
|
column: $table.affectedContactId,
|
||||||
|
builder: (column) => ColumnFilters(column));
|
||||||
|
|
||||||
ColumnFilters<String> get oldGroupName => $composableBuilder(
|
ColumnFilters<String> get oldGroupName => $composableBuilder(
|
||||||
column: $table.oldGroupName, builder: (column) => ColumnFilters(column));
|
column: $table.oldGroupName, builder: (column) => ColumnFilters(column));
|
||||||
|
|
||||||
|
|
@ -13688,26 +13749,6 @@ class $$GroupHistoriesTableFilterComposer
|
||||||
));
|
));
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$ContactsTableFilterComposer get affectedContactId {
|
|
||||||
final $$ContactsTableFilterComposer composer = $composerBuilder(
|
|
||||||
composer: this,
|
|
||||||
getCurrentColumn: (t) => t.affectedContactId,
|
|
||||||
referencedTable: $db.contacts,
|
|
||||||
getReferencedColumn: (t) => t.userId,
|
|
||||||
builder: (joinBuilder,
|
|
||||||
{$addJoinBuilderToRootComposer,
|
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
|
||||||
$$ContactsTableFilterComposer(
|
|
||||||
$db: $db,
|
|
||||||
$table: $db.contacts,
|
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
||||||
joinBuilder: joinBuilder,
|
|
||||||
$removeJoinBuilderFromRootComposer:
|
|
||||||
$removeJoinBuilderFromRootComposer,
|
|
||||||
));
|
|
||||||
return composer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$GroupHistoriesTableOrderingComposer
|
class $$GroupHistoriesTableOrderingComposer
|
||||||
|
|
@ -13723,6 +13764,10 @@ class $$GroupHistoriesTableOrderingComposer
|
||||||
column: $table.groupHistoryId,
|
column: $table.groupHistoryId,
|
||||||
builder: (column) => ColumnOrderings(column));
|
builder: (column) => ColumnOrderings(column));
|
||||||
|
|
||||||
|
ColumnOrderings<int> get affectedContactId => $composableBuilder(
|
||||||
|
column: $table.affectedContactId,
|
||||||
|
builder: (column) => ColumnOrderings(column));
|
||||||
|
|
||||||
ColumnOrderings<String> get oldGroupName => $composableBuilder(
|
ColumnOrderings<String> get oldGroupName => $composableBuilder(
|
||||||
column: $table.oldGroupName,
|
column: $table.oldGroupName,
|
||||||
builder: (column) => ColumnOrderings(column));
|
builder: (column) => ColumnOrderings(column));
|
||||||
|
|
@ -13781,26 +13826,6 @@ class $$GroupHistoriesTableOrderingComposer
|
||||||
));
|
));
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$ContactsTableOrderingComposer get affectedContactId {
|
|
||||||
final $$ContactsTableOrderingComposer composer = $composerBuilder(
|
|
||||||
composer: this,
|
|
||||||
getCurrentColumn: (t) => t.affectedContactId,
|
|
||||||
referencedTable: $db.contacts,
|
|
||||||
getReferencedColumn: (t) => t.userId,
|
|
||||||
builder: (joinBuilder,
|
|
||||||
{$addJoinBuilderToRootComposer,
|
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
|
||||||
$$ContactsTableOrderingComposer(
|
|
||||||
$db: $db,
|
|
||||||
$table: $db.contacts,
|
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
||||||
joinBuilder: joinBuilder,
|
|
||||||
$removeJoinBuilderFromRootComposer:
|
|
||||||
$removeJoinBuilderFromRootComposer,
|
|
||||||
));
|
|
||||||
return composer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$GroupHistoriesTableAnnotationComposer
|
class $$GroupHistoriesTableAnnotationComposer
|
||||||
|
|
@ -13815,6 +13840,9 @@ class $$GroupHistoriesTableAnnotationComposer
|
||||||
GeneratedColumn<String> get groupHistoryId => $composableBuilder(
|
GeneratedColumn<String> get groupHistoryId => $composableBuilder(
|
||||||
column: $table.groupHistoryId, builder: (column) => column);
|
column: $table.groupHistoryId, builder: (column) => column);
|
||||||
|
|
||||||
|
GeneratedColumn<int> get affectedContactId => $composableBuilder(
|
||||||
|
column: $table.affectedContactId, builder: (column) => column);
|
||||||
|
|
||||||
GeneratedColumn<String> get oldGroupName => $composableBuilder(
|
GeneratedColumn<String> get oldGroupName => $composableBuilder(
|
||||||
column: $table.oldGroupName, builder: (column) => column);
|
column: $table.oldGroupName, builder: (column) => column);
|
||||||
|
|
||||||
|
|
@ -13871,26 +13899,6 @@ class $$GroupHistoriesTableAnnotationComposer
|
||||||
));
|
));
|
||||||
return composer;
|
return composer;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$ContactsTableAnnotationComposer get affectedContactId {
|
|
||||||
final $$ContactsTableAnnotationComposer composer = $composerBuilder(
|
|
||||||
composer: this,
|
|
||||||
getCurrentColumn: (t) => t.affectedContactId,
|
|
||||||
referencedTable: $db.contacts,
|
|
||||||
getReferencedColumn: (t) => t.userId,
|
|
||||||
builder: (joinBuilder,
|
|
||||||
{$addJoinBuilderToRootComposer,
|
|
||||||
$removeJoinBuilderFromRootComposer}) =>
|
|
||||||
$$ContactsTableAnnotationComposer(
|
|
||||||
$db: $db,
|
|
||||||
$table: $db.contacts,
|
|
||||||
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
||||||
joinBuilder: joinBuilder,
|
|
||||||
$removeJoinBuilderFromRootComposer:
|
|
||||||
$removeJoinBuilderFromRootComposer,
|
|
||||||
));
|
|
||||||
return composer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class $$GroupHistoriesTableTableManager extends RootTableManager<
|
class $$GroupHistoriesTableTableManager extends RootTableManager<
|
||||||
|
|
@ -13904,8 +13912,7 @@ class $$GroupHistoriesTableTableManager extends RootTableManager<
|
||||||
$$GroupHistoriesTableUpdateCompanionBuilder,
|
$$GroupHistoriesTableUpdateCompanionBuilder,
|
||||||
(GroupHistory, $$GroupHistoriesTableReferences),
|
(GroupHistory, $$GroupHistoriesTableReferences),
|
||||||
GroupHistory,
|
GroupHistory,
|
||||||
PrefetchHooks Function(
|
PrefetchHooks Function({bool groupId, bool contactId})> {
|
||||||
{bool groupId, bool contactId, bool affectedContactId})> {
|
|
||||||
$$GroupHistoriesTableTableManager(_$TwonlyDB db, $GroupHistoriesTable table)
|
$$GroupHistoriesTableTableManager(_$TwonlyDB db, $GroupHistoriesTable table)
|
||||||
: super(TableManagerState(
|
: super(TableManagerState(
|
||||||
db: db,
|
db: db,
|
||||||
|
|
@ -13974,8 +13981,7 @@ class $$GroupHistoriesTableTableManager extends RootTableManager<
|
||||||
$$GroupHistoriesTableReferences(db, table, e)
|
$$GroupHistoriesTableReferences(db, table, e)
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
prefetchHooksCallback: (
|
prefetchHooksCallback: ({groupId = false, contactId = false}) {
|
||||||
{groupId = false, contactId = false, affectedContactId = false}) {
|
|
||||||
return PrefetchHooks(
|
return PrefetchHooks(
|
||||||
db: db,
|
db: db,
|
||||||
explicitlyWatchedTables: [],
|
explicitlyWatchedTables: [],
|
||||||
|
|
@ -14014,17 +14020,6 @@ class $$GroupHistoriesTableTableManager extends RootTableManager<
|
||||||
.userId,
|
.userId,
|
||||||
) as T;
|
) as T;
|
||||||
}
|
}
|
||||||
if (affectedContactId) {
|
|
||||||
state = state.withJoin(
|
|
||||||
currentTable: table,
|
|
||||||
currentColumn: table.affectedContactId,
|
|
||||||
referencedTable: $$GroupHistoriesTableReferences
|
|
||||||
._affectedContactIdTable(db),
|
|
||||||
referencedColumn: $$GroupHistoriesTableReferences
|
|
||||||
._affectedContactIdTable(db)
|
|
||||||
.userId,
|
|
||||||
) as T;
|
|
||||||
}
|
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
},
|
},
|
||||||
|
|
@ -14047,8 +14042,7 @@ typedef $$GroupHistoriesTableProcessedTableManager = ProcessedTableManager<
|
||||||
$$GroupHistoriesTableUpdateCompanionBuilder,
|
$$GroupHistoriesTableUpdateCompanionBuilder,
|
||||||
(GroupHistory, $$GroupHistoriesTableReferences),
|
(GroupHistory, $$GroupHistoriesTableReferences),
|
||||||
GroupHistory,
|
GroupHistory,
|
||||||
PrefetchHooks Function(
|
PrefetchHooks Function({bool groupId, bool contactId})>;
|
||||||
{bool groupId, bool contactId, bool affectedContactId})>;
|
|
||||||
|
|
||||||
class $TwonlyDBManager {
|
class $TwonlyDBManager {
|
||||||
final _$TwonlyDB _db;
|
final _$TwonlyDB _db;
|
||||||
|
|
|
||||||
|
|
@ -456,5 +456,6 @@
|
||||||
"linkFromUsernameLong": "Wenn du den Link von der Person direkt erhalten hast, kannst du den Kontakt als verifiziert markieren, da der öffentliche Schlüssel im Link mit dem bereits für diesen Benutzer gespeicherten öffentlichen Schlüssel übereinstimmt.",
|
"linkFromUsernameLong": "Wenn du den Link von der Person direkt erhalten hast, kannst du den Kontakt als verifiziert markieren, da der öffentliche Schlüssel im Link mit dem bereits für diesen Benutzer gespeicherten öffentlichen Schlüssel übereinstimmt.",
|
||||||
"gotLinkFromFriend": "Ja, der Link kommt direkt von der Person.",
|
"gotLinkFromFriend": "Ja, der Link kommt direkt von der Person.",
|
||||||
"couldNotVerifyUsername": "{username} konnte nicht verifiziert werden",
|
"couldNotVerifyUsername": "{username} konnte nicht verifiziert werden",
|
||||||
"linkPubkeyDoesNotMatch": "Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!"
|
"linkPubkeyDoesNotMatch": "Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!",
|
||||||
|
"startWithCameraOpen": "Mit geöffneter Kamera starten"
|
||||||
}
|
}
|
||||||
|
|
@ -486,5 +486,6 @@
|
||||||
"linkFromUsernameLong": "If you received the link from your friend, you can mark the user as verified, as the public key in the link matches the public key already stored for that user?",
|
"linkFromUsernameLong": "If you received the link from your friend, you can mark the user as verified, as the public key in the link matches the public key already stored for that user?",
|
||||||
"gotLinkFromFriend": "Yes, I got the link from my friend!",
|
"gotLinkFromFriend": "Yes, I got the link from my friend!",
|
||||||
"couldNotVerifyUsername": "Could not verify {username}",
|
"couldNotVerifyUsername": "Could not verify {username}",
|
||||||
"linkPubkeyDoesNotMatch": "The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!"
|
"linkPubkeyDoesNotMatch": "The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!",
|
||||||
|
"startWithCameraOpen": "Start with camera open"
|
||||||
}
|
}
|
||||||
|
|
@ -2839,6 +2839,12 @@ abstract class AppLocalizations {
|
||||||
/// In en, this message translates to:
|
/// In en, this message translates to:
|
||||||
/// **'The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!'**
|
/// **'The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!'**
|
||||||
String get linkPubkeyDoesNotMatch;
|
String get linkPubkeyDoesNotMatch;
|
||||||
|
|
||||||
|
/// No description provided for @startWithCameraOpen.
|
||||||
|
///
|
||||||
|
/// In en, this message translates to:
|
||||||
|
/// **'Start with camera open'**
|
||||||
|
String get startWithCameraOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppLocalizationsDelegate
|
class _AppLocalizationsDelegate
|
||||||
|
|
|
||||||
|
|
@ -1570,4 +1570,7 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||||
@override
|
@override
|
||||||
String get linkPubkeyDoesNotMatch =>
|
String get linkPubkeyDoesNotMatch =>
|
||||||
'Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!';
|
'Der öffentliche Schlüssel im Link stimmt nicht mit dem für diesen Kontakt gespeicherten öffentlichen Schlüssel überein. Triff die Person persönlich und scanne den QR-Code direkt!';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get startWithCameraOpen => 'Mit geöffneter Kamera starten';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1560,4 +1560,7 @@ class AppLocalizationsEn extends AppLocalizations {
|
||||||
@override
|
@override
|
||||||
String get linkPubkeyDoesNotMatch =>
|
String get linkPubkeyDoesNotMatch =>
|
||||||
'The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!';
|
'The public key in the link does not match the public key stored for this contact. Try to meet your friend in person and scan the QR code directly!';
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get startWithCameraOpen => 'Start with camera open';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@ class UserData {
|
||||||
@JsonKey(defaultValue: true)
|
@JsonKey(defaultValue: true)
|
||||||
bool showFeedbackShortcut = true;
|
bool showFeedbackShortcut = true;
|
||||||
|
|
||||||
|
@JsonKey(defaultValue: true)
|
||||||
|
bool startWithCameraOpen = true;
|
||||||
|
|
||||||
List<String>? preSelectedEmojies;
|
List<String>? preSelectedEmojies;
|
||||||
|
|
||||||
Map<String, List<String>>? autoDownloadOptions;
|
Map<String, List<String>>? autoDownloadOptions;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) => UserData(
|
||||||
..requestedAudioPermission =
|
..requestedAudioPermission =
|
||||||
json['requestedAudioPermission'] as bool? ?? false
|
json['requestedAudioPermission'] as bool? ?? false
|
||||||
..showFeedbackShortcut = json['showFeedbackShortcut'] as bool? ?? true
|
..showFeedbackShortcut = json['showFeedbackShortcut'] as bool? ?? true
|
||||||
|
..startWithCameraOpen = json['startWithCameraOpen'] as bool? ?? true
|
||||||
..preSelectedEmojies = (json['preSelectedEmojies'] as List<dynamic>?)
|
..preSelectedEmojies = (json['preSelectedEmojies'] as List<dynamic>?)
|
||||||
?.map((e) => e as String)
|
?.map((e) => e as String)
|
||||||
.toList()
|
.toList()
|
||||||
|
|
@ -61,7 +62,7 @@ UserData _$UserDataFromJson(Map<String, dynamic> json) => UserData(
|
||||||
..lastChangeLogHash = (json['lastChangeLogHash'] as List<dynamic>?)
|
..lastChangeLogHash = (json['lastChangeLogHash'] as List<dynamic>?)
|
||||||
?.map((e) => (e as num).toInt())
|
?.map((e) => (e as num).toInt())
|
||||||
.toList()
|
.toList()
|
||||||
..hideChangeLog = json['hideChangeLog'] as bool? ?? false
|
..hideChangeLog = json['hideChangeLog'] as bool? ?? true
|
||||||
..updateFCMToken = json['updateFCMToken'] as bool? ?? true
|
..updateFCMToken = json['updateFCMToken'] as bool? ?? true
|
||||||
..nextTimeToShowBackupNotice = json['nextTimeToShowBackupNotice'] == null
|
..nextTimeToShowBackupNotice = json['nextTimeToShowBackupNotice'] == null
|
||||||
? null
|
? null
|
||||||
|
|
@ -93,6 +94,7 @@ Map<String, dynamic> _$UserDataToJson(UserData instance) => <String, dynamic>{
|
||||||
'defaultShowTime': instance.defaultShowTime,
|
'defaultShowTime': instance.defaultShowTime,
|
||||||
'requestedAudioPermission': instance.requestedAudioPermission,
|
'requestedAudioPermission': instance.requestedAudioPermission,
|
||||||
'showFeedbackShortcut': instance.showFeedbackShortcut,
|
'showFeedbackShortcut': instance.showFeedbackShortcut,
|
||||||
|
'startWithCameraOpen': instance.startWithCameraOpen,
|
||||||
'preSelectedEmojies': instance.preSelectedEmojies,
|
'preSelectedEmojies': instance.preSelectedEmojies,
|
||||||
'autoDownloadOptions': instance.autoDownloadOptions,
|
'autoDownloadOptions': instance.autoDownloadOptions,
|
||||||
'storeMediaFilesInGallery': instance.storeMediaFilesInGallery,
|
'storeMediaFilesInGallery': instance.storeMediaFilesInGallery,
|
||||||
|
|
|
||||||
|
|
@ -230,10 +230,10 @@ class HomeViewState extends State<HomeView> {
|
||||||
final notificationAppLaunchDetails =
|
final notificationAppLaunchDetails =
|
||||||
await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
|
await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
|
||||||
|
|
||||||
if (notificationAppLaunchDetails != null) {
|
if (widget.initialPage == 0 ||
|
||||||
if (notificationAppLaunchDetails.didNotificationLaunchApp) {
|
(notificationAppLaunchDetails != null &&
|
||||||
globalUpdateOfHomeViewPageIndex(0);
|
notificationAppLaunchDetails.didNotificationLaunchApp)) {
|
||||||
}
|
globalUpdateOfHomeViewPageIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
final draftMedia = await twonlyDB.mediaFilesDao.getDraftMediaFile();
|
final draftMedia = await twonlyDB.mediaFilesDao.getDraftMediaFile();
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/providers/settings.provider.dart';
|
import 'package:twonly/src/providers/settings.provider.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
import 'package:twonly/src/utils/storage.dart';
|
import 'package:twonly/src/utils/storage.dart';
|
||||||
|
|
@ -15,20 +16,9 @@ class AppearanceView extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AppearanceViewState extends State<AppearanceView> {
|
class _AppearanceViewState extends State<AppearanceView> {
|
||||||
bool showFeedbackShortcut = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
unawaited(initAsync());
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> initAsync() async {
|
|
||||||
final user = await getUser();
|
|
||||||
if (user == null) return;
|
|
||||||
setState(() {
|
|
||||||
showFeedbackShortcut = user.showFeedbackShortcut;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _showSelectThemeMode(BuildContext context) async {
|
Future<void> _showSelectThemeMode(BuildContext context) async {
|
||||||
|
|
@ -87,7 +77,19 @@ class _AppearanceViewState extends State<AppearanceView> {
|
||||||
u.showFeedbackShortcut = !u.showFeedbackShortcut;
|
u.showFeedbackShortcut = !u.showFeedbackShortcut;
|
||||||
return u;
|
return u;
|
||||||
});
|
});
|
||||||
await initAsync();
|
setState(() {
|
||||||
|
// gUser
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> toggleStartWithCameraOpen() async {
|
||||||
|
await updateUserdata((u) {
|
||||||
|
u.startWithCameraOpen = !u.startWithCameraOpen;
|
||||||
|
return u;
|
||||||
|
});
|
||||||
|
setState(() {
|
||||||
|
// gUser
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -113,10 +115,18 @@ class _AppearanceViewState extends State<AppearanceView> {
|
||||||
title: Text(context.lang.contactUsShortcut),
|
title: Text(context.lang.contactUsShortcut),
|
||||||
onTap: toggleShowFeedbackIcon,
|
onTap: toggleShowFeedbackIcon,
|
||||||
trailing: Switch(
|
trailing: Switch(
|
||||||
value: !showFeedbackShortcut,
|
value: !gUser.showFeedbackShortcut,
|
||||||
onChanged: (a) => toggleShowFeedbackIcon(),
|
onChanged: (a) => toggleShowFeedbackIcon(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(context.lang.startWithCameraOpen),
|
||||||
|
onTap: toggleStartWithCameraOpen,
|
||||||
|
trailing: Switch(
|
||||||
|
value: gUser.startWithCameraOpen,
|
||||||
|
onChanged: (a) => toggleStartWithCameraOpen(),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue