feat: drift store migration
This commit is contained in:
@@ -5,7 +5,7 @@ import 'package:immich_mobile/constants/constants.dart';
|
|||||||
import 'package:immich_mobile/domain/models/log.model.dart';
|
import 'package:immich_mobile/domain/models/log.model.dart';
|
||||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/log.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/log.repository.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/store.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/drift_store.repository.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
/// Service responsible for handling application logging.
|
/// Service responsible for handling application logging.
|
||||||
@@ -15,7 +15,7 @@ import 'package:logging/logging.dart';
|
|||||||
/// via [IStoreRepository]
|
/// via [IStoreRepository]
|
||||||
class LogService {
|
class LogService {
|
||||||
final IsarLogRepository _logRepository;
|
final IsarLogRepository _logRepository;
|
||||||
final IsarStoreRepository _storeRepository;
|
final IStoreRepository _storeRepository;
|
||||||
|
|
||||||
final List<LogMessage> _msgBuffer = [];
|
final List<LogMessage> _msgBuffer = [];
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class LogService {
|
|||||||
|
|
||||||
static Future<LogService> init({
|
static Future<LogService> init({
|
||||||
required IsarLogRepository logRepository,
|
required IsarLogRepository logRepository,
|
||||||
required IsarStoreRepository storeRepository,
|
required IStoreRepository storeRepository,
|
||||||
bool shouldBuffer = true,
|
bool shouldBuffer = true,
|
||||||
}) async {
|
}) async {
|
||||||
_instance ??= await create(
|
_instance ??= await create(
|
||||||
@@ -51,7 +51,7 @@ class LogService {
|
|||||||
|
|
||||||
static Future<LogService> create({
|
static Future<LogService> create({
|
||||||
required IsarLogRepository logRepository,
|
required IsarLogRepository logRepository,
|
||||||
required IsarStoreRepository storeRepository,
|
required IStoreRepository storeRepository,
|
||||||
bool shouldBuffer = true,
|
bool shouldBuffer = true,
|
||||||
}) async {
|
}) async {
|
||||||
final instance = LogService._(logRepository, storeRepository, shouldBuffer);
|
final instance = LogService._(logRepository, storeRepository, shouldBuffer);
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/store.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/drift_store.repository.dart';
|
||||||
|
|
||||||
/// Provides access to a persistent key-value store with an in-memory cache.
|
/// Provides access to a persistent key-value store with an in-memory cache.
|
||||||
/// Listens for repository changes to keep the cache updated.
|
/// Listens for repository changes to keep the cache updated.
|
||||||
class StoreService {
|
class StoreService {
|
||||||
final IsarStoreRepository _storeRepository;
|
final IStoreRepository _storeRepository;
|
||||||
|
|
||||||
/// In-memory cache. Keys are [StoreKey.id]
|
/// In-memory cache. Keys are [StoreKey.id]
|
||||||
final Map<int, Object?> _cache = {};
|
final Map<int, Object?> _cache = {};
|
||||||
late final StreamSubscription<StoreDto> _storeUpdateSubscription;
|
late final StreamSubscription<StoreDto> _storeUpdateSubscription;
|
||||||
|
|
||||||
StoreService._({required IsarStoreRepository storeRepository})
|
StoreService._({required IStoreRepository storeRepository})
|
||||||
: _storeRepository = storeRepository;
|
: _storeRepository = storeRepository;
|
||||||
|
|
||||||
// TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider
|
// TODO: Temporary typedef to make minimal changes. Remove this and make the presentation layer access store through a provider
|
||||||
@@ -26,14 +26,14 @@ class StoreService {
|
|||||||
|
|
||||||
// TODO: Replace the implementation with the one from create after removing the typedef
|
// TODO: Replace the implementation with the one from create after removing the typedef
|
||||||
static Future<StoreService> init({
|
static Future<StoreService> init({
|
||||||
required IsarStoreRepository storeRepository,
|
required IStoreRepository storeRepository,
|
||||||
}) async {
|
}) async {
|
||||||
_instance ??= await create(storeRepository: storeRepository);
|
_instance ??= await create(storeRepository: storeRepository);
|
||||||
return _instance!;
|
return _instance!;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<StoreService> create({
|
static Future<StoreService> create({
|
||||||
required IsarStoreRepository storeRepository,
|
required IStoreRepository storeRepository,
|
||||||
}) async {
|
}) async {
|
||||||
final instance = StoreService._(storeRepository: storeRepository);
|
final instance = StoreService._(storeRepository: storeRepository);
|
||||||
await instance._populateCache();
|
await instance._populateCache();
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
|
part 'isar_store.entity.g.dart';
|
||||||
|
|
||||||
|
/// Internal class for `Store`, do not use elsewhere.
|
||||||
|
@Collection(inheritance: false)
|
||||||
|
class StoreValue {
|
||||||
|
final Id id;
|
||||||
|
final int? intValue;
|
||||||
|
final String? strValue;
|
||||||
|
|
||||||
|
const StoreValue(this.id, {this.intValue, this.strValue});
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
part of 'store.entity.dart';
|
part of 'isar_store.entity.dart';
|
||||||
|
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
// IsarCollectionGenerator
|
// IsarCollectionGenerator
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import 'package:isar/isar.dart';
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/utils/drift_default.mixin.dart';
|
||||||
|
|
||||||
part 'store.entity.g.dart';
|
class StoreEntity extends Table with DriftDefaultsMixin {
|
||||||
|
const StoreEntity();
|
||||||
|
|
||||||
/// Internal class for `Store`, do not use elsewhere.
|
IntColumn get id => integer()();
|
||||||
@Collection(inheritance: false)
|
IntColumn get intValue => integer().nullable()();
|
||||||
class StoreValue {
|
TextColumn get strValue => text().nullable()();
|
||||||
final Id id;
|
|
||||||
final int? intValue;
|
|
||||||
final String? strValue;
|
|
||||||
|
|
||||||
const StoreValue(this.id, {this.intValue, this.strValue});
|
@override
|
||||||
|
Set<Column> get primaryKey => {id};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,364 @@
|
|||||||
|
// dart format width=80
|
||||||
|
// ignore_for_file: type=lint
|
||||||
|
import 'package:drift/drift.dart' as i0;
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/store.entity.drift.dart'
|
||||||
|
as i1;
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/store.entity.dart' as i2;
|
||||||
|
|
||||||
|
typedef $$StoreEntityTableCreateCompanionBuilder = i1.StoreEntityCompanion
|
||||||
|
Function({
|
||||||
|
required int id,
|
||||||
|
i0.Value<int?> intValue,
|
||||||
|
i0.Value<String?> strValue,
|
||||||
|
});
|
||||||
|
typedef $$StoreEntityTableUpdateCompanionBuilder = i1.StoreEntityCompanion
|
||||||
|
Function({
|
||||||
|
i0.Value<int> id,
|
||||||
|
i0.Value<int?> intValue,
|
||||||
|
i0.Value<String?> strValue,
|
||||||
|
});
|
||||||
|
|
||||||
|
class $$StoreEntityTableFilterComposer
|
||||||
|
extends i0.Composer<i0.GeneratedDatabase, i1.$StoreEntityTable> {
|
||||||
|
$$StoreEntityTableFilterComposer({
|
||||||
|
required super.$db,
|
||||||
|
required super.$table,
|
||||||
|
super.joinBuilder,
|
||||||
|
super.$addJoinBuilderToRootComposer,
|
||||||
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
|
});
|
||||||
|
i0.ColumnFilters<int> get id => $composableBuilder(
|
||||||
|
column: $table.id, builder: (column) => i0.ColumnFilters(column));
|
||||||
|
|
||||||
|
i0.ColumnFilters<int> get intValue => $composableBuilder(
|
||||||
|
column: $table.intValue, builder: (column) => i0.ColumnFilters(column));
|
||||||
|
|
||||||
|
i0.ColumnFilters<String> get strValue => $composableBuilder(
|
||||||
|
column: $table.strValue, builder: (column) => i0.ColumnFilters(column));
|
||||||
|
}
|
||||||
|
|
||||||
|
class $$StoreEntityTableOrderingComposer
|
||||||
|
extends i0.Composer<i0.GeneratedDatabase, i1.$StoreEntityTable> {
|
||||||
|
$$StoreEntityTableOrderingComposer({
|
||||||
|
required super.$db,
|
||||||
|
required super.$table,
|
||||||
|
super.joinBuilder,
|
||||||
|
super.$addJoinBuilderToRootComposer,
|
||||||
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
|
});
|
||||||
|
i0.ColumnOrderings<int> get id => $composableBuilder(
|
||||||
|
column: $table.id, builder: (column) => i0.ColumnOrderings(column));
|
||||||
|
|
||||||
|
i0.ColumnOrderings<int> get intValue => $composableBuilder(
|
||||||
|
column: $table.intValue, builder: (column) => i0.ColumnOrderings(column));
|
||||||
|
|
||||||
|
i0.ColumnOrderings<String> get strValue => $composableBuilder(
|
||||||
|
column: $table.strValue, builder: (column) => i0.ColumnOrderings(column));
|
||||||
|
}
|
||||||
|
|
||||||
|
class $$StoreEntityTableAnnotationComposer
|
||||||
|
extends i0.Composer<i0.GeneratedDatabase, i1.$StoreEntityTable> {
|
||||||
|
$$StoreEntityTableAnnotationComposer({
|
||||||
|
required super.$db,
|
||||||
|
required super.$table,
|
||||||
|
super.joinBuilder,
|
||||||
|
super.$addJoinBuilderToRootComposer,
|
||||||
|
super.$removeJoinBuilderFromRootComposer,
|
||||||
|
});
|
||||||
|
i0.GeneratedColumn<int> get id =>
|
||||||
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
||||||
|
|
||||||
|
i0.GeneratedColumn<int> get intValue =>
|
||||||
|
$composableBuilder(column: $table.intValue, builder: (column) => column);
|
||||||
|
|
||||||
|
i0.GeneratedColumn<String> get strValue =>
|
||||||
|
$composableBuilder(column: $table.strValue, builder: (column) => column);
|
||||||
|
}
|
||||||
|
|
||||||
|
class $$StoreEntityTableTableManager extends i0.RootTableManager<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$StoreEntityTable,
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i1.$$StoreEntityTableFilterComposer,
|
||||||
|
i1.$$StoreEntityTableOrderingComposer,
|
||||||
|
i1.$$StoreEntityTableAnnotationComposer,
|
||||||
|
$$StoreEntityTableCreateCompanionBuilder,
|
||||||
|
$$StoreEntityTableUpdateCompanionBuilder,
|
||||||
|
(
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i0.BaseReferences<i0.GeneratedDatabase, i1.$StoreEntityTable,
|
||||||
|
i1.StoreEntityData>
|
||||||
|
),
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i0.PrefetchHooks Function()> {
|
||||||
|
$$StoreEntityTableTableManager(
|
||||||
|
i0.GeneratedDatabase db, i1.$StoreEntityTable table)
|
||||||
|
: super(i0.TableManagerState(
|
||||||
|
db: db,
|
||||||
|
table: table,
|
||||||
|
createFilteringComposer: () =>
|
||||||
|
i1.$$StoreEntityTableFilterComposer($db: db, $table: table),
|
||||||
|
createOrderingComposer: () =>
|
||||||
|
i1.$$StoreEntityTableOrderingComposer($db: db, $table: table),
|
||||||
|
createComputedFieldComposer: () =>
|
||||||
|
i1.$$StoreEntityTableAnnotationComposer($db: db, $table: table),
|
||||||
|
updateCompanionCallback: ({
|
||||||
|
i0.Value<int> id = const i0.Value.absent(),
|
||||||
|
i0.Value<int?> intValue = const i0.Value.absent(),
|
||||||
|
i0.Value<String?> strValue = const i0.Value.absent(),
|
||||||
|
}) =>
|
||||||
|
i1.StoreEntityCompanion(
|
||||||
|
id: id,
|
||||||
|
intValue: intValue,
|
||||||
|
strValue: strValue,
|
||||||
|
),
|
||||||
|
createCompanionCallback: ({
|
||||||
|
required int id,
|
||||||
|
i0.Value<int?> intValue = const i0.Value.absent(),
|
||||||
|
i0.Value<String?> strValue = const i0.Value.absent(),
|
||||||
|
}) =>
|
||||||
|
i1.StoreEntityCompanion.insert(
|
||||||
|
id: id,
|
||||||
|
intValue: intValue,
|
||||||
|
strValue: strValue,
|
||||||
|
),
|
||||||
|
withReferenceMapper: (p0) => p0
|
||||||
|
.map((e) => (e.readTable(table), i0.BaseReferences(db, table, e)))
|
||||||
|
.toList(),
|
||||||
|
prefetchHooksCallback: null,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef $$StoreEntityTableProcessedTableManager = i0.ProcessedTableManager<
|
||||||
|
i0.GeneratedDatabase,
|
||||||
|
i1.$StoreEntityTable,
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i1.$$StoreEntityTableFilterComposer,
|
||||||
|
i1.$$StoreEntityTableOrderingComposer,
|
||||||
|
i1.$$StoreEntityTableAnnotationComposer,
|
||||||
|
$$StoreEntityTableCreateCompanionBuilder,
|
||||||
|
$$StoreEntityTableUpdateCompanionBuilder,
|
||||||
|
(
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i0.BaseReferences<i0.GeneratedDatabase, i1.$StoreEntityTable,
|
||||||
|
i1.StoreEntityData>
|
||||||
|
),
|
||||||
|
i1.StoreEntityData,
|
||||||
|
i0.PrefetchHooks Function()>;
|
||||||
|
|
||||||
|
class $StoreEntityTable extends i2.StoreEntity
|
||||||
|
with i0.TableInfo<$StoreEntityTable, i1.StoreEntityData> {
|
||||||
|
@override
|
||||||
|
final i0.GeneratedDatabase attachedDatabase;
|
||||||
|
final String? _alias;
|
||||||
|
$StoreEntityTable(this.attachedDatabase, [this._alias]);
|
||||||
|
static const i0.VerificationMeta _idMeta = const i0.VerificationMeta('id');
|
||||||
|
@override
|
||||||
|
late final i0.GeneratedColumn<int> id = i0.GeneratedColumn<int>(
|
||||||
|
'id', aliasedName, false,
|
||||||
|
type: i0.DriftSqlType.int, requiredDuringInsert: true);
|
||||||
|
static const i0.VerificationMeta _intValueMeta =
|
||||||
|
const i0.VerificationMeta('intValue');
|
||||||
|
@override
|
||||||
|
late final i0.GeneratedColumn<int> intValue = i0.GeneratedColumn<int>(
|
||||||
|
'int_value', aliasedName, true,
|
||||||
|
type: i0.DriftSqlType.int, requiredDuringInsert: false);
|
||||||
|
static const i0.VerificationMeta _strValueMeta =
|
||||||
|
const i0.VerificationMeta('strValue');
|
||||||
|
@override
|
||||||
|
late final i0.GeneratedColumn<String> strValue = i0.GeneratedColumn<String>(
|
||||||
|
'str_value', aliasedName, true,
|
||||||
|
type: i0.DriftSqlType.string, requiredDuringInsert: false);
|
||||||
|
@override
|
||||||
|
List<i0.GeneratedColumn> get $columns => [id, intValue, strValue];
|
||||||
|
@override
|
||||||
|
String get aliasedName => _alias ?? actualTableName;
|
||||||
|
@override
|
||||||
|
String get actualTableName => $name;
|
||||||
|
static const String $name = 'store_entity';
|
||||||
|
@override
|
||||||
|
i0.VerificationContext validateIntegrity(
|
||||||
|
i0.Insertable<i1.StoreEntityData> instance,
|
||||||
|
{bool isInserting = false}) {
|
||||||
|
final context = i0.VerificationContext();
|
||||||
|
final data = instance.toColumns(true);
|
||||||
|
if (data.containsKey('id')) {
|
||||||
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
||||||
|
} else if (isInserting) {
|
||||||
|
context.missing(_idMeta);
|
||||||
|
}
|
||||||
|
if (data.containsKey('int_value')) {
|
||||||
|
context.handle(_intValueMeta,
|
||||||
|
intValue.isAcceptableOrUnknown(data['int_value']!, _intValueMeta));
|
||||||
|
}
|
||||||
|
if (data.containsKey('str_value')) {
|
||||||
|
context.handle(_strValueMeta,
|
||||||
|
strValue.isAcceptableOrUnknown(data['str_value']!, _strValueMeta));
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Set<i0.GeneratedColumn> get $primaryKey => {id};
|
||||||
|
@override
|
||||||
|
i1.StoreEntityData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
||||||
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
||||||
|
return i1.StoreEntityData(
|
||||||
|
id: attachedDatabase.typeMapping
|
||||||
|
.read(i0.DriftSqlType.int, data['${effectivePrefix}id'])!,
|
||||||
|
intValue: attachedDatabase.typeMapping
|
||||||
|
.read(i0.DriftSqlType.int, data['${effectivePrefix}int_value']),
|
||||||
|
strValue: attachedDatabase.typeMapping
|
||||||
|
.read(i0.DriftSqlType.string, data['${effectivePrefix}str_value']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
$StoreEntityTable createAlias(String alias) {
|
||||||
|
return $StoreEntityTable(attachedDatabase, alias);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get withoutRowId => true;
|
||||||
|
@override
|
||||||
|
bool get isStrict => true;
|
||||||
|
}
|
||||||
|
|
||||||
|
class StoreEntityData extends i0.DataClass
|
||||||
|
implements i0.Insertable<i1.StoreEntityData> {
|
||||||
|
final int id;
|
||||||
|
final int? intValue;
|
||||||
|
final String? strValue;
|
||||||
|
const StoreEntityData({required this.id, this.intValue, this.strValue});
|
||||||
|
@override
|
||||||
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
|
final map = <String, i0.Expression>{};
|
||||||
|
map['id'] = i0.Variable<int>(id);
|
||||||
|
if (!nullToAbsent || intValue != null) {
|
||||||
|
map['int_value'] = i0.Variable<int>(intValue);
|
||||||
|
}
|
||||||
|
if (!nullToAbsent || strValue != null) {
|
||||||
|
map['str_value'] = i0.Variable<String>(strValue);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
factory StoreEntityData.fromJson(Map<String, dynamic> json,
|
||||||
|
{i0.ValueSerializer? serializer}) {
|
||||||
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
|
return StoreEntityData(
|
||||||
|
id: serializer.fromJson<int>(json['id']),
|
||||||
|
intValue: serializer.fromJson<int?>(json['intValue']),
|
||||||
|
strValue: serializer.fromJson<String?>(json['strValue']),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
Map<String, dynamic> toJson({i0.ValueSerializer? serializer}) {
|
||||||
|
serializer ??= i0.driftRuntimeOptions.defaultSerializer;
|
||||||
|
return <String, dynamic>{
|
||||||
|
'id': serializer.toJson<int>(id),
|
||||||
|
'intValue': serializer.toJson<int?>(intValue),
|
||||||
|
'strValue': serializer.toJson<String?>(strValue),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
i1.StoreEntityData copyWith(
|
||||||
|
{int? id,
|
||||||
|
i0.Value<int?> intValue = const i0.Value.absent(),
|
||||||
|
i0.Value<String?> strValue = const i0.Value.absent()}) =>
|
||||||
|
i1.StoreEntityData(
|
||||||
|
id: id ?? this.id,
|
||||||
|
intValue: intValue.present ? intValue.value : this.intValue,
|
||||||
|
strValue: strValue.present ? strValue.value : this.strValue,
|
||||||
|
);
|
||||||
|
StoreEntityData copyWithCompanion(i1.StoreEntityCompanion data) {
|
||||||
|
return StoreEntityData(
|
||||||
|
id: data.id.present ? data.id.value : this.id,
|
||||||
|
intValue: data.intValue.present ? data.intValue.value : this.intValue,
|
||||||
|
strValue: data.strValue.present ? data.strValue.value : this.strValue,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return (StringBuffer('StoreEntityData(')
|
||||||
|
..write('id: $id, ')
|
||||||
|
..write('intValue: $intValue, ')
|
||||||
|
..write('strValue: $strValue')
|
||||||
|
..write(')'))
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(id, intValue, strValue);
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
(other is i1.StoreEntityData &&
|
||||||
|
other.id == this.id &&
|
||||||
|
other.intValue == this.intValue &&
|
||||||
|
other.strValue == this.strValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
class StoreEntityCompanion extends i0.UpdateCompanion<i1.StoreEntityData> {
|
||||||
|
final i0.Value<int> id;
|
||||||
|
final i0.Value<int?> intValue;
|
||||||
|
final i0.Value<String?> strValue;
|
||||||
|
const StoreEntityCompanion({
|
||||||
|
this.id = const i0.Value.absent(),
|
||||||
|
this.intValue = const i0.Value.absent(),
|
||||||
|
this.strValue = const i0.Value.absent(),
|
||||||
|
});
|
||||||
|
StoreEntityCompanion.insert({
|
||||||
|
required int id,
|
||||||
|
this.intValue = const i0.Value.absent(),
|
||||||
|
this.strValue = const i0.Value.absent(),
|
||||||
|
}) : id = i0.Value(id);
|
||||||
|
static i0.Insertable<i1.StoreEntityData> custom({
|
||||||
|
i0.Expression<int>? id,
|
||||||
|
i0.Expression<int>? intValue,
|
||||||
|
i0.Expression<String>? strValue,
|
||||||
|
}) {
|
||||||
|
return i0.RawValuesInsertable({
|
||||||
|
if (id != null) 'id': id,
|
||||||
|
if (intValue != null) 'int_value': intValue,
|
||||||
|
if (strValue != null) 'str_value': strValue,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
i1.StoreEntityCompanion copyWith(
|
||||||
|
{i0.Value<int>? id,
|
||||||
|
i0.Value<int?>? intValue,
|
||||||
|
i0.Value<String?>? strValue}) {
|
||||||
|
return i1.StoreEntityCompanion(
|
||||||
|
id: id ?? this.id,
|
||||||
|
intValue: intValue ?? this.intValue,
|
||||||
|
strValue: strValue ?? this.strValue,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<String, i0.Expression> toColumns(bool nullToAbsent) {
|
||||||
|
final map = <String, i0.Expression>{};
|
||||||
|
if (id.present) {
|
||||||
|
map['id'] = i0.Variable<int>(id.value);
|
||||||
|
}
|
||||||
|
if (intValue.present) {
|
||||||
|
map['int_value'] = i0.Variable<int>(intValue.value);
|
||||||
|
}
|
||||||
|
if (strValue.present) {
|
||||||
|
map['str_value'] = i0.Variable<String>(strValue.value);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return (StringBuffer('StoreEntityCompanion(')
|
||||||
|
..write('id: $id, ')
|
||||||
|
..write('intValue: $intValue, ')
|
||||||
|
..write('strValue: $strValue')
|
||||||
|
..write(')'))
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import 'package:immich_mobile/infrastructure/entities/remote_album.entity.dart';
|
|||||||
import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/remote_asset.entity.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/store.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/user_metadata.entity.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
@@ -46,6 +47,7 @@ class IsarDatabaseRepository implements IDatabaseRepository {
|
|||||||
RemoteAlbumEntity,
|
RemoteAlbumEntity,
|
||||||
RemoteAlbumAssetEntity,
|
RemoteAlbumAssetEntity,
|
||||||
RemoteAlbumUserEntity,
|
RemoteAlbumUserEntity,
|
||||||
|
StoreEntity,
|
||||||
],
|
],
|
||||||
include: {
|
include: {
|
||||||
'package:immich_mobile/infrastructure/entities/merged_asset.drift',
|
'package:immich_mobile/infrastructure/entities/merged_asset.drift',
|
||||||
|
|||||||
+11
-5
@@ -23,9 +23,11 @@ import 'package:immich_mobile/infrastructure/entities/remote_album_asset.entity.
|
|||||||
as i10;
|
as i10;
|
||||||
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/remote_album_user.entity.drift.dart'
|
||||||
as i11;
|
as i11;
|
||||||
import 'package:immich_mobile/infrastructure/entities/merged_asset.drift.dart'
|
import 'package:immich_mobile/infrastructure/entities/store.entity.drift.dart'
|
||||||
as i12;
|
as i12;
|
||||||
import 'package:drift/internal/modular.dart' as i13;
|
import 'package:immich_mobile/infrastructure/entities/merged_asset.drift.dart'
|
||||||
|
as i13;
|
||||||
|
import 'package:drift/internal/modular.dart' as i14;
|
||||||
|
|
||||||
abstract class $Drift extends i0.GeneratedDatabase {
|
abstract class $Drift extends i0.GeneratedDatabase {
|
||||||
$Drift(i0.QueryExecutor e) : super(e);
|
$Drift(i0.QueryExecutor e) : super(e);
|
||||||
@@ -51,8 +53,9 @@ abstract class $Drift extends i0.GeneratedDatabase {
|
|||||||
i10.$RemoteAlbumAssetEntityTable(this);
|
i10.$RemoteAlbumAssetEntityTable(this);
|
||||||
late final i11.$RemoteAlbumUserEntityTable remoteAlbumUserEntity =
|
late final i11.$RemoteAlbumUserEntityTable remoteAlbumUserEntity =
|
||||||
i11.$RemoteAlbumUserEntityTable(this);
|
i11.$RemoteAlbumUserEntityTable(this);
|
||||||
i12.MergedAssetDrift get mergedAssetDrift => i13.ReadDatabaseContainer(this)
|
late final i12.$StoreEntityTable storeEntity = i12.$StoreEntityTable(this);
|
||||||
.accessor<i12.MergedAssetDrift>(i12.MergedAssetDrift.new);
|
i13.MergedAssetDrift get mergedAssetDrift => i14.ReadDatabaseContainer(this)
|
||||||
|
.accessor<i13.MergedAssetDrift>(i13.MergedAssetDrift.new);
|
||||||
@override
|
@override
|
||||||
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
|
Iterable<i0.TableInfo<i0.Table, Object?>> get allTables =>
|
||||||
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
|
allSchemaEntities.whereType<i0.TableInfo<i0.Table, Object?>>();
|
||||||
@@ -71,7 +74,8 @@ abstract class $Drift extends i0.GeneratedDatabase {
|
|||||||
remoteExifEntity,
|
remoteExifEntity,
|
||||||
remoteAlbumEntity,
|
remoteAlbumEntity,
|
||||||
remoteAlbumAssetEntity,
|
remoteAlbumAssetEntity,
|
||||||
remoteAlbumUserEntity
|
remoteAlbumUserEntity,
|
||||||
|
storeEntity
|
||||||
];
|
];
|
||||||
@override
|
@override
|
||||||
i0.StreamQueryUpdateRules get streamUpdateRules =>
|
i0.StreamQueryUpdateRules get streamUpdateRules =>
|
||||||
@@ -208,4 +212,6 @@ class $DriftManager {
|
|||||||
_db, _db.remoteAlbumAssetEntity);
|
_db, _db.remoteAlbumAssetEntity);
|
||||||
i11.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i11
|
i11.$$RemoteAlbumUserEntityTableTableManager get remoteAlbumUserEntity => i11
|
||||||
.$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity);
|
.$$RemoteAlbumUserEntityTableTableManager(_db, _db.remoteAlbumUserEntity);
|
||||||
|
i12.$$StoreEntityTableTableManager get storeEntity =>
|
||||||
|
i12.$$StoreEntityTableTableManager(_db, _db.storeEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,145 @@
|
|||||||
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/store.entity.drift.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/drift_user.repository.dart';
|
||||||
|
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
||||||
|
|
||||||
|
final driftStoreRepositoryProvider = Provider<DriftStoreRepository>(
|
||||||
|
(ref) => DriftStoreRepository(ref.watch(driftProvider)),
|
||||||
|
);
|
||||||
|
|
||||||
|
class DriftStoreRepository implements IStoreRepository {
|
||||||
|
final Drift _db;
|
||||||
|
final validStoreKeys = StoreKey.values.map((e) => e.id).toSet();
|
||||||
|
|
||||||
|
DriftStoreRepository(this._db);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> deleteAll() async {
|
||||||
|
return await _db.transaction(() async {
|
||||||
|
await _db.delete(_db.storeEntity).go();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<StoreDto<Object>> watchAll() {
|
||||||
|
return (_db.select(_db.storeEntity)
|
||||||
|
..where((tbl) => tbl.id.isIn(validStoreKeys)))
|
||||||
|
.watch()
|
||||||
|
.asyncExpand(
|
||||||
|
(entities) => Stream.fromFutures(
|
||||||
|
entities.map((e) async => _toUpdateEvent(e)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<void> delete<T>(StoreKey<T> key) async {
|
||||||
|
return await _db.transaction(() async {
|
||||||
|
await (_db.delete(_db.storeEntity)..where((tbl) => tbl.id.equals(key.id)))
|
||||||
|
.go();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> insert<T>(StoreKey<T> key, T value) async {
|
||||||
|
return await _db.transaction(() async {
|
||||||
|
await _db
|
||||||
|
.into(_db.storeEntity)
|
||||||
|
.insertOnConflictUpdate(await _fromValue(key, value));
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<T?> tryGet<T>(StoreKey<T> key) async {
|
||||||
|
final entity = await (_db.select(_db.storeEntity)
|
||||||
|
..where((tbl) => tbl.id.equals(key.id)))
|
||||||
|
.getSingleOrNull();
|
||||||
|
if (entity == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return await _toValue(key, entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<bool> update<T>(StoreKey<T> key, T value) async {
|
||||||
|
return await _db.transaction(() async {
|
||||||
|
await _db
|
||||||
|
.into(_db.storeEntity)
|
||||||
|
.insertOnConflictUpdate(await _fromValue(key, value));
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<T?> watch<T>(StoreKey<T> key) async* {
|
||||||
|
yield* (_db.select(_db.storeEntity)..where((tbl) => tbl.id.equals(key.id)))
|
||||||
|
.watchSingleOrNull()
|
||||||
|
.asyncMap((e) async => e == null ? null : await _toValue(key, e));
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<StoreDto<Object>> _toUpdateEvent(StoreEntityData entity) async {
|
||||||
|
final key = StoreKey.values.firstWhere((e) => e.id == entity.id)
|
||||||
|
as StoreKey<Object>;
|
||||||
|
final value = await _toValue(key, entity);
|
||||||
|
return StoreDto(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<T?> _toValue<T>(StoreKey<T> key, StoreEntityData entity) async =>
|
||||||
|
switch (key.type) {
|
||||||
|
const (int) => entity.intValue,
|
||||||
|
const (String) => entity.strValue,
|
||||||
|
const (bool) => entity.intValue == 1,
|
||||||
|
const (DateTime) => entity.intValue == null
|
||||||
|
? null
|
||||||
|
: DateTime.fromMillisecondsSinceEpoch(entity.intValue!),
|
||||||
|
const (UserDto) => entity.strValue == null
|
||||||
|
? null
|
||||||
|
: await DriftUserRepository(_db).getByUserId(entity.strValue!),
|
||||||
|
_ => null,
|
||||||
|
} as T?;
|
||||||
|
|
||||||
|
Future<StoreEntityData> _fromValue<T>(StoreKey<T> key, T value) async {
|
||||||
|
final (int? intValue, String? strValue) = switch (key.type) {
|
||||||
|
const (int) => (value as int, null),
|
||||||
|
const (String) => (null, value as String),
|
||||||
|
const (bool) => ((value as bool) ? 1 : 0, null),
|
||||||
|
const (DateTime) => ((value as DateTime).millisecondsSinceEpoch, null),
|
||||||
|
const (UserDto) => (
|
||||||
|
null,
|
||||||
|
(await DriftUserRepository(_db).update(value as UserDto)).id,
|
||||||
|
),
|
||||||
|
_ => throw UnsupportedError(
|
||||||
|
"Unsupported primitive type: ${key.type} for key: ${key.name}",
|
||||||
|
),
|
||||||
|
};
|
||||||
|
return StoreEntityData(
|
||||||
|
id: key.id,
|
||||||
|
intValue: intValue,
|
||||||
|
strValue: strValue,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<List<StoreDto<Object>>> getAll() async {
|
||||||
|
final entities = await (_db.select(_db.storeEntity)
|
||||||
|
..where((tbl) => tbl.id.isIn(validStoreKeys)))
|
||||||
|
.get();
|
||||||
|
return Future.wait(entities.map((e) => _toUpdateEvent(e)).toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class IStoreRepository {
|
||||||
|
Future<bool> deleteAll();
|
||||||
|
Stream<StoreDto<Object>> watchAll();
|
||||||
|
Future<void> delete<T>(StoreKey<T> key);
|
||||||
|
Future<bool> insert<T>(StoreKey<T> key, T value);
|
||||||
|
Future<T?> tryGet<T>(StoreKey<T> key);
|
||||||
|
Future<bool> update<T>(StoreKey<T> key, T value);
|
||||||
|
Stream<T?> watch<T>(StoreKey<T> key);
|
||||||
|
Future<List<StoreDto<Object>>> getAll();
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
import 'package:drift/drift.dart';
|
||||||
|
import 'package:immich_mobile/constants/enums.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/user.entity.drift.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/user_metadata.model.dart';
|
||||||
|
|
||||||
|
class DriftUserRepository {
|
||||||
|
final Drift _db;
|
||||||
|
const DriftUserRepository(this._db);
|
||||||
|
|
||||||
|
Future<void> delete(List<String> ids) async {
|
||||||
|
await _db.transaction(() async {
|
||||||
|
await (_db.delete(_db.userEntity)..where((tbl) => tbl.id.isIn(ids))).go();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> deleteAll() async {
|
||||||
|
await _db.transaction(() async {
|
||||||
|
await _db.delete(_db.userEntity).go();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<UserDto>> getAll({SortUserBy? sortBy}) async {
|
||||||
|
var query = _db.select(_db.userEntity);
|
||||||
|
|
||||||
|
if (sortBy != null) {
|
||||||
|
switch (sortBy) {
|
||||||
|
case SortUserBy.id:
|
||||||
|
query = query..orderBy([(u) => OrderingTerm.asc(u.id)]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final users = await query.get();
|
||||||
|
return users.map((u) => _toDto(u)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<UserDto?> getByUserId(String id) async {
|
||||||
|
final user = await (_db.select(_db.userEntity)
|
||||||
|
..where((tbl) => tbl.id.equals(id)))
|
||||||
|
.getSingleOrNull();
|
||||||
|
return user != null ? _toDto(user) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<UserDto?>> getByUserIds(List<String> ids) async {
|
||||||
|
final users = await (_db.select(_db.userEntity)
|
||||||
|
..where((tbl) => tbl.id.isIn(ids)))
|
||||||
|
.get();
|
||||||
|
|
||||||
|
// Create a map for quick lookup
|
||||||
|
final userMap = {for (var user in users) user.id: _toDto(user)};
|
||||||
|
|
||||||
|
// Return results in the same order as input ids
|
||||||
|
return ids.map((id) => userMap[id]).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> insert(UserDto user) async {
|
||||||
|
await _db.transaction(() async {
|
||||||
|
await _db.into(_db.userEntity).insertOnConflictUpdate(_fromDto(user));
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<UserDto> update(UserDto user) async {
|
||||||
|
await _db.transaction(() async {
|
||||||
|
await _db.into(_db.userEntity).insertOnConflictUpdate(_fromDto(user));
|
||||||
|
});
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> updateAll(List<UserDto> users) async {
|
||||||
|
await _db.transaction(() async {
|
||||||
|
await _db.batch((batch) {
|
||||||
|
for (final user in users) {
|
||||||
|
batch.insert(_db.userEntity, _fromDto(user),
|
||||||
|
mode: InsertMode.insertOrReplace);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserDto _toDto(UserEntityData entity) {
|
||||||
|
return UserDto(
|
||||||
|
id: entity.id,
|
||||||
|
updatedAt: entity.updatedAt,
|
||||||
|
email: entity.email,
|
||||||
|
name: entity.name,
|
||||||
|
isAdmin: entity.isAdmin,
|
||||||
|
profileImagePath: entity.profileImagePath ?? '',
|
||||||
|
// Note: These fields are not in the current UserEntity table but are in UserDto
|
||||||
|
// You may need to add them to the table or provide defaults
|
||||||
|
isPartnerSharedBy: false,
|
||||||
|
isPartnerSharedWith: false,
|
||||||
|
avatarColor: AvatarColor.primary,
|
||||||
|
memoryEnabled: true,
|
||||||
|
inTimeline: false,
|
||||||
|
quotaUsageInBytes: entity.quotaUsageInBytes,
|
||||||
|
quotaSizeInBytes: entity.quotaSizeInBytes ?? 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
UserEntityCompanion _fromDto(UserDto dto) {
|
||||||
|
return UserEntityCompanion(
|
||||||
|
id: Value(dto.id),
|
||||||
|
name: Value(dto.name),
|
||||||
|
isAdmin: Value(dto.isAdmin),
|
||||||
|
email: Value(dto.email),
|
||||||
|
profileImagePath: Value.absentIfNull(
|
||||||
|
dto.profileImagePath?.isEmpty == true ? null : dto.profileImagePath),
|
||||||
|
updatedAt: Value(dto.updatedAt),
|
||||||
|
quotaSizeInBytes: Value.absentIfNull(
|
||||||
|
dto.quotaSizeInBytes == 0 ? null : dto.quotaSizeInBytes),
|
||||||
|
quotaUsageInBytes: Value(dto.quotaUsageInBytes),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
import 'package:immich_mobile/domain/models/store.model.dart';
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
import 'package:immich_mobile/domain/models/user.model.dart';
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/store.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/isar_store.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/user.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/user.repository.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/drift_store.repository.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
|
|
||||||
class IsarStoreRepository extends IsarDatabaseRepository {
|
class IsarStoreRepository extends IsarDatabaseRepository
|
||||||
|
implements IStoreRepository {
|
||||||
final Isar _db;
|
final Isar _db;
|
||||||
final validStoreKeys = StoreKey.values.map((e) => e.id).toSet();
|
final validStoreKeys = StoreKey.values.map((e) => e.id).toSet();
|
||||||
|
|
||||||
IsarStoreRepository(super.db) : _db = db;
|
IsarStoreRepository(super.db) : _db = db;
|
||||||
|
|
||||||
|
@override
|
||||||
Future<bool> deleteAll() async {
|
Future<bool> deleteAll() async {
|
||||||
return await transaction(() async {
|
return await transaction(() async {
|
||||||
await _db.storeValues.clear();
|
await _db.storeValues.clear();
|
||||||
@@ -18,6 +21,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Stream<StoreDto<Object>> watchAll() {
|
Stream<StoreDto<Object>> watchAll() {
|
||||||
return _db.storeValues
|
return _db.storeValues
|
||||||
.filter()
|
.filter()
|
||||||
@@ -30,10 +34,12 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<void> delete<T>(StoreKey<T> key) async {
|
Future<void> delete<T>(StoreKey<T> key) async {
|
||||||
return await transaction(() async => await _db.storeValues.delete(key.id));
|
return await transaction(() async => await _db.storeValues.delete(key.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<bool> insert<T>(StoreKey<T> key, T value) async {
|
Future<bool> insert<T>(StoreKey<T> key, T value) async {
|
||||||
return await transaction(() async {
|
return await transaction(() async {
|
||||||
await _db.storeValues.put(await _fromValue(key, value));
|
await _db.storeValues.put(await _fromValue(key, value));
|
||||||
@@ -41,6 +47,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<T?> tryGet<T>(StoreKey<T> key) async {
|
Future<T?> tryGet<T>(StoreKey<T> key) async {
|
||||||
final entity = (await _db.storeValues.get(key.id));
|
final entity = (await _db.storeValues.get(key.id));
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
@@ -49,6 +56,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
return await _toValue(key, entity);
|
return await _toValue(key, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<bool> update<T>(StoreKey<T> key, T value) async {
|
Future<bool> update<T>(StoreKey<T> key, T value) async {
|
||||||
return await transaction(() async {
|
return await transaction(() async {
|
||||||
await _db.storeValues.put(await _fromValue(key, value));
|
await _db.storeValues.put(await _fromValue(key, value));
|
||||||
@@ -56,6 +64,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Stream<T?> watch<T>(StoreKey<T> key) async* {
|
Stream<T?> watch<T>(StoreKey<T> key) async* {
|
||||||
yield* _db.storeValues
|
yield* _db.storeValues
|
||||||
.watchObject(key.id, fireImmediately: true)
|
.watchObject(key.id, fireImmediately: true)
|
||||||
@@ -100,6 +109,7 @@ class IsarStoreRepository extends IsarDatabaseRepository {
|
|||||||
return StoreValue(key.id, intValue: intValue, strValue: strValue);
|
return StoreValue(key.id, intValue: intValue, strValue: strValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<List<StoreDto<Object>>> getAll() async {
|
Future<List<StoreDto<Object>>> getAll() async {
|
||||||
final entities = await _db.storeValues
|
final entities = await _db.storeValues
|
||||||
.filter()
|
.filter()
|
||||||
|
|||||||
@@ -5,8 +5,11 @@ import 'package:drift/drift.dart' hide Column;
|
|||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/store.model.dart';
|
||||||
|
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||||
import 'package:immich_mobile/extensions/theme_extensions.dart';
|
import 'package:immich_mobile/extensions/theme_extensions.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/drift_store.repository.dart';
|
||||||
import 'package:immich_mobile/presentation/pages/dev/dev_logger.dart';
|
import 'package:immich_mobile/presentation/pages/dev/dev_logger.dart';
|
||||||
import 'package:immich_mobile/providers/background_sync.provider.dart';
|
import 'package:immich_mobile/providers/background_sync.provider.dart';
|
||||||
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
import 'package:immich_mobile/providers/infrastructure/db.provider.dart';
|
||||||
@@ -14,6 +17,32 @@ import 'package:immich_mobile/providers/infrastructure/platform.provider.dart';
|
|||||||
import 'package:immich_mobile/routing/router.dart';
|
import 'package:immich_mobile/routing/router.dart';
|
||||||
|
|
||||||
final _features = [
|
final _features = [
|
||||||
|
_Feature(
|
||||||
|
name: 'test',
|
||||||
|
icon: Icons.abc,
|
||||||
|
onTap: (_, ref) {
|
||||||
|
final UserDto value = UserDto(
|
||||||
|
id: "1234",
|
||||||
|
email: "alex@email.com",
|
||||||
|
name: "alex",
|
||||||
|
isAdmin: true,
|
||||||
|
updatedAt: DateTime.now(),
|
||||||
|
);
|
||||||
|
|
||||||
|
ref
|
||||||
|
.read(driftStoreRepositoryProvider)
|
||||||
|
.insert(StoreKey.serverUrl, "https://example.com");
|
||||||
|
|
||||||
|
final readback =
|
||||||
|
ref.read(driftStoreRepositoryProvider).tryGet(StoreKey.serverUrl);
|
||||||
|
|
||||||
|
readback.then((value) {
|
||||||
|
print("Read back: $value");
|
||||||
|
});
|
||||||
|
|
||||||
|
return Future.value();
|
||||||
|
},
|
||||||
|
),
|
||||||
_Feature(
|
_Feature(
|
||||||
name: 'Sync Local',
|
name: 'Sync Local',
|
||||||
icon: Icons.photo_album_rounded,
|
icon: Icons.photo_album_rounded,
|
||||||
|
|||||||
+183
-183
@@ -14,7 +14,7 @@ part of 'router.dart';
|
|||||||
/// [ActivitiesPage]
|
/// [ActivitiesPage]
|
||||||
class ActivitiesRoute extends PageRouteInfo<void> {
|
class ActivitiesRoute extends PageRouteInfo<void> {
|
||||||
const ActivitiesRoute({List<PageRouteInfo>? children})
|
const ActivitiesRoute({List<PageRouteInfo>? children})
|
||||||
: super(ActivitiesRoute.name, initialChildren: children);
|
: super(ActivitiesRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'ActivitiesRoute';
|
static const String name = 'ActivitiesRoute';
|
||||||
|
|
||||||
@@ -35,13 +35,13 @@ class AlbumAdditionalSharedUserSelectionRoute
|
|||||||
required Album album,
|
required Album album,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AlbumAdditionalSharedUserSelectionRoute.name,
|
AlbumAdditionalSharedUserSelectionRoute.name,
|
||||||
args: AlbumAdditionalSharedUserSelectionRouteArgs(
|
args: AlbumAdditionalSharedUserSelectionRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
album: album,
|
album: album,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AlbumAdditionalSharedUserSelectionRoute';
|
static const String name = 'AlbumAdditionalSharedUserSelectionRoute';
|
||||||
|
|
||||||
@@ -83,14 +83,14 @@ class AlbumAssetSelectionRoute
|
|||||||
bool canDeselect = false,
|
bool canDeselect = false,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AlbumAssetSelectionRoute.name,
|
AlbumAssetSelectionRoute.name,
|
||||||
args: AlbumAssetSelectionRouteArgs(
|
args: AlbumAssetSelectionRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
existingAssets: existingAssets,
|
existingAssets: existingAssets,
|
||||||
canDeselect: canDeselect,
|
canDeselect: canDeselect,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AlbumAssetSelectionRoute';
|
static const String name = 'AlbumAssetSelectionRoute';
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ class AlbumAssetSelectionRouteArgs {
|
|||||||
/// [AlbumOptionsPage]
|
/// [AlbumOptionsPage]
|
||||||
class AlbumOptionsRoute extends PageRouteInfo<void> {
|
class AlbumOptionsRoute extends PageRouteInfo<void> {
|
||||||
const AlbumOptionsRoute({List<PageRouteInfo>? children})
|
const AlbumOptionsRoute({List<PageRouteInfo>? children})
|
||||||
: super(AlbumOptionsRoute.name, initialChildren: children);
|
: super(AlbumOptionsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AlbumOptionsRoute';
|
static const String name = 'AlbumOptionsRoute';
|
||||||
|
|
||||||
@@ -150,10 +150,10 @@ class AlbumPreviewRoute extends PageRouteInfo<AlbumPreviewRouteArgs> {
|
|||||||
required Album album,
|
required Album album,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AlbumPreviewRoute.name,
|
AlbumPreviewRoute.name,
|
||||||
args: AlbumPreviewRouteArgs(key: key, album: album),
|
args: AlbumPreviewRouteArgs(key: key, album: album),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AlbumPreviewRoute';
|
static const String name = 'AlbumPreviewRoute';
|
||||||
|
|
||||||
@@ -188,10 +188,10 @@ class AlbumSharedUserSelectionRoute
|
|||||||
required Set<Asset> assets,
|
required Set<Asset> assets,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AlbumSharedUserSelectionRoute.name,
|
AlbumSharedUserSelectionRoute.name,
|
||||||
args: AlbumSharedUserSelectionRouteArgs(key: key, assets: assets),
|
args: AlbumSharedUserSelectionRouteArgs(key: key, assets: assets),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AlbumSharedUserSelectionRoute';
|
static const String name = 'AlbumSharedUserSelectionRoute';
|
||||||
|
|
||||||
@@ -225,10 +225,10 @@ class AlbumViewerRoute extends PageRouteInfo<AlbumViewerRouteArgs> {
|
|||||||
required int albumId,
|
required int albumId,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AlbumViewerRoute.name,
|
AlbumViewerRoute.name,
|
||||||
args: AlbumViewerRouteArgs(key: key, albumId: albumId),
|
args: AlbumViewerRouteArgs(key: key, albumId: albumId),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AlbumViewerRoute';
|
static const String name = 'AlbumViewerRoute';
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ class AlbumViewerRouteArgs {
|
|||||||
/// [AlbumsPage]
|
/// [AlbumsPage]
|
||||||
class AlbumsRoute extends PageRouteInfo<void> {
|
class AlbumsRoute extends PageRouteInfo<void> {
|
||||||
const AlbumsRoute({List<PageRouteInfo>? children})
|
const AlbumsRoute({List<PageRouteInfo>? children})
|
||||||
: super(AlbumsRoute.name, initialChildren: children);
|
: super(AlbumsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AlbumsRoute';
|
static const String name = 'AlbumsRoute';
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ class AlbumsRoute extends PageRouteInfo<void> {
|
|||||||
/// [AllMotionPhotosPage]
|
/// [AllMotionPhotosPage]
|
||||||
class AllMotionPhotosRoute extends PageRouteInfo<void> {
|
class AllMotionPhotosRoute extends PageRouteInfo<void> {
|
||||||
const AllMotionPhotosRoute({List<PageRouteInfo>? children})
|
const AllMotionPhotosRoute({List<PageRouteInfo>? children})
|
||||||
: super(AllMotionPhotosRoute.name, initialChildren: children);
|
: super(AllMotionPhotosRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AllMotionPhotosRoute';
|
static const String name = 'AllMotionPhotosRoute';
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ class AllMotionPhotosRoute extends PageRouteInfo<void> {
|
|||||||
/// [AllPeoplePage]
|
/// [AllPeoplePage]
|
||||||
class AllPeopleRoute extends PageRouteInfo<void> {
|
class AllPeopleRoute extends PageRouteInfo<void> {
|
||||||
const AllPeopleRoute({List<PageRouteInfo>? children})
|
const AllPeopleRoute({List<PageRouteInfo>? children})
|
||||||
: super(AllPeopleRoute.name, initialChildren: children);
|
: super(AllPeopleRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AllPeopleRoute';
|
static const String name = 'AllPeopleRoute';
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ class AllPeopleRoute extends PageRouteInfo<void> {
|
|||||||
/// [AllPlacesPage]
|
/// [AllPlacesPage]
|
||||||
class AllPlacesRoute extends PageRouteInfo<void> {
|
class AllPlacesRoute extends PageRouteInfo<void> {
|
||||||
const AllPlacesRoute({List<PageRouteInfo>? children})
|
const AllPlacesRoute({List<PageRouteInfo>? children})
|
||||||
: super(AllPlacesRoute.name, initialChildren: children);
|
: super(AllPlacesRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AllPlacesRoute';
|
static const String name = 'AllPlacesRoute';
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ class AllPlacesRoute extends PageRouteInfo<void> {
|
|||||||
/// [AllVideosPage]
|
/// [AllVideosPage]
|
||||||
class AllVideosRoute extends PageRouteInfo<void> {
|
class AllVideosRoute extends PageRouteInfo<void> {
|
||||||
const AllVideosRoute({List<PageRouteInfo>? children})
|
const AllVideosRoute({List<PageRouteInfo>? children})
|
||||||
: super(AllVideosRoute.name, initialChildren: children);
|
: super(AllVideosRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AllVideosRoute';
|
static const String name = 'AllVideosRoute';
|
||||||
|
|
||||||
@@ -342,10 +342,10 @@ class AppLogDetailRoute extends PageRouteInfo<AppLogDetailRouteArgs> {
|
|||||||
required LogMessage logMessage,
|
required LogMessage logMessage,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
AppLogDetailRoute.name,
|
AppLogDetailRoute.name,
|
||||||
args: AppLogDetailRouteArgs(key: key, logMessage: logMessage),
|
args: AppLogDetailRouteArgs(key: key, logMessage: logMessage),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AppLogDetailRoute';
|
static const String name = 'AppLogDetailRoute';
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ class AppLogDetailRouteArgs {
|
|||||||
/// [AppLogPage]
|
/// [AppLogPage]
|
||||||
class AppLogRoute extends PageRouteInfo<void> {
|
class AppLogRoute extends PageRouteInfo<void> {
|
||||||
const AppLogRoute({List<PageRouteInfo>? children})
|
const AppLogRoute({List<PageRouteInfo>? children})
|
||||||
: super(AppLogRoute.name, initialChildren: children);
|
: super(AppLogRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'AppLogRoute';
|
static const String name = 'AppLogRoute';
|
||||||
|
|
||||||
@@ -391,7 +391,7 @@ class AppLogRoute extends PageRouteInfo<void> {
|
|||||||
/// [ArchivePage]
|
/// [ArchivePage]
|
||||||
class ArchiveRoute extends PageRouteInfo<void> {
|
class ArchiveRoute extends PageRouteInfo<void> {
|
||||||
const ArchiveRoute({List<PageRouteInfo>? children})
|
const ArchiveRoute({List<PageRouteInfo>? children})
|
||||||
: super(ArchiveRoute.name, initialChildren: children);
|
: super(ArchiveRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'ArchiveRoute';
|
static const String name = 'ArchiveRoute';
|
||||||
|
|
||||||
@@ -407,7 +407,7 @@ class ArchiveRoute extends PageRouteInfo<void> {
|
|||||||
/// [BackupAlbumSelectionPage]
|
/// [BackupAlbumSelectionPage]
|
||||||
class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
|
class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
|
||||||
const BackupAlbumSelectionRoute({List<PageRouteInfo>? children})
|
const BackupAlbumSelectionRoute({List<PageRouteInfo>? children})
|
||||||
: super(BackupAlbumSelectionRoute.name, initialChildren: children);
|
: super(BackupAlbumSelectionRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'BackupAlbumSelectionRoute';
|
static const String name = 'BackupAlbumSelectionRoute';
|
||||||
|
|
||||||
@@ -423,7 +423,7 @@ class BackupAlbumSelectionRoute extends PageRouteInfo<void> {
|
|||||||
/// [BackupControllerPage]
|
/// [BackupControllerPage]
|
||||||
class BackupControllerRoute extends PageRouteInfo<void> {
|
class BackupControllerRoute extends PageRouteInfo<void> {
|
||||||
const BackupControllerRoute({List<PageRouteInfo>? children})
|
const BackupControllerRoute({List<PageRouteInfo>? children})
|
||||||
: super(BackupControllerRoute.name, initialChildren: children);
|
: super(BackupControllerRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'BackupControllerRoute';
|
static const String name = 'BackupControllerRoute';
|
||||||
|
|
||||||
@@ -439,7 +439,7 @@ class BackupControllerRoute extends PageRouteInfo<void> {
|
|||||||
/// [BackupOptionsPage]
|
/// [BackupOptionsPage]
|
||||||
class BackupOptionsRoute extends PageRouteInfo<void> {
|
class BackupOptionsRoute extends PageRouteInfo<void> {
|
||||||
const BackupOptionsRoute({List<PageRouteInfo>? children})
|
const BackupOptionsRoute({List<PageRouteInfo>? children})
|
||||||
: super(BackupOptionsRoute.name, initialChildren: children);
|
: super(BackupOptionsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'BackupOptionsRoute';
|
static const String name = 'BackupOptionsRoute';
|
||||||
|
|
||||||
@@ -455,7 +455,7 @@ class BackupOptionsRoute extends PageRouteInfo<void> {
|
|||||||
/// [ChangePasswordPage]
|
/// [ChangePasswordPage]
|
||||||
class ChangePasswordRoute extends PageRouteInfo<void> {
|
class ChangePasswordRoute extends PageRouteInfo<void> {
|
||||||
const ChangePasswordRoute({List<PageRouteInfo>? children})
|
const ChangePasswordRoute({List<PageRouteInfo>? children})
|
||||||
: super(ChangePasswordRoute.name, initialChildren: children);
|
: super(ChangePasswordRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'ChangePasswordRoute';
|
static const String name = 'ChangePasswordRoute';
|
||||||
|
|
||||||
@@ -475,10 +475,10 @@ class CreateAlbumRoute extends PageRouteInfo<CreateAlbumRouteArgs> {
|
|||||||
List<Asset>? assets,
|
List<Asset>? assets,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
CreateAlbumRoute.name,
|
CreateAlbumRoute.name,
|
||||||
args: CreateAlbumRouteArgs(key: key, assets: assets),
|
args: CreateAlbumRouteArgs(key: key, assets: assets),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'CreateAlbumRoute';
|
static const String name = 'CreateAlbumRoute';
|
||||||
|
|
||||||
@@ -515,10 +515,10 @@ class CropImageRoute extends PageRouteInfo<CropImageRouteArgs> {
|
|||||||
required Asset asset,
|
required Asset asset,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
CropImageRoute.name,
|
CropImageRoute.name,
|
||||||
args: CropImageRouteArgs(key: key, image: image, asset: asset),
|
args: CropImageRouteArgs(key: key, image: image, asset: asset),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'CropImageRoute';
|
static const String name = 'CropImageRoute';
|
||||||
|
|
||||||
@@ -560,15 +560,15 @@ class EditImageRoute extends PageRouteInfo<EditImageRouteArgs> {
|
|||||||
required bool isEdited,
|
required bool isEdited,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
EditImageRoute.name,
|
EditImageRoute.name,
|
||||||
args: EditImageRouteArgs(
|
args: EditImageRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
asset: asset,
|
asset: asset,
|
||||||
image: image,
|
image: image,
|
||||||
isEdited: isEdited,
|
isEdited: isEdited,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'EditImageRoute';
|
static const String name = 'EditImageRoute';
|
||||||
|
|
||||||
@@ -612,7 +612,7 @@ class EditImageRouteArgs {
|
|||||||
/// [FailedBackupStatusPage]
|
/// [FailedBackupStatusPage]
|
||||||
class FailedBackupStatusRoute extends PageRouteInfo<void> {
|
class FailedBackupStatusRoute extends PageRouteInfo<void> {
|
||||||
const FailedBackupStatusRoute({List<PageRouteInfo>? children})
|
const FailedBackupStatusRoute({List<PageRouteInfo>? children})
|
||||||
: super(FailedBackupStatusRoute.name, initialChildren: children);
|
: super(FailedBackupStatusRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'FailedBackupStatusRoute';
|
static const String name = 'FailedBackupStatusRoute';
|
||||||
|
|
||||||
@@ -628,7 +628,7 @@ class FailedBackupStatusRoute extends PageRouteInfo<void> {
|
|||||||
/// [FavoritesPage]
|
/// [FavoritesPage]
|
||||||
class FavoritesRoute extends PageRouteInfo<void> {
|
class FavoritesRoute extends PageRouteInfo<void> {
|
||||||
const FavoritesRoute({List<PageRouteInfo>? children})
|
const FavoritesRoute({List<PageRouteInfo>? children})
|
||||||
: super(FavoritesRoute.name, initialChildren: children);
|
: super(FavoritesRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'FavoritesRoute';
|
static const String name = 'FavoritesRoute';
|
||||||
|
|
||||||
@@ -644,7 +644,7 @@ class FavoritesRoute extends PageRouteInfo<void> {
|
|||||||
/// [FeatInDevPage]
|
/// [FeatInDevPage]
|
||||||
class FeatInDevRoute extends PageRouteInfo<void> {
|
class FeatInDevRoute extends PageRouteInfo<void> {
|
||||||
const FeatInDevRoute({List<PageRouteInfo>? children})
|
const FeatInDevRoute({List<PageRouteInfo>? children})
|
||||||
: super(FeatInDevRoute.name, initialChildren: children);
|
: super(FeatInDevRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'FeatInDevRoute';
|
static const String name = 'FeatInDevRoute';
|
||||||
|
|
||||||
@@ -665,10 +665,10 @@ class FilterImageRoute extends PageRouteInfo<FilterImageRouteArgs> {
|
|||||||
required Asset asset,
|
required Asset asset,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
FilterImageRoute.name,
|
FilterImageRoute.name,
|
||||||
args: FilterImageRouteArgs(key: key, image: image, asset: asset),
|
args: FilterImageRouteArgs(key: key, image: image, asset: asset),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'FilterImageRoute';
|
static const String name = 'FilterImageRoute';
|
||||||
|
|
||||||
@@ -712,10 +712,10 @@ class FolderRoute extends PageRouteInfo<FolderRouteArgs> {
|
|||||||
RecursiveFolder? folder,
|
RecursiveFolder? folder,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
FolderRoute.name,
|
FolderRoute.name,
|
||||||
args: FolderRouteArgs(key: key, folder: folder),
|
args: FolderRouteArgs(key: key, folder: folder),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'FolderRoute';
|
static const String name = 'FolderRoute';
|
||||||
|
|
||||||
@@ -754,16 +754,16 @@ class GalleryViewerRoute extends PageRouteInfo<GalleryViewerRouteArgs> {
|
|||||||
bool showStack = false,
|
bool showStack = false,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
GalleryViewerRoute.name,
|
GalleryViewerRoute.name,
|
||||||
args: GalleryViewerRouteArgs(
|
args: GalleryViewerRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
renderList: renderList,
|
renderList: renderList,
|
||||||
initialIndex: initialIndex,
|
initialIndex: initialIndex,
|
||||||
heroOffset: heroOffset,
|
heroOffset: heroOffset,
|
||||||
showStack: showStack,
|
showStack: showStack,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'GalleryViewerRoute';
|
static const String name = 'GalleryViewerRoute';
|
||||||
|
|
||||||
@@ -811,7 +811,7 @@ class GalleryViewerRouteArgs {
|
|||||||
/// [HeaderSettingsPage]
|
/// [HeaderSettingsPage]
|
||||||
class HeaderSettingsRoute extends PageRouteInfo<void> {
|
class HeaderSettingsRoute extends PageRouteInfo<void> {
|
||||||
const HeaderSettingsRoute({List<PageRouteInfo>? children})
|
const HeaderSettingsRoute({List<PageRouteInfo>? children})
|
||||||
: super(HeaderSettingsRoute.name, initialChildren: children);
|
: super(HeaderSettingsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'HeaderSettingsRoute';
|
static const String name = 'HeaderSettingsRoute';
|
||||||
|
|
||||||
@@ -827,7 +827,7 @@ class HeaderSettingsRoute extends PageRouteInfo<void> {
|
|||||||
/// [LibraryPage]
|
/// [LibraryPage]
|
||||||
class LibraryRoute extends PageRouteInfo<void> {
|
class LibraryRoute extends PageRouteInfo<void> {
|
||||||
const LibraryRoute({List<PageRouteInfo>? children})
|
const LibraryRoute({List<PageRouteInfo>? children})
|
||||||
: super(LibraryRoute.name, initialChildren: children);
|
: super(LibraryRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LibraryRoute';
|
static const String name = 'LibraryRoute';
|
||||||
|
|
||||||
@@ -843,7 +843,7 @@ class LibraryRoute extends PageRouteInfo<void> {
|
|||||||
/// [LocalAlbumsPage]
|
/// [LocalAlbumsPage]
|
||||||
class LocalAlbumsRoute extends PageRouteInfo<void> {
|
class LocalAlbumsRoute extends PageRouteInfo<void> {
|
||||||
const LocalAlbumsRoute({List<PageRouteInfo>? children})
|
const LocalAlbumsRoute({List<PageRouteInfo>? children})
|
||||||
: super(LocalAlbumsRoute.name, initialChildren: children);
|
: super(LocalAlbumsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LocalAlbumsRoute';
|
static const String name = 'LocalAlbumsRoute';
|
||||||
|
|
||||||
@@ -859,7 +859,7 @@ class LocalAlbumsRoute extends PageRouteInfo<void> {
|
|||||||
/// [LocalMediaSummaryPage]
|
/// [LocalMediaSummaryPage]
|
||||||
class LocalMediaSummaryRoute extends PageRouteInfo<void> {
|
class LocalMediaSummaryRoute extends PageRouteInfo<void> {
|
||||||
const LocalMediaSummaryRoute({List<PageRouteInfo>? children})
|
const LocalMediaSummaryRoute({List<PageRouteInfo>? children})
|
||||||
: super(LocalMediaSummaryRoute.name, initialChildren: children);
|
: super(LocalMediaSummaryRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LocalMediaSummaryRoute';
|
static const String name = 'LocalMediaSummaryRoute';
|
||||||
|
|
||||||
@@ -879,10 +879,10 @@ class LocalTimelineRoute extends PageRouteInfo<LocalTimelineRouteArgs> {
|
|||||||
required String albumId,
|
required String albumId,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
LocalTimelineRoute.name,
|
LocalTimelineRoute.name,
|
||||||
args: LocalTimelineRouteArgs(key: key, albumId: albumId),
|
args: LocalTimelineRouteArgs(key: key, albumId: albumId),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'LocalTimelineRoute';
|
static const String name = 'LocalTimelineRoute';
|
||||||
|
|
||||||
@@ -912,7 +912,7 @@ class LocalTimelineRouteArgs {
|
|||||||
/// [LockedPage]
|
/// [LockedPage]
|
||||||
class LockedRoute extends PageRouteInfo<void> {
|
class LockedRoute extends PageRouteInfo<void> {
|
||||||
const LockedRoute({List<PageRouteInfo>? children})
|
const LockedRoute({List<PageRouteInfo>? children})
|
||||||
: super(LockedRoute.name, initialChildren: children);
|
: super(LockedRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LockedRoute';
|
static const String name = 'LockedRoute';
|
||||||
|
|
||||||
@@ -928,7 +928,7 @@ class LockedRoute extends PageRouteInfo<void> {
|
|||||||
/// [LoginPage]
|
/// [LoginPage]
|
||||||
class LoginRoute extends PageRouteInfo<void> {
|
class LoginRoute extends PageRouteInfo<void> {
|
||||||
const LoginRoute({List<PageRouteInfo>? children})
|
const LoginRoute({List<PageRouteInfo>? children})
|
||||||
: super(LoginRoute.name, initialChildren: children);
|
: super(LoginRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'LoginRoute';
|
static const String name = 'LoginRoute';
|
||||||
|
|
||||||
@@ -944,7 +944,7 @@ class LoginRoute extends PageRouteInfo<void> {
|
|||||||
/// [MainTimelinePage]
|
/// [MainTimelinePage]
|
||||||
class MainTimelineRoute extends PageRouteInfo<void> {
|
class MainTimelineRoute extends PageRouteInfo<void> {
|
||||||
const MainTimelineRoute({List<PageRouteInfo>? children})
|
const MainTimelineRoute({List<PageRouteInfo>? children})
|
||||||
: super(MainTimelineRoute.name, initialChildren: children);
|
: super(MainTimelineRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'MainTimelineRoute';
|
static const String name = 'MainTimelineRoute';
|
||||||
|
|
||||||
@@ -964,13 +964,13 @@ class MapLocationPickerRoute extends PageRouteInfo<MapLocationPickerRouteArgs> {
|
|||||||
LatLng initialLatLng = const LatLng(0, 0),
|
LatLng initialLatLng = const LatLng(0, 0),
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
MapLocationPickerRoute.name,
|
MapLocationPickerRoute.name,
|
||||||
args: MapLocationPickerRouteArgs(
|
args: MapLocationPickerRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
initialLatLng: initialLatLng,
|
initialLatLng: initialLatLng,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'MapLocationPickerRoute';
|
static const String name = 'MapLocationPickerRoute';
|
||||||
|
|
||||||
@@ -1008,11 +1008,11 @@ class MapLocationPickerRouteArgs {
|
|||||||
/// [MapPage]
|
/// [MapPage]
|
||||||
class MapRoute extends PageRouteInfo<MapRouteArgs> {
|
class MapRoute extends PageRouteInfo<MapRouteArgs> {
|
||||||
MapRoute({Key? key, LatLng? initialLocation, List<PageRouteInfo>? children})
|
MapRoute({Key? key, LatLng? initialLocation, List<PageRouteInfo>? children})
|
||||||
: super(
|
: super(
|
||||||
MapRoute.name,
|
MapRoute.name,
|
||||||
args: MapRouteArgs(key: key, initialLocation: initialLocation),
|
args: MapRouteArgs(key: key, initialLocation: initialLocation),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'MapRoute';
|
static const String name = 'MapRoute';
|
||||||
|
|
||||||
@@ -1049,14 +1049,14 @@ class MemoryRoute extends PageRouteInfo<MemoryRouteArgs> {
|
|||||||
Key? key,
|
Key? key,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
MemoryRoute.name,
|
MemoryRoute.name,
|
||||||
args: MemoryRouteArgs(
|
args: MemoryRouteArgs(
|
||||||
memories: memories,
|
memories: memories,
|
||||||
memoryIndex: memoryIndex,
|
memoryIndex: memoryIndex,
|
||||||
key: key,
|
key: key,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'MemoryRoute';
|
static const String name = 'MemoryRoute';
|
||||||
|
|
||||||
@@ -1103,16 +1103,16 @@ class NativeVideoViewerRoute extends PageRouteInfo<NativeVideoViewerRouteArgs> {
|
|||||||
int playbackDelayFactor = 1,
|
int playbackDelayFactor = 1,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
NativeVideoViewerRoute.name,
|
NativeVideoViewerRoute.name,
|
||||||
args: NativeVideoViewerRouteArgs(
|
args: NativeVideoViewerRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
asset: asset,
|
asset: asset,
|
||||||
image: image,
|
image: image,
|
||||||
showControls: showControls,
|
showControls: showControls,
|
||||||
playbackDelayFactor: playbackDelayFactor,
|
playbackDelayFactor: playbackDelayFactor,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'NativeVideoViewerRoute';
|
static const String name = 'NativeVideoViewerRoute';
|
||||||
|
|
||||||
@@ -1164,10 +1164,10 @@ class PartnerDetailRoute extends PageRouteInfo<PartnerDetailRouteArgs> {
|
|||||||
required UserDto partner,
|
required UserDto partner,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
PartnerDetailRoute.name,
|
PartnerDetailRoute.name,
|
||||||
args: PartnerDetailRouteArgs(key: key, partner: partner),
|
args: PartnerDetailRouteArgs(key: key, partner: partner),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'PartnerDetailRoute';
|
static const String name = 'PartnerDetailRoute';
|
||||||
|
|
||||||
@@ -1197,7 +1197,7 @@ class PartnerDetailRouteArgs {
|
|||||||
/// [PartnerPage]
|
/// [PartnerPage]
|
||||||
class PartnerRoute extends PageRouteInfo<void> {
|
class PartnerRoute extends PageRouteInfo<void> {
|
||||||
const PartnerRoute({List<PageRouteInfo>? children})
|
const PartnerRoute({List<PageRouteInfo>? children})
|
||||||
: super(PartnerRoute.name, initialChildren: children);
|
: super(PartnerRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'PartnerRoute';
|
static const String name = 'PartnerRoute';
|
||||||
|
|
||||||
@@ -1213,7 +1213,7 @@ class PartnerRoute extends PageRouteInfo<void> {
|
|||||||
/// [PeopleCollectionPage]
|
/// [PeopleCollectionPage]
|
||||||
class PeopleCollectionRoute extends PageRouteInfo<void> {
|
class PeopleCollectionRoute extends PageRouteInfo<void> {
|
||||||
const PeopleCollectionRoute({List<PageRouteInfo>? children})
|
const PeopleCollectionRoute({List<PageRouteInfo>? children})
|
||||||
: super(PeopleCollectionRoute.name, initialChildren: children);
|
: super(PeopleCollectionRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'PeopleCollectionRoute';
|
static const String name = 'PeopleCollectionRoute';
|
||||||
|
|
||||||
@@ -1229,7 +1229,7 @@ class PeopleCollectionRoute extends PageRouteInfo<void> {
|
|||||||
/// [PermissionOnboardingPage]
|
/// [PermissionOnboardingPage]
|
||||||
class PermissionOnboardingRoute extends PageRouteInfo<void> {
|
class PermissionOnboardingRoute extends PageRouteInfo<void> {
|
||||||
const PermissionOnboardingRoute({List<PageRouteInfo>? children})
|
const PermissionOnboardingRoute({List<PageRouteInfo>? children})
|
||||||
: super(PermissionOnboardingRoute.name, initialChildren: children);
|
: super(PermissionOnboardingRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'PermissionOnboardingRoute';
|
static const String name = 'PermissionOnboardingRoute';
|
||||||
|
|
||||||
@@ -1250,14 +1250,14 @@ class PersonResultRoute extends PageRouteInfo<PersonResultRouteArgs> {
|
|||||||
required String personName,
|
required String personName,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
PersonResultRoute.name,
|
PersonResultRoute.name,
|
||||||
args: PersonResultRouteArgs(
|
args: PersonResultRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
personId: personId,
|
personId: personId,
|
||||||
personName: personName,
|
personName: personName,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'PersonResultRoute';
|
static const String name = 'PersonResultRoute';
|
||||||
|
|
||||||
@@ -1297,7 +1297,7 @@ class PersonResultRouteArgs {
|
|||||||
/// [PhotosPage]
|
/// [PhotosPage]
|
||||||
class PhotosRoute extends PageRouteInfo<void> {
|
class PhotosRoute extends PageRouteInfo<void> {
|
||||||
const PhotosRoute({List<PageRouteInfo>? children})
|
const PhotosRoute({List<PageRouteInfo>? children})
|
||||||
: super(PhotosRoute.name, initialChildren: children);
|
: super(PhotosRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'PhotosRoute';
|
static const String name = 'PhotosRoute';
|
||||||
|
|
||||||
@@ -1317,10 +1317,10 @@ class PinAuthRoute extends PageRouteInfo<PinAuthRouteArgs> {
|
|||||||
bool createPinCode = false,
|
bool createPinCode = false,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
PinAuthRoute.name,
|
PinAuthRoute.name,
|
||||||
args: PinAuthRouteArgs(key: key, createPinCode: createPinCode),
|
args: PinAuthRouteArgs(key: key, createPinCode: createPinCode),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'PinAuthRoute';
|
static const String name = 'PinAuthRoute';
|
||||||
|
|
||||||
@@ -1356,13 +1356,13 @@ class PlacesCollectionRoute extends PageRouteInfo<PlacesCollectionRouteArgs> {
|
|||||||
LatLng? currentLocation,
|
LatLng? currentLocation,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
PlacesCollectionRoute.name,
|
PlacesCollectionRoute.name,
|
||||||
args: PlacesCollectionRouteArgs(
|
args: PlacesCollectionRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
currentLocation: currentLocation,
|
currentLocation: currentLocation,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'PlacesCollectionRoute';
|
static const String name = 'PlacesCollectionRoute';
|
||||||
|
|
||||||
@@ -1397,7 +1397,7 @@ class PlacesCollectionRouteArgs {
|
|||||||
/// [RecentlyTakenPage]
|
/// [RecentlyTakenPage]
|
||||||
class RecentlyTakenRoute extends PageRouteInfo<void> {
|
class RecentlyTakenRoute extends PageRouteInfo<void> {
|
||||||
const RecentlyTakenRoute({List<PageRouteInfo>? children})
|
const RecentlyTakenRoute({List<PageRouteInfo>? children})
|
||||||
: super(RecentlyTakenRoute.name, initialChildren: children);
|
: super(RecentlyTakenRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'RecentlyTakenRoute';
|
static const String name = 'RecentlyTakenRoute';
|
||||||
|
|
||||||
@@ -1413,7 +1413,7 @@ class RecentlyTakenRoute extends PageRouteInfo<void> {
|
|||||||
/// [RemoteMediaSummaryPage]
|
/// [RemoteMediaSummaryPage]
|
||||||
class RemoteMediaSummaryRoute extends PageRouteInfo<void> {
|
class RemoteMediaSummaryRoute extends PageRouteInfo<void> {
|
||||||
const RemoteMediaSummaryRoute({List<PageRouteInfo>? children})
|
const RemoteMediaSummaryRoute({List<PageRouteInfo>? children})
|
||||||
: super(RemoteMediaSummaryRoute.name, initialChildren: children);
|
: super(RemoteMediaSummaryRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'RemoteMediaSummaryRoute';
|
static const String name = 'RemoteMediaSummaryRoute';
|
||||||
|
|
||||||
@@ -1433,10 +1433,10 @@ class RemoteTimelineRoute extends PageRouteInfo<RemoteTimelineRouteArgs> {
|
|||||||
required String albumId,
|
required String albumId,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
RemoteTimelineRoute.name,
|
RemoteTimelineRoute.name,
|
||||||
args: RemoteTimelineRouteArgs(key: key, albumId: albumId),
|
args: RemoteTimelineRouteArgs(key: key, albumId: albumId),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'RemoteTimelineRoute';
|
static const String name = 'RemoteTimelineRoute';
|
||||||
|
|
||||||
@@ -1470,10 +1470,10 @@ class SearchRoute extends PageRouteInfo<SearchRouteArgs> {
|
|||||||
SearchFilter? prefilter,
|
SearchFilter? prefilter,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
SearchRoute.name,
|
SearchRoute.name,
|
||||||
args: SearchRouteArgs(key: key, prefilter: prefilter),
|
args: SearchRouteArgs(key: key, prefilter: prefilter),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'SearchRoute';
|
static const String name = 'SearchRoute';
|
||||||
|
|
||||||
@@ -1505,7 +1505,7 @@ class SearchRouteArgs {
|
|||||||
/// [SettingsPage]
|
/// [SettingsPage]
|
||||||
class SettingsRoute extends PageRouteInfo<void> {
|
class SettingsRoute extends PageRouteInfo<void> {
|
||||||
const SettingsRoute({List<PageRouteInfo>? children})
|
const SettingsRoute({List<PageRouteInfo>? children})
|
||||||
: super(SettingsRoute.name, initialChildren: children);
|
: super(SettingsRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SettingsRoute';
|
static const String name = 'SettingsRoute';
|
||||||
|
|
||||||
@@ -1525,10 +1525,10 @@ class SettingsSubRoute extends PageRouteInfo<SettingsSubRouteArgs> {
|
|||||||
Key? key,
|
Key? key,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
SettingsSubRoute.name,
|
SettingsSubRoute.name,
|
||||||
args: SettingsSubRouteArgs(section: section, key: key),
|
args: SettingsSubRouteArgs(section: section, key: key),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'SettingsSubRoute';
|
static const String name = 'SettingsSubRoute';
|
||||||
|
|
||||||
@@ -1562,10 +1562,10 @@ class ShareIntentRoute extends PageRouteInfo<ShareIntentRouteArgs> {
|
|||||||
required List<ShareIntentAttachment> attachments,
|
required List<ShareIntentAttachment> attachments,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
ShareIntentRoute.name,
|
ShareIntentRoute.name,
|
||||||
args: ShareIntentRouteArgs(key: key, attachments: attachments),
|
args: ShareIntentRouteArgs(key: key, attachments: attachments),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'ShareIntentRoute';
|
static const String name = 'ShareIntentRoute';
|
||||||
|
|
||||||
@@ -1601,15 +1601,15 @@ class SharedLinkEditRoute extends PageRouteInfo<SharedLinkEditRouteArgs> {
|
|||||||
String? albumId,
|
String? albumId,
|
||||||
List<PageRouteInfo>? children,
|
List<PageRouteInfo>? children,
|
||||||
}) : super(
|
}) : super(
|
||||||
SharedLinkEditRoute.name,
|
SharedLinkEditRoute.name,
|
||||||
args: SharedLinkEditRouteArgs(
|
args: SharedLinkEditRouteArgs(
|
||||||
key: key,
|
key: key,
|
||||||
existingLink: existingLink,
|
existingLink: existingLink,
|
||||||
assetsList: assetsList,
|
assetsList: assetsList,
|
||||||
albumId: albumId,
|
albumId: albumId,
|
||||||
),
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'SharedLinkEditRoute';
|
static const String name = 'SharedLinkEditRoute';
|
||||||
|
|
||||||
@@ -1655,7 +1655,7 @@ class SharedLinkEditRouteArgs {
|
|||||||
/// [SharedLinkPage]
|
/// [SharedLinkPage]
|
||||||
class SharedLinkRoute extends PageRouteInfo<void> {
|
class SharedLinkRoute extends PageRouteInfo<void> {
|
||||||
const SharedLinkRoute({List<PageRouteInfo>? children})
|
const SharedLinkRoute({List<PageRouteInfo>? children})
|
||||||
: super(SharedLinkRoute.name, initialChildren: children);
|
: super(SharedLinkRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SharedLinkRoute';
|
static const String name = 'SharedLinkRoute';
|
||||||
|
|
||||||
@@ -1671,7 +1671,7 @@ class SharedLinkRoute extends PageRouteInfo<void> {
|
|||||||
/// [SplashScreenPage]
|
/// [SplashScreenPage]
|
||||||
class SplashScreenRoute extends PageRouteInfo<void> {
|
class SplashScreenRoute extends PageRouteInfo<void> {
|
||||||
const SplashScreenRoute({List<PageRouteInfo>? children})
|
const SplashScreenRoute({List<PageRouteInfo>? children})
|
||||||
: super(SplashScreenRoute.name, initialChildren: children);
|
: super(SplashScreenRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'SplashScreenRoute';
|
static const String name = 'SplashScreenRoute';
|
||||||
|
|
||||||
@@ -1687,7 +1687,7 @@ class SplashScreenRoute extends PageRouteInfo<void> {
|
|||||||
/// [TabControllerPage]
|
/// [TabControllerPage]
|
||||||
class TabControllerRoute extends PageRouteInfo<void> {
|
class TabControllerRoute extends PageRouteInfo<void> {
|
||||||
const TabControllerRoute({List<PageRouteInfo>? children})
|
const TabControllerRoute({List<PageRouteInfo>? children})
|
||||||
: super(TabControllerRoute.name, initialChildren: children);
|
: super(TabControllerRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'TabControllerRoute';
|
static const String name = 'TabControllerRoute';
|
||||||
|
|
||||||
@@ -1703,7 +1703,7 @@ class TabControllerRoute extends PageRouteInfo<void> {
|
|||||||
/// [TabShellPage]
|
/// [TabShellPage]
|
||||||
class TabShellRoute extends PageRouteInfo<void> {
|
class TabShellRoute extends PageRouteInfo<void> {
|
||||||
const TabShellRoute({List<PageRouteInfo>? children})
|
const TabShellRoute({List<PageRouteInfo>? children})
|
||||||
: super(TabShellRoute.name, initialChildren: children);
|
: super(TabShellRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'TabShellRoute';
|
static const String name = 'TabShellRoute';
|
||||||
|
|
||||||
@@ -1719,7 +1719,7 @@ class TabShellRoute extends PageRouteInfo<void> {
|
|||||||
/// [TrashPage]
|
/// [TrashPage]
|
||||||
class TrashRoute extends PageRouteInfo<void> {
|
class TrashRoute extends PageRouteInfo<void> {
|
||||||
const TrashRoute({List<PageRouteInfo>? children})
|
const TrashRoute({List<PageRouteInfo>? children})
|
||||||
: super(TrashRoute.name, initialChildren: children);
|
: super(TrashRoute.name, initialChildren: children);
|
||||||
|
|
||||||
static const String name = 'TrashRoute';
|
static const String name = 'TrashRoute';
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ import 'package:immich_mobile/entities/ios_device_asset.entity.dart';
|
|||||||
import 'package:immich_mobile/infrastructure/entities/device_asset.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/device_asset.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/log.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/log.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/store.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/isar_store.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/log.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/log.repository.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/store.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/store.repository.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/repositories/drift_store.repository.dart';
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
@@ -48,6 +50,10 @@ abstract final class Bootstrap {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<Drift> initDrift() async {
|
||||||
|
return Drift();
|
||||||
|
}
|
||||||
|
|
||||||
static Future<void> initDomain(
|
static Future<void> initDomain(
|
||||||
Isar db, {
|
Isar db, {
|
||||||
bool shouldBufferLogs = true,
|
bool shouldBufferLogs = true,
|
||||||
@@ -59,4 +65,17 @@ abstract final class Bootstrap {
|
|||||||
shouldBuffer: shouldBufferLogs,
|
shouldBuffer: shouldBufferLogs,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Future<void> initDomainWithDrift(
|
||||||
|
Drift db, {
|
||||||
|
bool shouldBufferLogs = true,
|
||||||
|
}) async {
|
||||||
|
await StoreService.init(storeRepository: DriftStoreRepository(db));
|
||||||
|
final isarDb = await initIsar();
|
||||||
|
await LogService.init(
|
||||||
|
logRepository: IsarLogRepository(isarDb),
|
||||||
|
storeRepository: DriftStoreRepository(db),
|
||||||
|
shouldBuffer: shouldBufferLogs,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ import 'package:immich_mobile/entities/ios_device_asset.entity.dart';
|
|||||||
import 'package:immich_mobile/entities/store.entity.dart';
|
import 'package:immich_mobile/entities/store.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/device_asset.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/device_asset.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/exif.entity.dart';
|
||||||
|
import 'package:immich_mobile/infrastructure/entities/isar_store.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart';
|
import 'package:immich_mobile/infrastructure/entities/local_asset.entity.drift.dart';
|
||||||
import 'package:immich_mobile/infrastructure/entities/store.entity.dart';
|
|
||||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||||
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
import 'package:immich_mobile/infrastructure/repositories/db.repository.dart';
|
||||||
import 'package:immich_mobile/utils/diff.dart';
|
import 'package:immich_mobile/utils/diff.dart';
|
||||||
|
|||||||
Reference in New Issue
Block a user