push
This commit is contained in:
@@ -40,7 +40,7 @@ class PreferenceSetting with FastEquatable {
|
||||
|
||||
bool get isActive => value == actualValue;
|
||||
|
||||
final String title;
|
||||
final String? title;
|
||||
final String? description;
|
||||
|
||||
final bool requireUserOptIn;
|
||||
|
||||
+5
-5
@@ -73,7 +73,7 @@ extension $PreferenceSettingGroupCopyWith on PreferenceSettingGroup {
|
||||
abstract class _$PreferenceSettingCWProxy {
|
||||
PreferenceSetting value(Object value);
|
||||
|
||||
PreferenceSetting title(String title);
|
||||
PreferenceSetting title(String? title);
|
||||
|
||||
PreferenceSetting description(String? description);
|
||||
|
||||
@@ -91,7 +91,7 @@ abstract class _$PreferenceSettingCWProxy {
|
||||
/// ````
|
||||
PreferenceSetting call({
|
||||
Object value,
|
||||
String title,
|
||||
String? title,
|
||||
String? description,
|
||||
Object? actualValue,
|
||||
bool requireUserOptIn,
|
||||
@@ -109,7 +109,7 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy {
|
||||
PreferenceSetting value(Object value) => this(value: value);
|
||||
|
||||
@override
|
||||
PreferenceSetting title(String title) => this(title: title);
|
||||
PreferenceSetting title(String? title) => this(title: title);
|
||||
|
||||
@override
|
||||
PreferenceSetting description(String? description) =>
|
||||
@@ -151,7 +151,7 @@ class _$PreferenceSettingCWProxyImpl implements _$PreferenceSettingCWProxy {
|
||||
title: title == const $CopyWithPlaceholder()
|
||||
? _value.title
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: title as String,
|
||||
: title as String?,
|
||||
description: description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
@@ -186,7 +186,7 @@ extension $PreferenceSettingCopyWith on PreferenceSetting {
|
||||
PreferenceSetting _$PreferenceSettingFromJson(Map<String, dynamic> json) =>
|
||||
PreferenceSetting(
|
||||
value: json['value'] as Object,
|
||||
title: json['title'] as String,
|
||||
title: json['title'] as String?,
|
||||
description: json['description'] as String?,
|
||||
requireUserOptIn: json['requireUserOptIn'] as bool? ?? false,
|
||||
shouldBeDefault: json['shouldBeDefault'] as bool? ?? false,
|
||||
|
||||
+49
-41
@@ -5,6 +5,7 @@ import 'package:collection/collection.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:lensai/features/geckoview/features/preferences/data/models/preference_setting.dart';
|
||||
import 'package:lensai/features/geckoview/features/tabs/utils/setting_groups_serializer.dart';
|
||||
import 'package:riverpod/riverpod.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:rxdart/rxdart.dart';
|
||||
@@ -12,40 +13,29 @@ import 'package:rxdart/rxdart.dart';
|
||||
part 'preference_settings.g.dart';
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
Future<Map<String, PreferenceSettingGroup>> _preferenceSettingGroups(
|
||||
Ref ref,
|
||||
) async {
|
||||
final content = await rootBundle
|
||||
Future<Map<String, dynamic>> _preferenceSettingContent(Ref ref) async {
|
||||
return await rootBundle
|
||||
.loadString('assets/preferences/settings.json')
|
||||
.then(jsonDecode) as Map<String, dynamic>;
|
||||
}
|
||||
|
||||
final userContent = content['user'] as Map<String, dynamic>;
|
||||
|
||||
return userContent.map(
|
||||
(key, value) => MapEntry(
|
||||
key,
|
||||
PreferenceSettingGroup(
|
||||
// ignore: avoid_dynamic_calls
|
||||
description: value['description'] as String?,
|
||||
// ignore: avoid_dynamic_calls
|
||||
settings: (value['preferences'] as Map<String, dynamic>).map(
|
||||
(key, value) => MapEntry(
|
||||
key,
|
||||
PreferenceSetting.fromJson(value as Map<String, dynamic>),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@Riverpod(keepAlive: true)
|
||||
Future<Map<String, PreferenceSettingGroup>> _preferenceSettingGroups(
|
||||
Ref ref,
|
||||
PreferencePartition partition,
|
||||
) async {
|
||||
final content = await ref.read(_preferenceSettingContentProvider.future);
|
||||
return deserializePreferenceSettingGroups(partition, content);
|
||||
}
|
||||
|
||||
@Riverpod(keepAlive: true)
|
||||
Future<PreferenceSettingGroup> _preferenceSettingGroup(
|
||||
Ref ref,
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) {
|
||||
return ref.watch(
|
||||
_preferenceSettingGroupsProvider.selectAsync(
|
||||
_preferenceSettingGroupsProvider(partition).selectAsync(
|
||||
(groups) =>
|
||||
groups[groupName] ?? (throw Exception('Unknown setting group')),
|
||||
),
|
||||
@@ -90,13 +80,16 @@ class _PreferenceRepository extends _$PreferenceRepository {
|
||||
}
|
||||
|
||||
@Riverpod()
|
||||
class PreferenceSettingsGeneralRepository
|
||||
extends _$PreferenceSettingsGeneralRepository {
|
||||
late Map<String, PreferenceSettingGroup> _statelessGroups;
|
||||
class UnifiedPreferenceSettingsRepository
|
||||
extends _$UnifiedPreferenceSettingsRepository {
|
||||
Map<String, PreferenceSettingGroup>? _statelessGroups;
|
||||
|
||||
Future<void> apply() async {
|
||||
_statelessGroups =
|
||||
await ref.read(_preferenceSettingGroupsProvider(partition).future);
|
||||
|
||||
final prefs = {
|
||||
for (final group in _statelessGroups.values)
|
||||
for (final group in _statelessGroups!.values)
|
||||
...Map.fromEntries(
|
||||
group.settings.entries
|
||||
.where((e) => !e.value.requireUserOptIn)
|
||||
@@ -108,7 +101,10 @@ class PreferenceSettingsGeneralRepository
|
||||
}
|
||||
|
||||
Future<void> reset() async {
|
||||
final prefs = _statelessGroups.values
|
||||
_statelessGroups =
|
||||
await ref.read(_preferenceSettingGroupsProvider(partition).future);
|
||||
|
||||
final prefs = _statelessGroups!.values
|
||||
.map((group) => group.settings.keys)
|
||||
.flattened
|
||||
.toList();
|
||||
@@ -117,13 +113,16 @@ class PreferenceSettingsGeneralRepository
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<Map<String, PreferenceSettingGroup>> build() async* {
|
||||
_statelessGroups = await ref.watch(_preferenceSettingGroupsProvider.future);
|
||||
Stream<Map<String, PreferenceSettingGroup>> build(
|
||||
PreferencePartition partition,
|
||||
) async* {
|
||||
_statelessGroups =
|
||||
await ref.watch(_preferenceSettingGroupsProvider(partition).future);
|
||||
|
||||
final prefStream = ref.watch(_preferenceRepositoryProvider);
|
||||
|
||||
yield* prefStream.map(
|
||||
(prefs) => _statelessGroups.map(
|
||||
(prefs) => _statelessGroups!.map(
|
||||
(groupName, group) => MapEntry(
|
||||
groupName,
|
||||
group.copyWith.settings(
|
||||
@@ -143,18 +142,21 @@ class PreferenceSettingsGeneralRepository
|
||||
@Riverpod()
|
||||
class PreferenceSettingsGroupRepository
|
||||
extends _$PreferenceSettingsGroupRepository {
|
||||
late PreferenceSettingGroup _statelessSettingGroup;
|
||||
PreferenceSettingGroup? _statelessSettingGroup;
|
||||
|
||||
Future<void> apply({List<String>? filter}) async {
|
||||
_statelessSettingGroup ??= await ref
|
||||
.read(_preferenceSettingGroupProvider(partition, groupName).future);
|
||||
|
||||
final prefs = Map.fromEntries(
|
||||
filter?.map(
|
||||
(e) => MapEntry(
|
||||
e,
|
||||
_statelessSettingGroup.settings[e]?.value ??
|
||||
_statelessSettingGroup!.settings[e]?.value ??
|
||||
(throw Exception('Preference not part of group')),
|
||||
),
|
||||
) ??
|
||||
_statelessSettingGroup.settings.entries
|
||||
_statelessSettingGroup!.settings.entries
|
||||
.where((e) => !e.value.requireUserOptIn)
|
||||
.map((e) => MapEntry(e.key, e.value.value)),
|
||||
);
|
||||
@@ -163,28 +165,34 @@ class PreferenceSettingsGroupRepository
|
||||
}
|
||||
|
||||
Future<void> reset({List<String>? filter}) async {
|
||||
_statelessSettingGroup ??= await ref
|
||||
.read(_preferenceSettingGroupProvider(partition, groupName).future);
|
||||
|
||||
if (filter != null &&
|
||||
filter.any(
|
||||
(value) => !_statelessSettingGroup.settings.containsKey(value),
|
||||
(value) => !_statelessSettingGroup!.settings.containsKey(value),
|
||||
)) {
|
||||
throw Exception('Preference not part of group');
|
||||
}
|
||||
|
||||
await ref
|
||||
.read(_preferenceRepositoryProvider.notifier)
|
||||
.resetPrefs(filter ?? _statelessSettingGroup.settings.keys.toList());
|
||||
.resetPrefs(filter ?? _statelessSettingGroup!.settings.keys.toList());
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<PreferenceSettingGroup> build(String groupName) async* {
|
||||
_statelessSettingGroup =
|
||||
await ref.watch(_preferenceSettingGroupProvider(groupName).future);
|
||||
Stream<PreferenceSettingGroup> build(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) async* {
|
||||
_statelessSettingGroup = await ref
|
||||
.watch(_preferenceSettingGroupProvider(partition, groupName).future);
|
||||
|
||||
final prefStream = ref.watch(_preferenceRepositoryProvider);
|
||||
|
||||
yield* prefStream.map(
|
||||
(prefs) => _statelessSettingGroup.copyWith.settings(
|
||||
_statelessSettingGroup.settings.map(
|
||||
(prefs) => _statelessSettingGroup!.copyWith.settings(
|
||||
_statelessSettingGroup!.settings.map(
|
||||
(key, value) => MapEntry(key, value.copyWith.actualValue(prefs[key])),
|
||||
),
|
||||
),
|
||||
|
||||
+350
-33
@@ -6,28 +6,27 @@ part of 'preference_settings.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$preferenceSettingGroupsHash() =>
|
||||
r'fa9286248cc71c88c888a518441721dc99b7e0c2';
|
||||
String _$preferenceSettingContentHash() =>
|
||||
r'a8a61fdf8800cb7adb365c100409ddce09c574b1';
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
@ProviderFor(_preferenceSettingGroups)
|
||||
final _preferenceSettingGroupsProvider =
|
||||
FutureProvider<Map<String, PreferenceSettingGroup>>.internal(
|
||||
_preferenceSettingGroups,
|
||||
name: r'_preferenceSettingGroupsProvider',
|
||||
/// See also [_preferenceSettingContent].
|
||||
@ProviderFor(_preferenceSettingContent)
|
||||
final _preferenceSettingContentProvider =
|
||||
FutureProvider<Map<String, dynamic>>.internal(
|
||||
_preferenceSettingContent,
|
||||
name: r'_preferenceSettingContentProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupsHash,
|
||||
: _$preferenceSettingContentHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef _PreferenceSettingGroupsRef
|
||||
= FutureProviderRef<Map<String, PreferenceSettingGroup>>;
|
||||
String _$preferenceSettingGroupHash() =>
|
||||
r'960169ab9f6985a5b73a63663e671a8eac7cd776';
|
||||
typedef _PreferenceSettingContentRef = FutureProviderRef<Map<String, dynamic>>;
|
||||
String _$preferenceSettingGroupsHash() =>
|
||||
r'd267dacf82a11568c9cf0cc864f434db35f93394';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
@@ -50,6 +49,145 @@ class _SystemHash {
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
@ProviderFor(_preferenceSettingGroups)
|
||||
const _preferenceSettingGroupsProvider = _PreferenceSettingGroupsFamily();
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
class _PreferenceSettingGroupsFamily
|
||||
extends Family<AsyncValue<Map<String, PreferenceSettingGroup>>> {
|
||||
/// See also [_preferenceSettingGroups].
|
||||
const _PreferenceSettingGroupsFamily();
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
_PreferenceSettingGroupsProvider call(
|
||||
PreferencePartition partition,
|
||||
) {
|
||||
return _PreferenceSettingGroupsProvider(
|
||||
partition,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
_PreferenceSettingGroupsProvider getProviderOverride(
|
||||
covariant _PreferenceSettingGroupsProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'_preferenceSettingGroupsProvider';
|
||||
}
|
||||
|
||||
/// See also [_preferenceSettingGroups].
|
||||
class _PreferenceSettingGroupsProvider
|
||||
extends FutureProvider<Map<String, PreferenceSettingGroup>> {
|
||||
/// See also [_preferenceSettingGroups].
|
||||
_PreferenceSettingGroupsProvider(
|
||||
PreferencePartition partition,
|
||||
) : this._internal(
|
||||
(ref) => _preferenceSettingGroups(
|
||||
ref as _PreferenceSettingGroupsRef,
|
||||
partition,
|
||||
),
|
||||
from: _preferenceSettingGroupsProvider,
|
||||
name: r'_preferenceSettingGroupsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingGroupsHash,
|
||||
dependencies: _PreferenceSettingGroupsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
_PreferenceSettingGroupsFamily._allTransitiveDependencies,
|
||||
partition: partition,
|
||||
);
|
||||
|
||||
_PreferenceSettingGroupsProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.partition,
|
||||
}) : super.internal();
|
||||
|
||||
final PreferencePartition partition;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<Map<String, PreferenceSettingGroup>> Function(
|
||||
_PreferenceSettingGroupsRef provider)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: _PreferenceSettingGroupsProvider._internal(
|
||||
(ref) => create(ref as _PreferenceSettingGroupsRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
partition: partition,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
FutureProviderElement<Map<String, PreferenceSettingGroup>> createElement() {
|
||||
return _PreferenceSettingGroupsProviderElement(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is _PreferenceSettingGroupsProvider &&
|
||||
other.partition == partition;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, partition.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin _PreferenceSettingGroupsRef
|
||||
on FutureProviderRef<Map<String, PreferenceSettingGroup>> {
|
||||
/// The parameter `partition` of this provider.
|
||||
PreferencePartition get partition;
|
||||
}
|
||||
|
||||
class _PreferenceSettingGroupsProviderElement
|
||||
extends FutureProviderElement<Map<String, PreferenceSettingGroup>>
|
||||
with _PreferenceSettingGroupsRef {
|
||||
_PreferenceSettingGroupsProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
PreferencePartition get partition =>
|
||||
(origin as _PreferenceSettingGroupsProvider).partition;
|
||||
}
|
||||
|
||||
String _$preferenceSettingGroupHash() =>
|
||||
r'64d80a37928d7e5aea7d3d567dde8ade7292cd5f';
|
||||
|
||||
/// See also [_preferenceSettingGroup].
|
||||
@ProviderFor(_preferenceSettingGroup)
|
||||
const _preferenceSettingGroupProvider = _PreferenceSettingGroupFamily();
|
||||
@@ -62,9 +200,11 @@ class _PreferenceSettingGroupFamily
|
||||
|
||||
/// See also [_preferenceSettingGroup].
|
||||
_PreferenceSettingGroupProvider call(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) {
|
||||
return _PreferenceSettingGroupProvider(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
}
|
||||
@@ -74,6 +214,7 @@ class _PreferenceSettingGroupFamily
|
||||
covariant _PreferenceSettingGroupProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
provider.groupName,
|
||||
);
|
||||
}
|
||||
@@ -98,10 +239,12 @@ class _PreferenceSettingGroupProvider
|
||||
extends FutureProvider<PreferenceSettingGroup> {
|
||||
/// See also [_preferenceSettingGroup].
|
||||
_PreferenceSettingGroupProvider(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) : this._internal(
|
||||
(ref) => _preferenceSettingGroup(
|
||||
ref as _PreferenceSettingGroupRef,
|
||||
partition,
|
||||
groupName,
|
||||
),
|
||||
from: _preferenceSettingGroupProvider,
|
||||
@@ -113,6 +256,7 @@ class _PreferenceSettingGroupProvider
|
||||
dependencies: _PreferenceSettingGroupFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
_PreferenceSettingGroupFamily._allTransitiveDependencies,
|
||||
partition: partition,
|
||||
groupName: groupName,
|
||||
);
|
||||
|
||||
@@ -123,9 +267,11 @@ class _PreferenceSettingGroupProvider
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.partition,
|
||||
required this.groupName,
|
||||
}) : super.internal();
|
||||
|
||||
final PreferencePartition partition;
|
||||
final String groupName;
|
||||
|
||||
@override
|
||||
@@ -143,6 +289,7 @@ class _PreferenceSettingGroupProvider
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
partition: partition,
|
||||
groupName: groupName,
|
||||
),
|
||||
);
|
||||
@@ -156,12 +303,14 @@ class _PreferenceSettingGroupProvider
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is _PreferenceSettingGroupProvider &&
|
||||
other.partition == partition &&
|
||||
other.groupName == groupName;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, partition.hashCode);
|
||||
hash = _SystemHash.combine(hash, groupName.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
@@ -171,6 +320,9 @@ class _PreferenceSettingGroupProvider
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin _PreferenceSettingGroupRef on FutureProviderRef<PreferenceSettingGroup> {
|
||||
/// The parameter `partition` of this provider.
|
||||
PreferencePartition get partition;
|
||||
|
||||
/// The parameter `groupName` of this provider.
|
||||
String get groupName;
|
||||
}
|
||||
@@ -180,6 +332,9 @@ class _PreferenceSettingGroupProviderElement
|
||||
with _PreferenceSettingGroupRef {
|
||||
_PreferenceSettingGroupProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
PreferencePartition get partition =>
|
||||
(origin as _PreferenceSettingGroupProvider).partition;
|
||||
@override
|
||||
String get groupName => (origin as _PreferenceSettingGroupProvider).groupName;
|
||||
}
|
||||
@@ -202,33 +357,174 @@ final _preferenceRepositoryProvider = AutoDisposeNotifierProvider<
|
||||
|
||||
typedef _$PreferenceRepository
|
||||
= AutoDisposeNotifier<Raw<Stream<Map<String, Object>>>>;
|
||||
String _$preferenceSettingsGeneralRepositoryHash() =>
|
||||
r'24a70de8284107bb43778e1014abe41bd805987a';
|
||||
String _$unifiedPreferenceSettingsRepositoryHash() =>
|
||||
r'35aa16ffa7aa1453c8331ed7470ef85a68d27178';
|
||||
|
||||
/// See also [PreferenceSettingsGeneralRepository].
|
||||
@ProviderFor(PreferenceSettingsGeneralRepository)
|
||||
final preferenceSettingsGeneralRepositoryProvider =
|
||||
AutoDisposeStreamNotifierProvider<PreferenceSettingsGeneralRepository,
|
||||
Map<String, PreferenceSettingGroup>>.internal(
|
||||
PreferenceSettingsGeneralRepository.new,
|
||||
name: r'preferenceSettingsGeneralRepositoryProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$preferenceSettingsGeneralRepositoryHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
abstract class _$UnifiedPreferenceSettingsRepository
|
||||
extends BuildlessAutoDisposeStreamNotifier<
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
late final PreferencePartition partition;
|
||||
|
||||
Stream<Map<String, PreferenceSettingGroup>> build(
|
||||
PreferencePartition partition,
|
||||
);
|
||||
}
|
||||
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
@ProviderFor(UnifiedPreferenceSettingsRepository)
|
||||
const unifiedPreferenceSettingsRepositoryProvider =
|
||||
UnifiedPreferenceSettingsRepositoryFamily();
|
||||
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
class UnifiedPreferenceSettingsRepositoryFamily
|
||||
extends Family<AsyncValue<Map<String, PreferenceSettingGroup>>> {
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
const UnifiedPreferenceSettingsRepositoryFamily();
|
||||
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
UnifiedPreferenceSettingsRepositoryProvider call(
|
||||
PreferencePartition partition,
|
||||
) {
|
||||
return UnifiedPreferenceSettingsRepositoryProvider(
|
||||
partition,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
UnifiedPreferenceSettingsRepositoryProvider getProviderOverride(
|
||||
covariant UnifiedPreferenceSettingsRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'unifiedPreferenceSettingsRepositoryProvider';
|
||||
}
|
||||
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
class UnifiedPreferenceSettingsRepositoryProvider
|
||||
extends AutoDisposeStreamNotifierProviderImpl<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
/// See also [UnifiedPreferenceSettingsRepository].
|
||||
UnifiedPreferenceSettingsRepositoryProvider(
|
||||
PreferencePartition partition,
|
||||
) : this._internal(
|
||||
() => UnifiedPreferenceSettingsRepository()..partition = partition,
|
||||
from: unifiedPreferenceSettingsRepositoryProvider,
|
||||
name: r'unifiedPreferenceSettingsRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$unifiedPreferenceSettingsRepositoryHash,
|
||||
dependencies: UnifiedPreferenceSettingsRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies: UnifiedPreferenceSettingsRepositoryFamily
|
||||
._allTransitiveDependencies,
|
||||
partition: partition,
|
||||
);
|
||||
|
||||
UnifiedPreferenceSettingsRepositoryProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.partition,
|
||||
}) : super.internal();
|
||||
|
||||
final PreferencePartition partition;
|
||||
|
||||
@override
|
||||
Stream<Map<String, PreferenceSettingGroup>> runNotifierBuild(
|
||||
covariant UnifiedPreferenceSettingsRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
partition,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Override overrideWith(UnifiedPreferenceSettingsRepository Function() create) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: UnifiedPreferenceSettingsRepositoryProvider._internal(
|
||||
() => create()..partition = partition,
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
partition: partition,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeStreamNotifierProviderElement<UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>> createElement() {
|
||||
return _UnifiedPreferenceSettingsRepositoryProviderElement(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is UnifiedPreferenceSettingsRepositoryProvider &&
|
||||
other.partition == partition;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, partition.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin UnifiedPreferenceSettingsRepositoryRef
|
||||
on AutoDisposeStreamNotifierProviderRef<
|
||||
Map<String, PreferenceSettingGroup>> {
|
||||
/// The parameter `partition` of this provider.
|
||||
PreferencePartition get partition;
|
||||
}
|
||||
|
||||
class _UnifiedPreferenceSettingsRepositoryProviderElement
|
||||
extends AutoDisposeStreamNotifierProviderElement<
|
||||
UnifiedPreferenceSettingsRepository,
|
||||
Map<String, PreferenceSettingGroup>>
|
||||
with UnifiedPreferenceSettingsRepositoryRef {
|
||||
_UnifiedPreferenceSettingsRepositoryProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
PreferencePartition get partition =>
|
||||
(origin as UnifiedPreferenceSettingsRepositoryProvider).partition;
|
||||
}
|
||||
|
||||
typedef _$PreferenceSettingsGeneralRepository
|
||||
= AutoDisposeStreamNotifier<Map<String, PreferenceSettingGroup>>;
|
||||
String _$preferenceSettingsGroupRepositoryHash() =>
|
||||
r'023794294c5639ac6c6941f87a4ed91e1551fbc9';
|
||||
r'60f416ffe1cde4d535fb5b643a80aead20836bae';
|
||||
|
||||
abstract class _$PreferenceSettingsGroupRepository
|
||||
extends BuildlessAutoDisposeStreamNotifier<PreferenceSettingGroup> {
|
||||
late final PreferencePartition partition;
|
||||
late final String groupName;
|
||||
|
||||
Stream<PreferenceSettingGroup> build(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
);
|
||||
}
|
||||
@@ -246,9 +542,11 @@ class PreferenceSettingsGroupRepositoryFamily
|
||||
|
||||
/// See also [PreferenceSettingsGroupRepository].
|
||||
PreferenceSettingsGroupRepositoryProvider call(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) {
|
||||
return PreferenceSettingsGroupRepositoryProvider(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
}
|
||||
@@ -258,6 +556,7 @@ class PreferenceSettingsGroupRepositoryFamily
|
||||
covariant PreferenceSettingsGroupRepositoryProvider provider,
|
||||
) {
|
||||
return call(
|
||||
provider.partition,
|
||||
provider.groupName,
|
||||
);
|
||||
}
|
||||
@@ -283,9 +582,12 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
PreferenceSettingsGroupRepository, PreferenceSettingGroup> {
|
||||
/// See also [PreferenceSettingsGroupRepository].
|
||||
PreferenceSettingsGroupRepositoryProvider(
|
||||
PreferencePartition partition,
|
||||
String groupName,
|
||||
) : this._internal(
|
||||
() => PreferenceSettingsGroupRepository()..groupName = groupName,
|
||||
() => PreferenceSettingsGroupRepository()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
from: preferenceSettingsGroupRepositoryProvider,
|
||||
name: r'preferenceSettingsGroupRepositoryProvider',
|
||||
debugGetCreateSourceHash:
|
||||
@@ -295,6 +597,7 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
dependencies: PreferenceSettingsGroupRepositoryFamily._dependencies,
|
||||
allTransitiveDependencies: PreferenceSettingsGroupRepositoryFamily
|
||||
._allTransitiveDependencies,
|
||||
partition: partition,
|
||||
groupName: groupName,
|
||||
);
|
||||
|
||||
@@ -305,9 +608,11 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.partition,
|
||||
required this.groupName,
|
||||
}) : super.internal();
|
||||
|
||||
final PreferencePartition partition;
|
||||
final String groupName;
|
||||
|
||||
@override
|
||||
@@ -315,6 +620,7 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
covariant PreferenceSettingsGroupRepository notifier,
|
||||
) {
|
||||
return notifier.build(
|
||||
partition,
|
||||
groupName,
|
||||
);
|
||||
}
|
||||
@@ -324,12 +630,15 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: PreferenceSettingsGroupRepositoryProvider._internal(
|
||||
() => create()..groupName = groupName,
|
||||
() => create()
|
||||
..partition = partition
|
||||
..groupName = groupName,
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
partition: partition,
|
||||
groupName: groupName,
|
||||
),
|
||||
);
|
||||
@@ -344,12 +653,14 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is PreferenceSettingsGroupRepositoryProvider &&
|
||||
other.partition == partition &&
|
||||
other.groupName == groupName;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, partition.hashCode);
|
||||
hash = _SystemHash.combine(hash, groupName.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
@@ -360,6 +671,9 @@ class PreferenceSettingsGroupRepositoryProvider
|
||||
// ignore: unused_element
|
||||
mixin PreferenceSettingsGroupRepositoryRef
|
||||
on AutoDisposeStreamNotifierProviderRef<PreferenceSettingGroup> {
|
||||
/// The parameter `partition` of this provider.
|
||||
PreferencePartition get partition;
|
||||
|
||||
/// The parameter `groupName` of this provider.
|
||||
String get groupName;
|
||||
}
|
||||
@@ -370,6 +684,9 @@ class _PreferenceSettingsGroupRepositoryProviderElement
|
||||
PreferenceSettingGroup> with PreferenceSettingsGroupRepositoryRef {
|
||||
_PreferenceSettingsGroupRepositoryProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
PreferencePartition get partition =>
|
||||
(origin as PreferenceSettingsGroupRepositoryProvider).partition;
|
||||
@override
|
||||
String get groupName =>
|
||||
(origin as PreferenceSettingsGroupRepositoryProvider).groupName;
|
||||
|
||||
Reference in New Issue
Block a user