♻️ Migrated to riverpod v3
This commit is contained in:
@@ -6,25 +6,46 @@ part of 'account_devices.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$authDevicesHash() => r'1af378149286020ec263be178c573ccc247a0cd1';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// See also [authDevices].
|
||||
@ProviderFor(authDevices)
|
||||
final authDevicesProvider =
|
||||
AutoDisposeFutureProvider<List<SnAuthDeviceWithSession>>.internal(
|
||||
authDevices,
|
||||
name: r'authDevicesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$authDevicesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
const authDevicesProvider = AuthDevicesProvider._();
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef AuthDevicesRef =
|
||||
AutoDisposeFutureProviderRef<List<SnAuthDeviceWithSession>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class AuthDevicesProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnAuthDeviceWithSession>>,
|
||||
List<SnAuthDeviceWithSession>,
|
||||
FutureOr<List<SnAuthDeviceWithSession>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnAuthDeviceWithSession>>,
|
||||
$FutureProvider<List<SnAuthDeviceWithSession>> {
|
||||
const AuthDevicesProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'authDevicesProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$authDevicesHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnAuthDeviceWithSession>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnAuthDeviceWithSession>> create(Ref ref) {
|
||||
return authDevices(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$authDevicesHash() => r'1af378149286020ec263be178c573ccc247a0cd1';
|
||||
|
||||
@@ -6,148 +6,80 @@ part of 'account_picker.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$searchAccountsHash() => r'3b4aa4d7970a1e406c1a0a1dfac2c686e05bc533';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [searchAccounts].
|
||||
@ProviderFor(searchAccounts)
|
||||
const searchAccountsProvider = SearchAccountsFamily();
|
||||
const searchAccountsProvider = SearchAccountsFamily._();
|
||||
|
||||
/// See also [searchAccounts].
|
||||
class SearchAccountsFamily extends Family<AsyncValue<List<SnAccount>>> {
|
||||
/// See also [searchAccounts].
|
||||
const SearchAccountsFamily();
|
||||
final class SearchAccountsProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnAccount>>,
|
||||
List<SnAccount>,
|
||||
FutureOr<List<SnAccount>>
|
||||
>
|
||||
with $FutureModifier<List<SnAccount>>, $FutureProvider<List<SnAccount>> {
|
||||
const SearchAccountsProvider._({
|
||||
required SearchAccountsFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'searchAccountsProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [searchAccounts].
|
||||
SearchAccountsProvider call({required String query}) {
|
||||
return SearchAccountsProvider(query: query);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$searchAccountsHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'searchAccountsProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
SearchAccountsProvider getProviderOverride(
|
||||
covariant SearchAccountsProvider provider,
|
||||
) {
|
||||
return call(query: provider.query);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<List<SnAccount>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'searchAccountsProvider';
|
||||
}
|
||||
|
||||
/// See also [searchAccounts].
|
||||
class SearchAccountsProvider
|
||||
extends AutoDisposeFutureProvider<List<SnAccount>> {
|
||||
/// See also [searchAccounts].
|
||||
SearchAccountsProvider({required String query})
|
||||
: this._internal(
|
||||
(ref) => searchAccounts(ref as SearchAccountsRef, query: query),
|
||||
from: searchAccountsProvider,
|
||||
name: r'searchAccountsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$searchAccountsHash,
|
||||
dependencies: SearchAccountsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
SearchAccountsFamily._allTransitiveDependencies,
|
||||
query: query,
|
||||
);
|
||||
|
||||
SearchAccountsProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.query,
|
||||
}) : super.internal();
|
||||
|
||||
final String query;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<List<SnAccount>> Function(SearchAccountsRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: SearchAccountsProvider._internal(
|
||||
(ref) => create(ref as SearchAccountsRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
query: query,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<List<SnAccount>> createElement() {
|
||||
return _SearchAccountsProviderElement(this);
|
||||
FutureOr<List<SnAccount>> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return searchAccounts(ref, query: argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is SearchAccountsProvider && other.query == query;
|
||||
return other is SearchAccountsProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, query.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin SearchAccountsRef on AutoDisposeFutureProviderRef<List<SnAccount>> {
|
||||
/// The parameter `query` of this provider.
|
||||
String get query;
|
||||
}
|
||||
String _$searchAccountsHash() => r'3b4aa4d7970a1e406c1a0a1dfac2c686e05bc533';
|
||||
|
||||
class _SearchAccountsProviderElement
|
||||
extends AutoDisposeFutureProviderElement<List<SnAccount>>
|
||||
with SearchAccountsRef {
|
||||
_SearchAccountsProviderElement(super.provider);
|
||||
final class SearchAccountsFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<List<SnAccount>>, String> {
|
||||
const SearchAccountsFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'searchAccountsProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
SearchAccountsProvider call({required String query}) =>
|
||||
SearchAccountsProvider._(argument: query, from: this);
|
||||
|
||||
@override
|
||||
String get query => (origin as SearchAccountsProvider).query;
|
||||
String toString() => r'searchAccountsProvider';
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -6,282 +6,159 @@ part of 'activity_presence.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$discordAssetsHash() => r'3ef8465188059de96cf2ac9660ed3d88910443bf';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [discordAssets].
|
||||
@ProviderFor(discordAssets)
|
||||
const discordAssetsProvider = DiscordAssetsFamily();
|
||||
const discordAssetsProvider = DiscordAssetsFamily._();
|
||||
|
||||
/// See also [discordAssets].
|
||||
class DiscordAssetsFamily extends Family<AsyncValue<Map<String, String>?>> {
|
||||
/// See also [discordAssets].
|
||||
const DiscordAssetsFamily();
|
||||
final class DiscordAssetsProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<Map<String, String>?>,
|
||||
Map<String, String>?,
|
||||
FutureOr<Map<String, String>?>
|
||||
>
|
||||
with
|
||||
$FutureModifier<Map<String, String>?>,
|
||||
$FutureProvider<Map<String, String>?> {
|
||||
const DiscordAssetsProvider._({
|
||||
required DiscordAssetsFamily super.from,
|
||||
required SnPresenceActivity super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'discordAssetsProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [discordAssets].
|
||||
DiscordAssetsProvider call(SnPresenceActivity activity) {
|
||||
return DiscordAssetsProvider(activity);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$discordAssetsHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'discordAssetsProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
DiscordAssetsProvider getProviderOverride(
|
||||
covariant DiscordAssetsProvider provider,
|
||||
) {
|
||||
return call(provider.activity);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<Map<String, String>?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'discordAssetsProvider';
|
||||
}
|
||||
|
||||
/// See also [discordAssets].
|
||||
class DiscordAssetsProvider
|
||||
extends AutoDisposeFutureProvider<Map<String, String>?> {
|
||||
/// See also [discordAssets].
|
||||
DiscordAssetsProvider(SnPresenceActivity activity)
|
||||
: this._internal(
|
||||
(ref) => discordAssets(ref as DiscordAssetsRef, activity),
|
||||
from: discordAssetsProvider,
|
||||
name: r'discordAssetsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$discordAssetsHash,
|
||||
dependencies: DiscordAssetsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
DiscordAssetsFamily._allTransitiveDependencies,
|
||||
activity: activity,
|
||||
);
|
||||
|
||||
DiscordAssetsProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.activity,
|
||||
}) : super.internal();
|
||||
|
||||
final SnPresenceActivity activity;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<Map<String, String>?> Function(DiscordAssetsRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: DiscordAssetsProvider._internal(
|
||||
(ref) => create(ref as DiscordAssetsRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
activity: activity,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<Map<String, String>?> createElement() {
|
||||
return _DiscordAssetsProviderElement(this);
|
||||
FutureOr<Map<String, String>?> create(Ref ref) {
|
||||
final argument = this.argument as SnPresenceActivity;
|
||||
return discordAssets(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is DiscordAssetsProvider && other.activity == activity;
|
||||
return other is DiscordAssetsProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, activity.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin DiscordAssetsRef on AutoDisposeFutureProviderRef<Map<String, String>?> {
|
||||
/// The parameter `activity` of this provider.
|
||||
SnPresenceActivity get activity;
|
||||
}
|
||||
String _$discordAssetsHash() => r'3ef8465188059de96cf2ac9660ed3d88910443bf';
|
||||
|
||||
class _DiscordAssetsProviderElement
|
||||
extends AutoDisposeFutureProviderElement<Map<String, String>?>
|
||||
with DiscordAssetsRef {
|
||||
_DiscordAssetsProviderElement(super.provider);
|
||||
final class DiscordAssetsFamily extends $Family
|
||||
with
|
||||
$FunctionalFamilyOverride<
|
||||
FutureOr<Map<String, String>?>,
|
||||
SnPresenceActivity
|
||||
> {
|
||||
const DiscordAssetsFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'discordAssetsProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
DiscordAssetsProvider call(SnPresenceActivity activity) =>
|
||||
DiscordAssetsProvider._(argument: activity, from: this);
|
||||
|
||||
@override
|
||||
SnPresenceActivity get activity => (origin as DiscordAssetsProvider).activity;
|
||||
String toString() => r'discordAssetsProvider';
|
||||
}
|
||||
|
||||
@ProviderFor(discordAssetsUrl)
|
||||
const discordAssetsUrlProvider = DiscordAssetsUrlFamily._();
|
||||
|
||||
final class DiscordAssetsUrlProvider
|
||||
extends $FunctionalProvider<AsyncValue<String?>, String?, FutureOr<String?>>
|
||||
with $FutureModifier<String?>, $FutureProvider<String?> {
|
||||
const DiscordAssetsUrlProvider._({
|
||||
required DiscordAssetsUrlFamily super.from,
|
||||
required (SnPresenceActivity, String) super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'discordAssetsUrlProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$discordAssetsUrlHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'discordAssetsUrlProvider'
|
||||
''
|
||||
'$argument';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<String?> $createElement($ProviderPointer pointer) =>
|
||||
$FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<String?> create(Ref ref) {
|
||||
final argument = this.argument as (SnPresenceActivity, String);
|
||||
return discordAssetsUrl(ref, argument.$1, argument.$2);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is DiscordAssetsUrlProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
String _$discordAssetsUrlHash() => r'a32f9333c3fb4d50ff88a54a6b8b72fbf5ba3ea1';
|
||||
|
||||
/// See also [discordAssetsUrl].
|
||||
@ProviderFor(discordAssetsUrl)
|
||||
const discordAssetsUrlProvider = DiscordAssetsUrlFamily();
|
||||
|
||||
/// See also [discordAssetsUrl].
|
||||
class DiscordAssetsUrlFamily extends Family<AsyncValue<String?>> {
|
||||
/// See also [discordAssetsUrl].
|
||||
const DiscordAssetsUrlFamily();
|
||||
|
||||
/// See also [discordAssetsUrl].
|
||||
DiscordAssetsUrlProvider call(SnPresenceActivity activity, String key) {
|
||||
return DiscordAssetsUrlProvider(activity, key);
|
||||
}
|
||||
|
||||
@override
|
||||
DiscordAssetsUrlProvider getProviderOverride(
|
||||
covariant DiscordAssetsUrlProvider provider,
|
||||
) {
|
||||
return call(provider.activity, provider.key);
|
||||
}
|
||||
|
||||
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'discordAssetsUrlProvider';
|
||||
}
|
||||
|
||||
/// See also [discordAssetsUrl].
|
||||
class DiscordAssetsUrlProvider extends AutoDisposeFutureProvider<String?> {
|
||||
/// See also [discordAssetsUrl].
|
||||
DiscordAssetsUrlProvider(SnPresenceActivity activity, String key)
|
||||
: this._internal(
|
||||
(ref) => discordAssetsUrl(ref as DiscordAssetsUrlRef, activity, key),
|
||||
from: discordAssetsUrlProvider,
|
||||
final class DiscordAssetsUrlFamily extends $Family
|
||||
with
|
||||
$FunctionalFamilyOverride<
|
||||
FutureOr<String?>,
|
||||
(SnPresenceActivity, String)
|
||||
> {
|
||||
const DiscordAssetsUrlFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'discordAssetsUrlProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$discordAssetsUrlHash,
|
||||
dependencies: DiscordAssetsUrlFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
DiscordAssetsUrlFamily._allTransitiveDependencies,
|
||||
activity: activity,
|
||||
key: key,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
DiscordAssetsUrlProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.activity,
|
||||
required this.key,
|
||||
}) : super.internal();
|
||||
|
||||
final SnPresenceActivity activity;
|
||||
final String key;
|
||||
DiscordAssetsUrlProvider call(SnPresenceActivity activity, String key) =>
|
||||
DiscordAssetsUrlProvider._(argument: (activity, key), from: this);
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<String?> Function(DiscordAssetsUrlRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: DiscordAssetsUrlProvider._internal(
|
||||
(ref) => create(ref as DiscordAssetsUrlRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
activity: activity,
|
||||
key: key,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<String?> createElement() {
|
||||
return _DiscordAssetsUrlProviderElement(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is DiscordAssetsUrlProvider &&
|
||||
other.activity == activity &&
|
||||
other.key == key;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, activity.hashCode);
|
||||
hash = _SystemHash.combine(hash, key.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
}
|
||||
String toString() => r'discordAssetsUrlProvider';
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin DiscordAssetsUrlRef on AutoDisposeFutureProviderRef<String?> {
|
||||
/// The parameter `activity` of this provider.
|
||||
SnPresenceActivity get activity;
|
||||
|
||||
/// The parameter `key` of this provider.
|
||||
String get key;
|
||||
}
|
||||
|
||||
class _DiscordAssetsUrlProviderElement
|
||||
extends AutoDisposeFutureProviderElement<String?>
|
||||
with DiscordAssetsUrlRef {
|
||||
_DiscordAssetsUrlProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
SnPresenceActivity get activity =>
|
||||
(origin as DiscordAssetsUrlProvider).activity;
|
||||
@override
|
||||
String get key => (origin as DiscordAssetsUrlProvider).key;
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -6,25 +6,46 @@ part of 'friends_overview.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$friendsOverviewHash() => r'5ef86c6849804c97abd3df094f120c7dd5e938db';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// See also [friendsOverview].
|
||||
@ProviderFor(friendsOverview)
|
||||
final friendsOverviewProvider =
|
||||
AutoDisposeFutureProvider<List<SnFriendOverviewItem>>.internal(
|
||||
friendsOverview,
|
||||
name: r'friendsOverviewProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$friendsOverviewHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
const friendsOverviewProvider = FriendsOverviewProvider._();
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef FriendsOverviewRef =
|
||||
AutoDisposeFutureProviderRef<List<SnFriendOverviewItem>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class FriendsOverviewProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnFriendOverviewItem>>,
|
||||
List<SnFriendOverviewItem>,
|
||||
FutureOr<List<SnFriendOverviewItem>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnFriendOverviewItem>>,
|
||||
$FutureProvider<List<SnFriendOverviewItem>> {
|
||||
const FriendsOverviewProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'friendsOverviewProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$friendsOverviewHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnFriendOverviewItem>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnFriendOverviewItem>> create(Ref ref) {
|
||||
return friendsOverview(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$friendsOverviewHash() => r'5ef86c6849804c97abd3df094f120c7dd5e938db';
|
||||
|
||||
@@ -15,8 +15,16 @@ import 'package:styled_widget/styled_widget.dart';
|
||||
|
||||
part 'status.g.dart';
|
||||
|
||||
class CurrentAccountStatusNotifier extends StateNotifier<SnAccountStatus?> {
|
||||
CurrentAccountStatusNotifier() : super(null);
|
||||
final currentAccountStatusProvider =
|
||||
NotifierProvider<CurrentAccountStatusNotifier, SnAccountStatus?>(
|
||||
CurrentAccountStatusNotifier.new,
|
||||
);
|
||||
|
||||
class CurrentAccountStatusNotifier extends Notifier<SnAccountStatus?> {
|
||||
@override
|
||||
SnAccountStatus? build() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void setStatus(SnAccountStatus status) {
|
||||
state = status;
|
||||
@@ -27,13 +35,6 @@ class CurrentAccountStatusNotifier extends StateNotifier<SnAccountStatus?> {
|
||||
}
|
||||
}
|
||||
|
||||
final currentAccountStatusProvider =
|
||||
StateNotifierProvider<CurrentAccountStatusNotifier, SnAccountStatus?>((
|
||||
ref,
|
||||
) {
|
||||
return CurrentAccountStatusNotifier();
|
||||
});
|
||||
|
||||
@riverpod
|
||||
Future<SnAccountStatus?> accountStatus(Ref ref, String uname) async {
|
||||
final userInfo = ref.watch(userInfoProvider);
|
||||
|
||||
@@ -6,148 +6,80 @@ part of 'status.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$accountStatusHash() => r'4cac809808e6f1345dab06dc32d759cfcea13315';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [accountStatus].
|
||||
@ProviderFor(accountStatus)
|
||||
const accountStatusProvider = AccountStatusFamily();
|
||||
const accountStatusProvider = AccountStatusFamily._();
|
||||
|
||||
/// See also [accountStatus].
|
||||
class AccountStatusFamily extends Family<AsyncValue<SnAccountStatus?>> {
|
||||
/// See also [accountStatus].
|
||||
const AccountStatusFamily();
|
||||
final class AccountStatusProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnAccountStatus?>,
|
||||
SnAccountStatus?,
|
||||
FutureOr<SnAccountStatus?>
|
||||
>
|
||||
with $FutureModifier<SnAccountStatus?>, $FutureProvider<SnAccountStatus?> {
|
||||
const AccountStatusProvider._({
|
||||
required AccountStatusFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'accountStatusProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [accountStatus].
|
||||
AccountStatusProvider call(String uname) {
|
||||
return AccountStatusProvider(uname);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$accountStatusHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'accountStatusProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
AccountStatusProvider getProviderOverride(
|
||||
covariant AccountStatusProvider provider,
|
||||
) {
|
||||
return call(provider.uname);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<SnAccountStatus?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'accountStatusProvider';
|
||||
}
|
||||
|
||||
/// See also [accountStatus].
|
||||
class AccountStatusProvider
|
||||
extends AutoDisposeFutureProvider<SnAccountStatus?> {
|
||||
/// See also [accountStatus].
|
||||
AccountStatusProvider(String uname)
|
||||
: this._internal(
|
||||
(ref) => accountStatus(ref as AccountStatusRef, uname),
|
||||
from: accountStatusProvider,
|
||||
name: r'accountStatusProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$accountStatusHash,
|
||||
dependencies: AccountStatusFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
AccountStatusFamily._allTransitiveDependencies,
|
||||
uname: uname,
|
||||
);
|
||||
|
||||
AccountStatusProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.uname,
|
||||
}) : super.internal();
|
||||
|
||||
final String uname;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<SnAccountStatus?> Function(AccountStatusRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: AccountStatusProvider._internal(
|
||||
(ref) => create(ref as AccountStatusRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
uname: uname,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<SnAccountStatus?> createElement() {
|
||||
return _AccountStatusProviderElement(this);
|
||||
FutureOr<SnAccountStatus?> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return accountStatus(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is AccountStatusProvider && other.uname == uname;
|
||||
return other is AccountStatusProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, uname.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin AccountStatusRef on AutoDisposeFutureProviderRef<SnAccountStatus?> {
|
||||
/// The parameter `uname` of this provider.
|
||||
String get uname;
|
||||
}
|
||||
String _$accountStatusHash() => r'4cac809808e6f1345dab06dc32d759cfcea13315';
|
||||
|
||||
class _AccountStatusProviderElement
|
||||
extends AutoDisposeFutureProviderElement<SnAccountStatus?>
|
||||
with AccountStatusRef {
|
||||
_AccountStatusProviderElement(super.provider);
|
||||
final class AccountStatusFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<SnAccountStatus?>, String> {
|
||||
const AccountStatusFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'accountStatusProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
AccountStatusProvider call(String uname) =>
|
||||
AccountStatusProvider._(argument: uname, from: this);
|
||||
|
||||
@override
|
||||
String get uname => (origin as AccountStatusProvider).uname;
|
||||
String toString() => r'accountStatusProvider';
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -6,447 +6,296 @@ part of 'stellar_program_tab.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
@ProviderFor(accountStellarSubscription)
|
||||
const accountStellarSubscriptionProvider =
|
||||
AccountStellarSubscriptionProvider._();
|
||||
|
||||
final class AccountStellarSubscriptionProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnWalletSubscription?>,
|
||||
SnWalletSubscription?,
|
||||
FutureOr<SnWalletSubscription?>
|
||||
>
|
||||
with
|
||||
$FutureModifier<SnWalletSubscription?>,
|
||||
$FutureProvider<SnWalletSubscription?> {
|
||||
const AccountStellarSubscriptionProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'accountStellarSubscriptionProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$accountStellarSubscriptionHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<SnWalletSubscription?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<SnWalletSubscription?> create(Ref ref) {
|
||||
return accountStellarSubscription(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$accountStellarSubscriptionHash() =>
|
||||
r'7cdfc7ca29aac240fc8704f4493498d87f307400';
|
||||
|
||||
/// See also [accountStellarSubscription].
|
||||
@ProviderFor(accountStellarSubscription)
|
||||
final accountStellarSubscriptionProvider =
|
||||
AutoDisposeFutureProvider<SnWalletSubscription?>.internal(
|
||||
accountStellarSubscription,
|
||||
name: r'accountStellarSubscriptionProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$accountStellarSubscriptionHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef AccountStellarSubscriptionRef =
|
||||
AutoDisposeFutureProviderRef<SnWalletSubscription?>;
|
||||
String _$accountSentGiftsHash() => r'460af8d22e16dc402848cb94e9b8a8a26d023c41';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [accountSentGifts].
|
||||
@ProviderFor(accountSentGifts)
|
||||
const accountSentGiftsProvider = AccountSentGiftsFamily();
|
||||
const accountSentGiftsProvider = AccountSentGiftsFamily._();
|
||||
|
||||
/// See also [accountSentGifts].
|
||||
class AccountSentGiftsFamily extends Family<AsyncValue<List<SnWalletGift>>> {
|
||||
/// See also [accountSentGifts].
|
||||
const AccountSentGiftsFamily();
|
||||
final class AccountSentGiftsProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnWalletGift>>,
|
||||
List<SnWalletGift>,
|
||||
FutureOr<List<SnWalletGift>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnWalletGift>>,
|
||||
$FutureProvider<List<SnWalletGift>> {
|
||||
const AccountSentGiftsProvider._({
|
||||
required AccountSentGiftsFamily super.from,
|
||||
required ({int offset, int take}) super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'accountSentGiftsProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [accountSentGifts].
|
||||
AccountSentGiftsProvider call({int offset = 0, int take = 20}) {
|
||||
return AccountSentGiftsProvider(offset: offset, take: take);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$accountSentGiftsHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'accountSentGiftsProvider'
|
||||
''
|
||||
'$argument';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
AccountSentGiftsProvider getProviderOverride(
|
||||
covariant AccountSentGiftsProvider provider,
|
||||
) {
|
||||
return call(offset: provider.offset, take: provider.take);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<List<SnWalletGift>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'accountSentGiftsProvider';
|
||||
}
|
||||
|
||||
/// See also [accountSentGifts].
|
||||
class AccountSentGiftsProvider
|
||||
extends AutoDisposeFutureProvider<List<SnWalletGift>> {
|
||||
/// See also [accountSentGifts].
|
||||
AccountSentGiftsProvider({int offset = 0, int take = 20})
|
||||
: this._internal(
|
||||
(ref) => accountSentGifts(
|
||||
ref as AccountSentGiftsRef,
|
||||
offset: offset,
|
||||
take: take,
|
||||
),
|
||||
from: accountSentGiftsProvider,
|
||||
name: r'accountSentGiftsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$accountSentGiftsHash,
|
||||
dependencies: AccountSentGiftsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
AccountSentGiftsFamily._allTransitiveDependencies,
|
||||
offset: offset,
|
||||
take: take,
|
||||
);
|
||||
|
||||
AccountSentGiftsProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.offset,
|
||||
required this.take,
|
||||
}) : super.internal();
|
||||
|
||||
final int offset;
|
||||
final int take;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<List<SnWalletGift>> Function(AccountSentGiftsRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: AccountSentGiftsProvider._internal(
|
||||
(ref) => create(ref as AccountSentGiftsRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
offset: offset,
|
||||
take: take,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<List<SnWalletGift>> createElement() {
|
||||
return _AccountSentGiftsProviderElement(this);
|
||||
FutureOr<List<SnWalletGift>> create(Ref ref) {
|
||||
final argument = this.argument as ({int offset, int take});
|
||||
return accountSentGifts(ref, offset: argument.offset, take: argument.take);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is AccountSentGiftsProvider &&
|
||||
other.offset == offset &&
|
||||
other.take == take;
|
||||
return other is AccountSentGiftsProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, offset.hashCode);
|
||||
hash = _SystemHash.combine(hash, take.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin AccountSentGiftsRef on AutoDisposeFutureProviderRef<List<SnWalletGift>> {
|
||||
/// The parameter `offset` of this provider.
|
||||
int get offset;
|
||||
String _$accountSentGiftsHash() => r'460af8d22e16dc402848cb94e9b8a8a26d023c41';
|
||||
|
||||
/// The parameter `take` of this provider.
|
||||
int get take;
|
||||
final class AccountSentGiftsFamily extends $Family
|
||||
with
|
||||
$FunctionalFamilyOverride<
|
||||
FutureOr<List<SnWalletGift>>,
|
||||
({int offset, int take})
|
||||
> {
|
||||
const AccountSentGiftsFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'accountSentGiftsProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
AccountSentGiftsProvider call({int offset = 0, int take = 20}) =>
|
||||
AccountSentGiftsProvider._(
|
||||
argument: (offset: offset, take: take),
|
||||
from: this,
|
||||
);
|
||||
|
||||
@override
|
||||
String toString() => r'accountSentGiftsProvider';
|
||||
}
|
||||
|
||||
class _AccountSentGiftsProviderElement
|
||||
extends AutoDisposeFutureProviderElement<List<SnWalletGift>>
|
||||
with AccountSentGiftsRef {
|
||||
_AccountSentGiftsProviderElement(super.provider);
|
||||
@ProviderFor(accountReceivedGifts)
|
||||
const accountReceivedGiftsProvider = AccountReceivedGiftsFamily._();
|
||||
|
||||
final class AccountReceivedGiftsProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnWalletGift>>,
|
||||
List<SnWalletGift>,
|
||||
FutureOr<List<SnWalletGift>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnWalletGift>>,
|
||||
$FutureProvider<List<SnWalletGift>> {
|
||||
const AccountReceivedGiftsProvider._({
|
||||
required AccountReceivedGiftsFamily super.from,
|
||||
required ({int offset, int take}) super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'accountReceivedGiftsProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
int get offset => (origin as AccountSentGiftsProvider).offset;
|
||||
String debugGetCreateSourceHash() => _$accountReceivedGiftsHash();
|
||||
|
||||
@override
|
||||
int get take => (origin as AccountSentGiftsProvider).take;
|
||||
String toString() {
|
||||
return r'accountReceivedGiftsProvider'
|
||||
''
|
||||
'$argument';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnWalletGift>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnWalletGift>> create(Ref ref) {
|
||||
final argument = this.argument as ({int offset, int take});
|
||||
return accountReceivedGifts(
|
||||
ref,
|
||||
offset: argument.offset,
|
||||
take: argument.take,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is AccountReceivedGiftsProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
String _$accountReceivedGiftsHash() =>
|
||||
r'1208c27cca49e154af073071a197b37a2703f56d';
|
||||
|
||||
/// See also [accountReceivedGifts].
|
||||
@ProviderFor(accountReceivedGifts)
|
||||
const accountReceivedGiftsProvider = AccountReceivedGiftsFamily();
|
||||
|
||||
/// See also [accountReceivedGifts].
|
||||
class AccountReceivedGiftsFamily
|
||||
extends Family<AsyncValue<List<SnWalletGift>>> {
|
||||
/// See also [accountReceivedGifts].
|
||||
const AccountReceivedGiftsFamily();
|
||||
|
||||
/// See also [accountReceivedGifts].
|
||||
AccountReceivedGiftsProvider call({int offset = 0, int take = 20}) {
|
||||
return AccountReceivedGiftsProvider(offset: offset, take: take);
|
||||
}
|
||||
|
||||
@override
|
||||
AccountReceivedGiftsProvider getProviderOverride(
|
||||
covariant AccountReceivedGiftsProvider provider,
|
||||
) {
|
||||
return call(offset: provider.offset, take: provider.take);
|
||||
}
|
||||
|
||||
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'accountReceivedGiftsProvider';
|
||||
}
|
||||
|
||||
/// See also [accountReceivedGifts].
|
||||
class AccountReceivedGiftsProvider
|
||||
extends AutoDisposeFutureProvider<List<SnWalletGift>> {
|
||||
/// See also [accountReceivedGifts].
|
||||
AccountReceivedGiftsProvider({int offset = 0, int take = 20})
|
||||
: this._internal(
|
||||
(ref) => accountReceivedGifts(
|
||||
ref as AccountReceivedGiftsRef,
|
||||
offset: offset,
|
||||
take: take,
|
||||
),
|
||||
from: accountReceivedGiftsProvider,
|
||||
final class AccountReceivedGiftsFamily extends $Family
|
||||
with
|
||||
$FunctionalFamilyOverride<
|
||||
FutureOr<List<SnWalletGift>>,
|
||||
({int offset, int take})
|
||||
> {
|
||||
const AccountReceivedGiftsFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'accountReceivedGiftsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$accountReceivedGiftsHash,
|
||||
dependencies: AccountReceivedGiftsFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
AccountReceivedGiftsFamily._allTransitiveDependencies,
|
||||
offset: offset,
|
||||
take: take,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
AccountReceivedGiftsProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.offset,
|
||||
required this.take,
|
||||
}) : super.internal();
|
||||
|
||||
final int offset;
|
||||
final int take;
|
||||
AccountReceivedGiftsProvider call({int offset = 0, int take = 20}) =>
|
||||
AccountReceivedGiftsProvider._(
|
||||
argument: (offset: offset, take: take),
|
||||
from: this,
|
||||
);
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<List<SnWalletGift>> Function(AccountReceivedGiftsRef provider)
|
||||
create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: AccountReceivedGiftsProvider._internal(
|
||||
(ref) => create(ref as AccountReceivedGiftsRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
offset: offset,
|
||||
take: take,
|
||||
),
|
||||
);
|
||||
String toString() => r'accountReceivedGiftsProvider';
|
||||
}
|
||||
|
||||
@ProviderFor(accountGift)
|
||||
const accountGiftProvider = AccountGiftFamily._();
|
||||
|
||||
final class AccountGiftProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnWalletGift>,
|
||||
SnWalletGift,
|
||||
FutureOr<SnWalletGift>
|
||||
>
|
||||
with $FutureModifier<SnWalletGift>, $FutureProvider<SnWalletGift> {
|
||||
const AccountGiftProvider._({
|
||||
required AccountGiftFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'accountGiftProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$accountGiftHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'accountGiftProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<List<SnWalletGift>> createElement() {
|
||||
return _AccountReceivedGiftsProviderElement(this);
|
||||
$FutureProviderElement<SnWalletGift> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<SnWalletGift> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return accountGift(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is AccountReceivedGiftsProvider &&
|
||||
other.offset == offset &&
|
||||
other.take == take;
|
||||
return other is AccountGiftProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, offset.hashCode);
|
||||
hash = _SystemHash.combine(hash, take.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin AccountReceivedGiftsRef
|
||||
on AutoDisposeFutureProviderRef<List<SnWalletGift>> {
|
||||
/// The parameter `offset` of this provider.
|
||||
int get offset;
|
||||
|
||||
/// The parameter `take` of this provider.
|
||||
int get take;
|
||||
}
|
||||
|
||||
class _AccountReceivedGiftsProviderElement
|
||||
extends AutoDisposeFutureProviderElement<List<SnWalletGift>>
|
||||
with AccountReceivedGiftsRef {
|
||||
_AccountReceivedGiftsProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
int get offset => (origin as AccountReceivedGiftsProvider).offset;
|
||||
@override
|
||||
int get take => (origin as AccountReceivedGiftsProvider).take;
|
||||
}
|
||||
|
||||
String _$accountGiftHash() => r'70ca553e0b84cba9dfbee428f9bf44207138713a';
|
||||
|
||||
/// See also [accountGift].
|
||||
@ProviderFor(accountGift)
|
||||
const accountGiftProvider = AccountGiftFamily();
|
||||
|
||||
/// See also [accountGift].
|
||||
class AccountGiftFamily extends Family<AsyncValue<SnWalletGift>> {
|
||||
/// See also [accountGift].
|
||||
const AccountGiftFamily();
|
||||
|
||||
/// See also [accountGift].
|
||||
AccountGiftProvider call(String giftId) {
|
||||
return AccountGiftProvider(giftId);
|
||||
}
|
||||
|
||||
@override
|
||||
AccountGiftProvider getProviderOverride(
|
||||
covariant AccountGiftProvider provider,
|
||||
) {
|
||||
return call(provider.giftId);
|
||||
}
|
||||
|
||||
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'accountGiftProvider';
|
||||
}
|
||||
|
||||
/// See also [accountGift].
|
||||
class AccountGiftProvider extends AutoDisposeFutureProvider<SnWalletGift> {
|
||||
/// See also [accountGift].
|
||||
AccountGiftProvider(String giftId)
|
||||
: this._internal(
|
||||
(ref) => accountGift(ref as AccountGiftRef, giftId),
|
||||
from: accountGiftProvider,
|
||||
final class AccountGiftFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<SnWalletGift>, String> {
|
||||
const AccountGiftFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'accountGiftProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$accountGiftHash,
|
||||
dependencies: AccountGiftFamily._dependencies,
|
||||
allTransitiveDependencies: AccountGiftFamily._allTransitiveDependencies,
|
||||
giftId: giftId,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
AccountGiftProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.giftId,
|
||||
}) : super.internal();
|
||||
|
||||
final String giftId;
|
||||
AccountGiftProvider call(String giftId) =>
|
||||
AccountGiftProvider._(argument: giftId, from: this);
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<SnWalletGift> Function(AccountGiftRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: AccountGiftProvider._internal(
|
||||
(ref) => create(ref as AccountGiftRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
giftId: giftId,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<SnWalletGift> createElement() {
|
||||
return _AccountGiftProviderElement(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is AccountGiftProvider && other.giftId == giftId;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, giftId.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
}
|
||||
String toString() => r'accountGiftProvider';
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin AccountGiftRef on AutoDisposeFutureProviderRef<SnWalletGift> {
|
||||
/// The parameter `giftId` of this provider.
|
||||
String get giftId;
|
||||
}
|
||||
|
||||
class _AccountGiftProviderElement
|
||||
extends AutoDisposeFutureProviderElement<SnWalletGift>
|
||||
with AccountGiftRef {
|
||||
_AccountGiftProviderElement(super.provider);
|
||||
|
||||
@override
|
||||
String get giftId => (origin as AccountGiftProvider).giftId;
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -43,9 +43,7 @@ class WindowScaffold extends HookConsumerWidget {
|
||||
(Platform.isWindows || Platform.isLinux || Platform.isMacOS)) {
|
||||
void saveWindowSize() {
|
||||
windowManager.getBounds().then((bounds) {
|
||||
final settingsNotifier = ref.read(
|
||||
appSettingsNotifierProvider.notifier,
|
||||
);
|
||||
final settingsNotifier = ref.read(appSettingsProvider.notifier);
|
||||
settingsNotifier.setWindowSize(bounds.size);
|
||||
});
|
||||
}
|
||||
@@ -437,7 +435,7 @@ class AppBackground extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final imageFileAsync = ref.watch(backgroundImageFileProvider);
|
||||
final settings = ref.watch(appSettingsNotifierProvider);
|
||||
final settings = ref.watch(appSettingsProvider);
|
||||
|
||||
if (isRoot || !isWideScreen(context)) {
|
||||
return imageFileAsync.when(
|
||||
@@ -482,8 +480,7 @@ class EmptyPageHolder extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final hasBackground =
|
||||
ref.watch(backgroundImageFileProvider).valueOrNull != null;
|
||||
final hasBackground = ref.watch(backgroundImageFileProvider).value != null;
|
||||
if (hasBackground) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ class AudioCallButton extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final ongoingCall = ref.watch(ongoingCallProvider(room.id));
|
||||
final callState = ref.watch(callNotifierProvider);
|
||||
final callNotifier = ref.read(callNotifierProvider.notifier);
|
||||
final callState = ref.watch(callProvider);
|
||||
final callNotifier = ref.read(callProvider.notifier);
|
||||
final isLoading = useState(false);
|
||||
final apiClient = ref.watch(apiClientProvider);
|
||||
|
||||
|
||||
@@ -6,146 +6,80 @@ part of 'call_button.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$ongoingCallHash() => r'48031badb79efa07aefb3a4fc51635be457bd3f9';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [ongoingCall].
|
||||
@ProviderFor(ongoingCall)
|
||||
const ongoingCallProvider = OngoingCallFamily();
|
||||
const ongoingCallProvider = OngoingCallFamily._();
|
||||
|
||||
/// See also [ongoingCall].
|
||||
class OngoingCallFamily extends Family<AsyncValue<SnRealtimeCall?>> {
|
||||
/// See also [ongoingCall].
|
||||
const OngoingCallFamily();
|
||||
final class OngoingCallProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnRealtimeCall?>,
|
||||
SnRealtimeCall?,
|
||||
FutureOr<SnRealtimeCall?>
|
||||
>
|
||||
with $FutureModifier<SnRealtimeCall?>, $FutureProvider<SnRealtimeCall?> {
|
||||
const OngoingCallProvider._({
|
||||
required OngoingCallFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'ongoingCallProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [ongoingCall].
|
||||
OngoingCallProvider call(String roomId) {
|
||||
return OngoingCallProvider(roomId);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$ongoingCallHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'ongoingCallProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
OngoingCallProvider getProviderOverride(
|
||||
covariant OngoingCallProvider provider,
|
||||
) {
|
||||
return call(provider.roomId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<SnRealtimeCall?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'ongoingCallProvider';
|
||||
}
|
||||
|
||||
/// See also [ongoingCall].
|
||||
class OngoingCallProvider extends AutoDisposeFutureProvider<SnRealtimeCall?> {
|
||||
/// See also [ongoingCall].
|
||||
OngoingCallProvider(String roomId)
|
||||
: this._internal(
|
||||
(ref) => ongoingCall(ref as OngoingCallRef, roomId),
|
||||
from: ongoingCallProvider,
|
||||
name: r'ongoingCallProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$ongoingCallHash,
|
||||
dependencies: OngoingCallFamily._dependencies,
|
||||
allTransitiveDependencies: OngoingCallFamily._allTransitiveDependencies,
|
||||
roomId: roomId,
|
||||
);
|
||||
|
||||
OngoingCallProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.roomId,
|
||||
}) : super.internal();
|
||||
|
||||
final String roomId;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<SnRealtimeCall?> Function(OngoingCallRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: OngoingCallProvider._internal(
|
||||
(ref) => create(ref as OngoingCallRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
roomId: roomId,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<SnRealtimeCall?> createElement() {
|
||||
return _OngoingCallProviderElement(this);
|
||||
FutureOr<SnRealtimeCall?> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return ongoingCall(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is OngoingCallProvider && other.roomId == roomId;
|
||||
return other is OngoingCallProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, roomId.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin OngoingCallRef on AutoDisposeFutureProviderRef<SnRealtimeCall?> {
|
||||
/// The parameter `roomId` of this provider.
|
||||
String get roomId;
|
||||
}
|
||||
String _$ongoingCallHash() => r'48031badb79efa07aefb3a4fc51635be457bd3f9';
|
||||
|
||||
class _OngoingCallProviderElement
|
||||
extends AutoDisposeFutureProviderElement<SnRealtimeCall?>
|
||||
with OngoingCallRef {
|
||||
_OngoingCallProviderElement(super.provider);
|
||||
final class OngoingCallFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<SnRealtimeCall?>, String> {
|
||||
const OngoingCallFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'ongoingCallProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
OngoingCallProvider call(String roomId) =>
|
||||
OngoingCallProvider._(argument: roomId, from: this);
|
||||
|
||||
@override
|
||||
String get roomId => (origin as OngoingCallProvider).roomId;
|
||||
String toString() => r'ongoingCallProvider';
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -10,8 +10,8 @@ class CallContent extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final callState = ref.watch(callNotifierProvider);
|
||||
final callNotifier = ref.watch(callNotifierProvider.notifier);
|
||||
final callState = ref.watch(callProvider);
|
||||
final callNotifier = ref.watch(callProvider.notifier);
|
||||
|
||||
if (!callState.isConnected) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
|
||||
@@ -25,8 +25,8 @@ class CallControlsBar extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final callState = ref.watch(callNotifierProvider);
|
||||
final callNotifier = ref.read(callNotifierProvider.notifier);
|
||||
final callState = ref.watch(callProvider);
|
||||
final callNotifier = ref.read(callProvider.notifier);
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
@@ -268,7 +268,7 @@ class CallControlsBar extends HookConsumerWidget {
|
||||
String deviceType,
|
||||
) async {
|
||||
try {
|
||||
final callNotifier = ref.read(callNotifierProvider.notifier);
|
||||
final callNotifier = ref.read(callProvider.notifier);
|
||||
|
||||
if (deviceType == 'videoinput') {
|
||||
// Switch camera device
|
||||
@@ -312,8 +312,8 @@ class CallOverlayBar extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final callState = ref.watch(callNotifierProvider);
|
||||
final callNotifier = ref.read(callNotifierProvider.notifier);
|
||||
final callState = ref.watch(callProvider);
|
||||
final callNotifier = ref.read(callProvider.notifier);
|
||||
final ongoingCall = ref.watch(ongoingCallProvider(room.id));
|
||||
|
||||
// State for overlay mode: compact or preview
|
||||
@@ -398,7 +398,7 @@ class CallOverlayBar extends HookConsumerWidget {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
// Just join the room, don't navigate
|
||||
await ref.read(callNotifierProvider.notifier).joinRoom(room);
|
||||
await ref.read(callProvider.notifier).joinRoom(room);
|
||||
} catch (e) {
|
||||
showErrorAlert(e);
|
||||
} finally {
|
||||
|
||||
@@ -19,7 +19,7 @@ class CallParticipantCard extends HookConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final width =
|
||||
math.min(MediaQuery.of(context).size.width - 80, 360).toDouble();
|
||||
final callNotifier = ref.watch(callNotifierProvider.notifier);
|
||||
final callNotifier = ref.watch(callProvider.notifier);
|
||||
|
||||
final volumeSliderValue = useState(callNotifier.getParticipantVolume(live));
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ class ChatInput extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final inputFocusNode = useFocusNode();
|
||||
final chatSubscribe = ref.watch(chatSubscribeNotifierProvider(chatRoom.id));
|
||||
final chatSubscribe = ref.watch(chatSubscribeProvider(chatRoom.id));
|
||||
final isExpanded = useState(false);
|
||||
|
||||
void send() {
|
||||
@@ -310,7 +310,7 @@ class ChatInput extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
final settings = ref.watch(appSettingsNotifierProvider);
|
||||
final settings = ref.watch(appSettingsProvider);
|
||||
|
||||
inputFocusNode.onKeyEvent = (node, event) {
|
||||
if (event is! KeyDownEvent) return KeyEventResult.ignored;
|
||||
|
||||
@@ -13,14 +13,12 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
final chatCloudFileListNotifierProvider = AsyncNotifierProvider.autoDispose<
|
||||
ChatCloudFileListNotifier,
|
||||
List<SnCloudFile>
|
||||
>(ChatCloudFileListNotifier.new);
|
||||
final chatCloudFileListNotifierProvider = AsyncNotifierProvider.autoDispose(
|
||||
ChatCloudFileListNotifier.new,
|
||||
);
|
||||
|
||||
class ChatCloudFileListNotifier
|
||||
extends AutoDisposeAsyncNotifier<List<SnCloudFile>>
|
||||
with AutoDisposeAsyncPaginationController<SnCloudFile> {
|
||||
class ChatCloudFileListNotifier extends AsyncNotifier<List<SnCloudFile>>
|
||||
with AsyncPaginationController<SnCloudFile> {
|
||||
@override
|
||||
Future<List<SnCloudFile>> fetch() async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
@@ -67,7 +67,7 @@ class MessageItem extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final remoteMessage = message.toRemoteMessage();
|
||||
final settings = ref.watch(appSettingsNotifierProvider);
|
||||
final settings = ref.watch(appSettingsProvider);
|
||||
|
||||
final isMobile = !kIsWeb && (Platform.isAndroid || Platform.isIOS);
|
||||
|
||||
@@ -1150,7 +1150,7 @@ class MessageQuoteWidget extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final messagesNotifier = ref.watch(
|
||||
messagesNotifierProvider(message.roomId).notifier,
|
||||
messagesProvider(message.roomId).notifier,
|
||||
);
|
||||
|
||||
return FutureBuilder<LocalChatMessage?>(
|
||||
|
||||
@@ -28,8 +28,8 @@ class PublicRoomPreview extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final messages = ref.watch(messagesNotifierProvider(id));
|
||||
final messagesNotifier = ref.read(messagesNotifierProvider(id).notifier);
|
||||
final messages = ref.watch(messagesProvider(id));
|
||||
final messagesNotifier = ref.read(messagesProvider(id).notifier);
|
||||
final scrollController = useScrollController();
|
||||
|
||||
final listController = useMemoized(() => ListController(), []);
|
||||
@@ -204,7 +204,7 @@ class PublicRoomPreview extends HookConsumerWidget {
|
||||
showLoadingModal(context);
|
||||
final apiClient = ref.read(apiClientProvider);
|
||||
await apiClient.post('/sphere/chat/${room.id}/members/me');
|
||||
ref.invalidate(ChatRoomIdentityNotifierProvider(id));
|
||||
ref.invalidate(chatRoomIdentityProvider(id));
|
||||
} catch (err) {
|
||||
showErrorAlert(err);
|
||||
} finally {
|
||||
|
||||
@@ -253,7 +253,7 @@ class CheckInWidget extends HookConsumerWidget {
|
||||
vertical: -2,
|
||||
),
|
||||
onPressed: () {
|
||||
if (todayResult.valueOrNull == null) {
|
||||
if (todayResult.value == null) {
|
||||
checkIn();
|
||||
} else {
|
||||
showModalBottomSheet(
|
||||
|
||||
@@ -6,44 +6,84 @@ part of 'check_in.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
@ProviderFor(checkInResultToday)
|
||||
const checkInResultTodayProvider = CheckInResultTodayProvider._();
|
||||
|
||||
final class CheckInResultTodayProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnCheckInResult?>,
|
||||
SnCheckInResult?,
|
||||
FutureOr<SnCheckInResult?>
|
||||
>
|
||||
with $FutureModifier<SnCheckInResult?>, $FutureProvider<SnCheckInResult?> {
|
||||
const CheckInResultTodayProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'checkInResultTodayProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$checkInResultTodayHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<SnCheckInResult?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<SnCheckInResult?> create(Ref ref) {
|
||||
return checkInResultToday(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$checkInResultTodayHash() =>
|
||||
r'b4dc97b2243f542b36c295dc5cce3fe6097cb308';
|
||||
|
||||
/// See also [checkInResultToday].
|
||||
@ProviderFor(checkInResultToday)
|
||||
final checkInResultTodayProvider =
|
||||
AutoDisposeFutureProvider<SnCheckInResult?>.internal(
|
||||
checkInResultToday,
|
||||
name: r'checkInResultTodayProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$checkInResultTodayHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef CheckInResultTodayRef = AutoDisposeFutureProviderRef<SnCheckInResult?>;
|
||||
String _$nextNotableDayHash() => r'c8404308f6b0f581cc7df251bce8f3c5ac130245';
|
||||
|
||||
/// See also [nextNotableDay].
|
||||
@ProviderFor(nextNotableDay)
|
||||
final nextNotableDayProvider =
|
||||
AutoDisposeFutureProvider<SnNotableDay?>.internal(
|
||||
nextNotableDay,
|
||||
name: r'nextNotableDayProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$nextNotableDayHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
const nextNotableDayProvider = NextNotableDayProvider._();
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef NextNotableDayRef = AutoDisposeFutureProviderRef<SnNotableDay?>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class NextNotableDayProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnNotableDay?>,
|
||||
SnNotableDay?,
|
||||
FutureOr<SnNotableDay?>
|
||||
>
|
||||
with $FutureModifier<SnNotableDay?>, $FutureProvider<SnNotableDay?> {
|
||||
const NextNotableDayProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'nextNotableDayProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$nextNotableDayHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<SnNotableDay?> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<SnNotableDay?> create(Ref ref) {
|
||||
return nextNotableDay(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$nextNotableDayHash() => r'c8404308f6b0f581cc7df251bce8f3c5ac130245';
|
||||
|
||||
@@ -410,7 +410,7 @@ class _CloudFileListEntry extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final dataSaving = ref.watch(
|
||||
appSettingsNotifierProvider.select((s) => s.dataSavingMode),
|
||||
appSettingsProvider.select((s) => s.dataSavingMode),
|
||||
);
|
||||
final showMature = useState(false);
|
||||
final showDataSaving = useState(!dataSaving);
|
||||
|
||||
@@ -35,7 +35,7 @@ class CloudFileWidget extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final dataSaving = ref.watch(
|
||||
appSettingsNotifierProvider.select((s) => s.dataSavingMode),
|
||||
appSettingsProvider.select((s) => s.dataSavingMode),
|
||||
);
|
||||
final serverUrl = ref.watch(serverUrlProvider);
|
||||
final uri = '$serverUrl/drive/files/${item.id}';
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:island/pods/config.dart';
|
||||
|
||||
|
||||
typedef WidgetBuilder0 = Widget Function();
|
||||
|
||||
class DataSavingGate extends ConsumerWidget {
|
||||
@@ -19,8 +18,9 @@ class DataSavingGate extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final dataSaving =
|
||||
ref.watch(appSettingsNotifierProvider.select((s) => s.dataSavingMode));
|
||||
final dataSaving = ref.watch(
|
||||
appSettingsProvider.select((s) => s.dataSavingMode),
|
||||
);
|
||||
if (bypass || !dataSaving) return content();
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
@@ -59,9 +59,7 @@ class FileListView extends HookConsumerWidget {
|
||||
|
||||
useEffect(() {
|
||||
if (mode.value == FileListMode.normal) {
|
||||
final notifier = ref.read(
|
||||
indexedCloudFileListNotifierProvider.notifier,
|
||||
);
|
||||
final notifier = ref.read(indexedCloudFileListProvider.notifier);
|
||||
notifier.setPath(currentPath.value);
|
||||
}
|
||||
return null;
|
||||
@@ -69,12 +67,8 @@ class FileListView extends HookConsumerWidget {
|
||||
|
||||
if (usage == null) return const SizedBox.shrink();
|
||||
|
||||
final unindexedNotifier = ref.read(
|
||||
unindexedFileListNotifierProvider.notifier,
|
||||
);
|
||||
final cloudNotifier = ref.read(
|
||||
indexedCloudFileListNotifierProvider.notifier,
|
||||
);
|
||||
final unindexedNotifier = ref.read(unindexedFileListProvider.notifier);
|
||||
final cloudNotifier = ref.read(indexedCloudFileListProvider.notifier);
|
||||
final recycled = useState<bool>(false);
|
||||
final poolsAsync = ref.watch(poolsProvider);
|
||||
final isSelectionMode = useState<bool>(false);
|
||||
@@ -119,18 +113,14 @@ class FileListView extends HookConsumerWidget {
|
||||
|
||||
final isRefreshing = ref.watch(
|
||||
mode.value == FileListMode.normal
|
||||
? indexedCloudFileListNotifierProvider.select(
|
||||
(value) => value.isLoading,
|
||||
)
|
||||
: unindexedFileListNotifierProvider.select(
|
||||
(value) => value.isLoading,
|
||||
),
|
||||
? indexedCloudFileListProvider.select((value) => value.isLoading)
|
||||
: unindexedFileListProvider.select((value) => value.isLoading),
|
||||
);
|
||||
|
||||
final bodyWidget = switch (mode.value) {
|
||||
FileListMode.unindexed => PaginationWidget(
|
||||
provider: unindexedFileListNotifierProvider,
|
||||
notifier: unindexedFileListNotifierProvider.notifier,
|
||||
provider: unindexedFileListProvider,
|
||||
notifier: unindexedFileListProvider.notifier,
|
||||
isRefreshable: false,
|
||||
isSliver: true,
|
||||
contentBuilder:
|
||||
@@ -151,8 +141,8 @@ class FileListView extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
_ => PaginationWidget(
|
||||
provider: indexedCloudFileListNotifierProvider,
|
||||
notifier: indexedCloudFileListNotifierProvider.notifier,
|
||||
provider: indexedCloudFileListProvider,
|
||||
notifier: indexedCloudFileListProvider.notifier,
|
||||
isRefreshable: false,
|
||||
isSliver: true,
|
||||
contentBuilder:
|
||||
@@ -261,7 +251,7 @@ class FileListView extends HookConsumerWidget {
|
||||
completer.future
|
||||
.then((uploadedFile) {
|
||||
if (uploadedFile != null) {
|
||||
ref.invalidate(indexedCloudFileListNotifierProvider);
|
||||
ref.invalidate(indexedCloudFileListProvider);
|
||||
}
|
||||
})
|
||||
.catchError((error) {
|
||||
@@ -538,8 +528,8 @@ class FileListView extends HookConsumerWidget {
|
||||
isSelectionMode.value = false;
|
||||
ref.invalidate(
|
||||
mode.value == FileListMode.normal
|
||||
? indexedCloudFileListNotifierProvider
|
||||
: unindexedFileListNotifierProvider,
|
||||
? indexedCloudFileListProvider
|
||||
: unindexedFileListProvider,
|
||||
);
|
||||
showSnackBar('Deleted $count files.');
|
||||
} catch (e) {
|
||||
@@ -804,7 +794,7 @@ class FileListView extends HookConsumerWidget {
|
||||
await client.delete(
|
||||
'/drive/index/remove/${fileItem.fileIndex.id}',
|
||||
);
|
||||
ref.invalidate(indexedCloudFileListNotifierProvider);
|
||||
ref.invalidate(indexedCloudFileListProvider);
|
||||
} catch (e) {
|
||||
showSnackBar('failedToDeleteFile'.tr());
|
||||
} finally {
|
||||
@@ -1168,7 +1158,7 @@ class FileListView extends HookConsumerWidget {
|
||||
try {
|
||||
final client = ref.read(apiClientProvider);
|
||||
await client.delete('/drive/index/remove/${fileItem.fileIndex.id}');
|
||||
ref.invalidate(indexedCloudFileListNotifierProvider);
|
||||
ref.invalidate(indexedCloudFileListProvider);
|
||||
} catch (e) {
|
||||
showSnackBar('failedToDeleteFile'.tr());
|
||||
} finally {
|
||||
@@ -1237,7 +1227,7 @@ class FileListView extends HookConsumerWidget {
|
||||
try {
|
||||
final client = ref.read(apiClientProvider);
|
||||
await client.delete('/drive/files/${file.id}');
|
||||
ref.invalidate(unindexedFileListNotifierProvider);
|
||||
ref.invalidate(unindexedFileListProvider);
|
||||
} catch (e) {
|
||||
showSnackBar('failedToDeleteFile'.tr());
|
||||
} finally {
|
||||
@@ -1280,7 +1270,7 @@ class FileListView extends HookConsumerWidget {
|
||||
try {
|
||||
final client = ref.read(apiClientProvider);
|
||||
await client.delete('/drive/files/${unindexedFileItem.file.id}');
|
||||
ref.invalidate(unindexedFileListNotifierProvider);
|
||||
ref.invalidate(unindexedFileListProvider);
|
||||
} catch (e) {
|
||||
showSnackBar('failedToDeleteFile'.tr());
|
||||
} finally {
|
||||
@@ -1374,7 +1364,7 @@ class FileListView extends HookConsumerWidget {
|
||||
);
|
||||
final count = response.data['count'] as int? ?? 0;
|
||||
showSnackBar('Cleared $count recycled files.');
|
||||
ref.invalidate(unindexedFileListNotifierProvider);
|
||||
ref.invalidate(unindexedFileListProvider);
|
||||
} catch (e) {
|
||||
showSnackBar('Failed to clear recycled files.');
|
||||
} finally {
|
||||
@@ -1566,7 +1556,7 @@ class FileListView extends HookConsumerWidget {
|
||||
icon: const Icon(Symbols.refresh),
|
||||
onPressed: () {
|
||||
if (mode.value == FileListMode.unindexed) {
|
||||
ref.invalidate(unindexedFileListNotifierProvider);
|
||||
ref.invalidate(unindexedFileListProvider);
|
||||
} else {
|
||||
cloudNotifier.setPath(currentPath.value);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:island/pods/network.dart';
|
||||
import 'package:island/pods/userinfo.dart';
|
||||
import 'package:island/screens/auth/create_account_modal.dart';
|
||||
@@ -19,10 +19,21 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
enum FabMenuType { main, compose, chat, realm }
|
||||
|
||||
/// Global state provider for FAB menu type
|
||||
final fabMenuTypeProvider = StateProvider<FabMenuType>(
|
||||
(ref) => FabMenuType.main,
|
||||
final fabMenuTypeProvider = NotifierProvider<FabMenuTypeNotifier, FabMenuType>(
|
||||
FabMenuTypeNotifier.new,
|
||||
);
|
||||
|
||||
class FabMenuTypeNotifier extends Notifier<FabMenuType> {
|
||||
@override
|
||||
FabMenuType build() {
|
||||
return FabMenuType.main;
|
||||
}
|
||||
|
||||
void setMenuType(FabMenuType menuType) {
|
||||
state = menuType;
|
||||
}
|
||||
}
|
||||
|
||||
class FabMenu extends HookConsumerWidget {
|
||||
final double? elevation;
|
||||
const FabMenu({super.key, this.elevation});
|
||||
@@ -97,9 +108,7 @@ class FabMenu extends HookConsumerWidget {
|
||||
),
|
||||
Consumer(
|
||||
builder: (context, ref, _) {
|
||||
final notificationCount = ref.watch(
|
||||
notificationUnreadCountNotifierProvider,
|
||||
);
|
||||
final notificationCount = ref.watch(notificationUnreadCountProvider);
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 24),
|
||||
leading: const Icon(Symbols.notifications),
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/misc.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:island/pods/paging.dart';
|
||||
|
||||
import 'package:island/widgets/extended_refresh_indicator.dart';
|
||||
import 'package:island/widgets/response.dart';
|
||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:super_sliver_list/super_sliver_list.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
@@ -34,7 +35,7 @@ class PaginationList<T> extends HookConsumerWidget {
|
||||
final data = ref.watch(provider);
|
||||
final noti = ref.watch(notifier);
|
||||
|
||||
if (data.isLoading && data.valueOrNull?.isEmpty == true) {
|
||||
if (data.isLoading && data.value?.isEmpty == true) {
|
||||
final content = ResponseLoadingWidget();
|
||||
return isSliver ? SliverFillRemaining(child: content) : content;
|
||||
}
|
||||
@@ -50,24 +51,24 @@ class PaginationList<T> extends HookConsumerWidget {
|
||||
final listView =
|
||||
isSliver
|
||||
? SuperSliverList.builder(
|
||||
itemCount: (data.valueOrNull?.length ?? 0) + 1,
|
||||
itemCount: (data.value?.length ?? 0) + 1,
|
||||
itemBuilder: (context, idx) {
|
||||
if (idx == data.valueOrNull?.length) {
|
||||
if (idx == data.value?.length) {
|
||||
return PaginationListFooter(noti: noti, data: data);
|
||||
}
|
||||
final entry = data.valueOrNull?[idx];
|
||||
final entry = data.value?[idx];
|
||||
if (entry != null) return itemBuilder(context, idx, entry);
|
||||
return null;
|
||||
},
|
||||
)
|
||||
: SuperListView.builder(
|
||||
padding: padding,
|
||||
itemCount: (data.valueOrNull?.length ?? 0) + 1,
|
||||
itemCount: (data.value?.length ?? 0) + 1,
|
||||
itemBuilder: (context, idx) {
|
||||
if (idx == data.valueOrNull?.length) {
|
||||
if (idx == data.value?.length) {
|
||||
return PaginationListFooter(noti: noti, data: data);
|
||||
}
|
||||
final entry = data.valueOrNull?[idx];
|
||||
final entry = data.value?[idx];
|
||||
if (entry != null) return itemBuilder(context, idx, entry);
|
||||
return null;
|
||||
},
|
||||
@@ -101,7 +102,7 @@ class PaginationWidget<T> extends HookConsumerWidget {
|
||||
final data = ref.watch(provider);
|
||||
final noti = ref.watch(notifier);
|
||||
|
||||
if (data.isLoading && data.valueOrNull?.isEmpty == true) {
|
||||
if (data.isLoading && data.value?.isEmpty == true) {
|
||||
final content = ResponseLoadingWidget();
|
||||
return isSliver ? SliverFillRemaining(child: content) : content;
|
||||
}
|
||||
@@ -115,7 +116,7 @@ class PaginationWidget<T> extends HookConsumerWidget {
|
||||
}
|
||||
|
||||
final footer = PaginationListFooter(noti: noti, data: data);
|
||||
final content = contentBuilder(data.valueOrNull ?? [], footer);
|
||||
final content = contentBuilder(data.value ?? [], footer);
|
||||
|
||||
return isRefreshable
|
||||
? ExtendedRefreshIndicator(onRefresh: noti.refresh, child: content)
|
||||
|
||||
@@ -20,16 +20,18 @@ final pollFeedbackNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
PollFeedbackNotifier.new,
|
||||
);
|
||||
|
||||
class PollFeedbackNotifier
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<SnPollAnswer>, String>
|
||||
with FamilyAsyncPaginationController<SnPollAnswer, String> {
|
||||
static const int _pageSize = 20;
|
||||
class PollFeedbackNotifier extends AsyncNotifier<List<SnPollAnswer>>
|
||||
with AsyncPaginationController<SnPollAnswer> {
|
||||
static const int pageSize = 20;
|
||||
|
||||
final String arg;
|
||||
PollFeedbackNotifier(this.arg);
|
||||
|
||||
@override
|
||||
Future<List<SnPollAnswer>> fetch() async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final queryParams = {'offset': fetchedCount, 'take': _pageSize};
|
||||
final queryParams = {'offset': fetchedCount, 'take': pageSize};
|
||||
|
||||
final response = await client.get(
|
||||
'/sphere/polls/$arg/feedback',
|
||||
@@ -68,8 +70,7 @@ class PollFeedbackSheet extends HookConsumerWidget {
|
||||
return Column(
|
||||
children: [
|
||||
_PollAnswerTile(answer: answer, poll: data),
|
||||
if (index <
|
||||
(ref.read(provider).valueOrNull?.length ?? 0) - 1)
|
||||
if (index < (ref.read(provider).value?.length ?? 0) - 1)
|
||||
const Divider(height: 1).padding(vertical: 4),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -60,7 +60,7 @@ class PostComposeCard extends HookConsumerWidget {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
// Capture the notifier to avoid using ref after dispose
|
||||
final notifier = ref.read(composeStorageNotifierProvider.notifier);
|
||||
final notifier = ref.read(composeStorageProvider.notifier);
|
||||
|
||||
// Create compose state
|
||||
final ComposeState composeState =
|
||||
@@ -158,7 +158,7 @@ class PostComposeCard extends HookConsumerWidget {
|
||||
|
||||
// Delete draft after successful submission
|
||||
ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(composeState.draftId);
|
||||
|
||||
// Reset the form for new composition
|
||||
|
||||
@@ -47,7 +47,7 @@ class PostComposeDialog extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final drafts = ref.watch(composeStorageNotifierProvider);
|
||||
final drafts = ref.watch(composeStorageProvider);
|
||||
final restoredInitialState = useState<PostComposeInitialState?>(null);
|
||||
final prompted = useState(false);
|
||||
|
||||
@@ -166,7 +166,7 @@ class PostComposeDialog extends HookConsumerWidget {
|
||||
WidgetRef ref,
|
||||
ValueNotifier<PostComposeInitialState?> restoredInitialState,
|
||||
) async {
|
||||
final drafts = ref.read(composeStorageNotifierProvider);
|
||||
final drafts = ref.read(composeStorageProvider);
|
||||
if (drafts.isNotEmpty) {
|
||||
final latestDraft = drafts.values.last;
|
||||
|
||||
@@ -200,7 +200,7 @@ class PostComposeDialog extends HookConsumerWidget {
|
||||
if (restore == true) {
|
||||
// Delete the old draft
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(latestDraft.id);
|
||||
restoredInitialState.value = PostComposeInitialState(
|
||||
title: latestDraft.title,
|
||||
|
||||
@@ -22,7 +22,7 @@ class ComposeFundSheet extends HookConsumerWidget {
|
||||
final isPushing = useState(false);
|
||||
final errorText = useState<String?>(null);
|
||||
|
||||
final fundsData = ref.watch(walletFundsNotifierProvider);
|
||||
final fundsData = ref.watch(walletFundsProvider);
|
||||
|
||||
return SheetScaffold(
|
||||
heightFactor: 0.6,
|
||||
@@ -301,9 +301,7 @@ class ComposeFundSheet extends HookConsumerWidget {
|
||||
await Future.delayed(
|
||||
const Duration(seconds: 1),
|
||||
);
|
||||
ref.invalidate(
|
||||
walletFundsNotifierProvider,
|
||||
);
|
||||
ref.invalidate(walletFundsProvider);
|
||||
|
||||
// Return the created fund
|
||||
final updatedResp = await client.get(
|
||||
|
||||
@@ -18,8 +18,8 @@ final cloudFileListNotifierProvider =
|
||||
CloudFileListNotifier.new,
|
||||
);
|
||||
|
||||
class CloudFileListNotifier extends AutoDisposeAsyncNotifier<List<SnCloudFile>>
|
||||
with AutoDisposeAsyncPaginationController<SnCloudFile> {
|
||||
class CloudFileListNotifier extends AsyncNotifier<List<SnCloudFile>>
|
||||
with AsyncPaginationController<SnCloudFile> {
|
||||
@override
|
||||
Future<List<SnCloudFile>> fetch() async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
@@ -6,24 +6,46 @@ part of 'compose_settings_sheet.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$postCategoriesHash() => r'8799c10eb91cf8c8c7ea72eff3475e1eaa7b9a2b';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// See also [postCategories].
|
||||
@ProviderFor(postCategories)
|
||||
final postCategoriesProvider =
|
||||
AutoDisposeFutureProvider<List<SnPostCategory>>.internal(
|
||||
postCategories,
|
||||
name: r'postCategoriesProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$postCategoriesHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
const postCategoriesProvider = PostCategoriesProvider._();
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef PostCategoriesRef = AutoDisposeFutureProviderRef<List<SnPostCategory>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class PostCategoriesProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnPostCategory>>,
|
||||
List<SnPostCategory>,
|
||||
FutureOr<List<SnPostCategory>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnPostCategory>>,
|
||||
$FutureProvider<List<SnPostCategory>> {
|
||||
const PostCategoriesProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'postCategoriesProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$postCategoriesHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnPostCategory>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnPostCategory>> create(Ref ref) {
|
||||
return postCategories(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$postCategoriesHash() => r'8799c10eb91cf8c8c7ea72eff3475e1eaa7b9a2b';
|
||||
|
||||
@@ -272,7 +272,7 @@ class ComposeLogic {
|
||||
deletedAt: null,
|
||||
);
|
||||
|
||||
await ref.read(composeStorageNotifierProvider.notifier).saveDraft(draft);
|
||||
await ref.read(composeStorageProvider.notifier).saveDraft(draft);
|
||||
} catch (e) {
|
||||
talker.error('[ComposeLogic] Failed to save draft, error: $e');
|
||||
}
|
||||
@@ -345,7 +345,7 @@ class ComposeLogic {
|
||||
deletedAt: null,
|
||||
);
|
||||
|
||||
await ref.read(composeStorageNotifierProvider.notifier).saveDraft(draft);
|
||||
await ref.read(composeStorageProvider.notifier).saveDraft(draft);
|
||||
} catch (e) {
|
||||
talker.error(
|
||||
'[ComposeLogic] Failed to save draft without upload, error: $e',
|
||||
@@ -374,9 +374,7 @@ class ComposeLogic {
|
||||
|
||||
static Future<void> deleteDraft(WidgetRef ref, String draftId) async {
|
||||
try {
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.deleteDraft(draftId);
|
||||
await ref.read(composeStorageProvider.notifier).deleteDraft(draftId);
|
||||
} catch (e) {
|
||||
// Silently fail
|
||||
}
|
||||
@@ -384,9 +382,7 @@ class ComposeLogic {
|
||||
|
||||
static Future<SnPost?> loadDraft(WidgetRef ref, String draftId) async {
|
||||
try {
|
||||
return ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.getDraft(draftId);
|
||||
return ref.read(composeStorageProvider.notifier).getDraft(draftId);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
@@ -778,12 +774,12 @@ class ComposeLogic {
|
||||
if (state.postType == 1) {
|
||||
// Delete article draft
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(state.draftId);
|
||||
} else {
|
||||
// Delete regular post draft
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(state.draftId);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class PostComposeSheet extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final drafts = ref.watch(composeStorageNotifierProvider);
|
||||
final drafts = ref.watch(composeStorageProvider);
|
||||
final restoredInitialState = useState<PostComposeInitialState?>(null);
|
||||
final prompted = useState(false);
|
||||
|
||||
@@ -185,7 +185,7 @@ class PostComposeSheet extends HookConsumerWidget {
|
||||
WidgetRef ref,
|
||||
ValueNotifier<PostComposeInitialState?> restoredInitialState,
|
||||
) async {
|
||||
final drafts = ref.read(composeStorageNotifierProvider);
|
||||
final drafts = ref.read(composeStorageProvider);
|
||||
if (drafts.isNotEmpty) {
|
||||
final latestDraft = drafts.values.last;
|
||||
|
||||
@@ -219,7 +219,7 @@ class PostComposeSheet extends HookConsumerWidget {
|
||||
if (restore == true) {
|
||||
// Delete the old draft
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(latestDraft.id);
|
||||
restoredInitialState.value = PostComposeInitialState(
|
||||
title: latestDraft.title,
|
||||
|
||||
@@ -60,7 +60,7 @@ class ComposeStateUtils {
|
||||
repliedPost == null &&
|
||||
initialState == null) {
|
||||
// Try to load the most recent draft
|
||||
final drafts = ref.read(composeStorageNotifierProvider);
|
||||
final drafts = ref.read(composeStorageProvider);
|
||||
if (drafts.isNotEmpty) {
|
||||
final mostRecentDraft = drafts.values.reduce(
|
||||
(a, b) =>
|
||||
@@ -128,7 +128,7 @@ class ComposeStateUtils {
|
||||
updatedAt: DateTime.now(),
|
||||
);
|
||||
ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.saveDraft(draft)
|
||||
.catchError((e) => debugPrint('Failed to save draft: $e'));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class ComposeToolbar extends HookConsumerWidget {
|
||||
builder:
|
||||
(context) => DraftManagerSheet(
|
||||
onDraftSelected: (draftId) {
|
||||
final draft = ref.read(composeStorageNotifierProvider)[draftId];
|
||||
final draft = ref.read(composeStorageProvider)[draftId];
|
||||
if (draft != null) {
|
||||
state.titleController.text = draft.title ?? '';
|
||||
state.descriptionController.text = draft.description ?? '';
|
||||
|
||||
@@ -20,7 +20,7 @@ class DraftManagerSheet extends HookConsumerWidget {
|
||||
final searchController = useTextEditingController();
|
||||
final searchQuery = useState('');
|
||||
|
||||
final drafts = ref.watch(composeStorageNotifierProvider);
|
||||
final drafts = ref.watch(composeStorageProvider);
|
||||
|
||||
// Search functionality
|
||||
final filteredDrafts = useMemoized(() {
|
||||
@@ -101,7 +101,7 @@ class DraftManagerSheet extends HookConsumerWidget {
|
||||
},
|
||||
onDelete: () async {
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.deleteDraft(draft.id);
|
||||
},
|
||||
);
|
||||
@@ -127,7 +127,7 @@ class DraftManagerSheet extends HookConsumerWidget {
|
||||
|
||||
if (confirmed == true) {
|
||||
await ref
|
||||
.read(composeStorageNotifierProvider.notifier)
|
||||
.read(composeStorageProvider.notifier)
|
||||
.clearAllDrafts();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,16 +11,18 @@ final postAwardListNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
PostAwardListNotifier.new,
|
||||
);
|
||||
|
||||
class PostAwardListNotifier
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<SnPostAward>, String>
|
||||
with FamilyAsyncPaginationController<SnPostAward, String> {
|
||||
static const int _pageSize = 20;
|
||||
class PostAwardListNotifier extends AsyncNotifier<List<SnPostAward>>
|
||||
with AsyncPaginationController<SnPostAward> {
|
||||
static const int pageSize = 20;
|
||||
|
||||
final String arg;
|
||||
PostAwardListNotifier(this.arg);
|
||||
|
||||
@override
|
||||
Future<List<SnPostAward>> fetch() async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final queryParams = {'offset': fetchedCount, 'take': _pageSize};
|
||||
final queryParams = {'offset': fetchedCount, 'take': pageSize};
|
||||
|
||||
final response = await client.get(
|
||||
'/sphere/posts/$arg/awards',
|
||||
@@ -50,7 +52,7 @@ class PostAwardHistorySheet extends HookConsumerWidget {
|
||||
return Column(
|
||||
children: [
|
||||
PostAwardItem(award: award),
|
||||
if (index < (ref.read(provider).valueOrNull?.length ?? 0) - 1)
|
||||
if (index < (ref.read(provider).value?.length ?? 0) - 1)
|
||||
const Divider(height: 1),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -6,23 +6,44 @@ part of 'post_featured.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$featuredPostsHash() => r'4b7fffb02eac72f5861b02af1b1e5da36b571698';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// See also [featuredPosts].
|
||||
@ProviderFor(featuredPosts)
|
||||
final featuredPostsProvider = AutoDisposeFutureProvider<List<SnPost>>.internal(
|
||||
featuredPosts,
|
||||
name: r'featuredPostsProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$featuredPostsHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
const featuredPostsProvider = FeaturedPostsProvider._();
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef FeaturedPostsRef = AutoDisposeFutureProviderRef<List<SnPost>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class FeaturedPostsProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnPost>>,
|
||||
List<SnPost>,
|
||||
FutureOr<List<SnPost>>
|
||||
>
|
||||
with $FutureModifier<List<SnPost>>, $FutureProvider<List<SnPost>> {
|
||||
const FeaturedPostsProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'featuredPostsProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$featuredPostsHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnPost>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnPost>> create(Ref ref) {
|
||||
return featuredPosts(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$featuredPostsHash() => r'4b7fffb02eac72f5861b02af1b1e5da36b571698';
|
||||
|
||||
@@ -99,7 +99,7 @@ class PostActionableItem extends HookConsumerWidget {
|
||||
[user],
|
||||
);
|
||||
|
||||
final config = ref.watch(appSettingsNotifierProvider);
|
||||
final config = ref.watch(appSettingsProvider);
|
||||
|
||||
final widgetItem = InkWell(
|
||||
borderRadius:
|
||||
|
||||
@@ -35,10 +35,12 @@ final postListNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
PostListNotifier.new,
|
||||
);
|
||||
|
||||
class PostListNotifier
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<SnPost>, PostListQuery>
|
||||
with FamilyAsyncPaginationController<SnPost, PostListQuery> {
|
||||
static const int _pageSize = 20;
|
||||
class PostListNotifier extends AsyncNotifier<List<SnPost>>
|
||||
with AsyncPaginationController<SnPost> {
|
||||
final PostListQuery arg;
|
||||
PostListNotifier(this.arg);
|
||||
|
||||
static const int pageSize = 20;
|
||||
|
||||
@override
|
||||
Future<List<SnPost>> fetch() async {
|
||||
@@ -46,7 +48,7 @@ class PostListNotifier
|
||||
|
||||
final queryParams = {
|
||||
'offset': fetchedCount,
|
||||
'take': _pageSize,
|
||||
'take': pageSize,
|
||||
'replies': arg.includeReplies,
|
||||
'orderDesc': arg.orderDesc,
|
||||
if (arg.shuffle) 'shuffle': arg.shuffle,
|
||||
|
||||
@@ -18,35 +18,29 @@ import 'package:material_symbols_icons/symbols.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:island/widgets/stickers/sticker_picker.dart';
|
||||
import 'package:island/pods/config.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
class ReactionListParams {
|
||||
final String symbol;
|
||||
final String postId;
|
||||
part 'post_reaction_sheet.freezed.dart';
|
||||
|
||||
const ReactionListParams({required this.symbol, required this.postId});
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ReactionListParams &&
|
||||
runtimeType == other.runtimeType &&
|
||||
symbol == other.symbol &&
|
||||
postId == other.postId;
|
||||
|
||||
@override
|
||||
int get hashCode => symbol.hashCode ^ postId.hashCode;
|
||||
@freezed
|
||||
sealed class ReactionListQuery with _$ReactionListQuery {
|
||||
const factory ReactionListQuery({
|
||||
required String symbol,
|
||||
required String postId,
|
||||
}) = _ReactionListQuery;
|
||||
}
|
||||
|
||||
final reactionListNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
.family<ReactionListNotifier, List<SnPostReaction>, ReactionListParams>(
|
||||
.family<ReactionListNotifier, List<SnPostReaction>, ReactionListQuery>(
|
||||
ReactionListNotifier.new,
|
||||
);
|
||||
|
||||
class ReactionListNotifier
|
||||
extends
|
||||
AutoDisposeFamilyAsyncNotifier<List<SnPostReaction>, ReactionListParams>
|
||||
with FamilyAsyncPaginationController<SnPostReaction, ReactionListParams> {
|
||||
static const int _pageSize = 20;
|
||||
class ReactionListNotifier extends AsyncNotifier<List<SnPostReaction>>
|
||||
with AsyncPaginationController<SnPostReaction> {
|
||||
static const int pageSize = 20;
|
||||
|
||||
final ReactionListQuery arg;
|
||||
ReactionListNotifier(this.arg);
|
||||
|
||||
@override
|
||||
Future<List<SnPostReaction>> fetch() async {
|
||||
@@ -57,7 +51,7 @@ class ReactionListNotifier
|
||||
queryParameters: {
|
||||
'symbol': arg.symbol,
|
||||
'offset': fetchedCount,
|
||||
'take': _pageSize,
|
||||
'take': pageSize,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -488,7 +482,7 @@ class ReactionDetailsPopup extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final params = ReactionListParams(symbol: symbol, postId: postId);
|
||||
final params = ReactionListQuery(symbol: symbol, postId: postId);
|
||||
final provider = reactionListNotifierProvider(params);
|
||||
|
||||
final width = math.min(MediaQuery.of(context).size.width * 0.8, 480.0);
|
||||
|
||||
274
lib/widgets/post/post_reaction_sheet.freezed.dart
Normal file
274
lib/widgets/post/post_reaction_sheet.freezed.dart
Normal file
@@ -0,0 +1,274 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'post_reaction_sheet.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$ReactionListQuery {
|
||||
|
||||
String get symbol; String get postId;
|
||||
/// Create a copy of ReactionListQuery
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ReactionListQueryCopyWith<ReactionListQuery> get copyWith => _$ReactionListQueryCopyWithImpl<ReactionListQuery>(this as ReactionListQuery, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ReactionListQuery&&(identical(other.symbol, symbol) || other.symbol == symbol)&&(identical(other.postId, postId) || other.postId == postId));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,symbol,postId);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ReactionListQuery(symbol: $symbol, postId: $postId)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ReactionListQueryCopyWith<$Res> {
|
||||
factory $ReactionListQueryCopyWith(ReactionListQuery value, $Res Function(ReactionListQuery) _then) = _$ReactionListQueryCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String symbol, String postId
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ReactionListQueryCopyWithImpl<$Res>
|
||||
implements $ReactionListQueryCopyWith<$Res> {
|
||||
_$ReactionListQueryCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ReactionListQuery _self;
|
||||
final $Res Function(ReactionListQuery) _then;
|
||||
|
||||
/// Create a copy of ReactionListQuery
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? symbol = null,Object? postId = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
symbol: null == symbol ? _self.symbol : symbol // ignore: cast_nullable_to_non_nullable
|
||||
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [ReactionListQuery].
|
||||
extension ReactionListQueryPatterns on ReactionListQuery {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ReactionListQuery value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ReactionListQuery value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ReactionListQuery value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String symbol, String postId)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery() when $default != null:
|
||||
return $default(_that.symbol,_that.postId);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String symbol, String postId) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery():
|
||||
return $default(_that.symbol,_that.postId);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String symbol, String postId)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ReactionListQuery() when $default != null:
|
||||
return $default(_that.symbol,_that.postId);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _ReactionListQuery implements ReactionListQuery {
|
||||
const _ReactionListQuery({required this.symbol, required this.postId});
|
||||
|
||||
|
||||
@override final String symbol;
|
||||
@override final String postId;
|
||||
|
||||
/// Create a copy of ReactionListQuery
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ReactionListQueryCopyWith<_ReactionListQuery> get copyWith => __$ReactionListQueryCopyWithImpl<_ReactionListQuery>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ReactionListQuery&&(identical(other.symbol, symbol) || other.symbol == symbol)&&(identical(other.postId, postId) || other.postId == postId));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,symbol,postId);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ReactionListQuery(symbol: $symbol, postId: $postId)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ReactionListQueryCopyWith<$Res> implements $ReactionListQueryCopyWith<$Res> {
|
||||
factory _$ReactionListQueryCopyWith(_ReactionListQuery value, $Res Function(_ReactionListQuery) _then) = __$ReactionListQueryCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String symbol, String postId
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ReactionListQueryCopyWithImpl<$Res>
|
||||
implements _$ReactionListQueryCopyWith<$Res> {
|
||||
__$ReactionListQueryCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ReactionListQuery _self;
|
||||
final $Res Function(_ReactionListQuery) _then;
|
||||
|
||||
/// Create a copy of ReactionListQuery
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? symbol = null,Object? postId = null,}) {
|
||||
return _then(_ReactionListQuery(
|
||||
symbol: null == symbol ? _self.symbol : symbol // ignore: cast_nullable_to_non_nullable
|
||||
as String,postId: null == postId ? _self.postId : postId // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -6,13 +6,16 @@ import 'package:island/pods/paging.dart';
|
||||
import 'package:island/widgets/paging/pagination_list.dart';
|
||||
import 'package:island/widgets/post/post_item.dart';
|
||||
|
||||
final postRepliesNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
.family<PostRepliesNotifier, List<SnPost>, String>(PostRepliesNotifier.new);
|
||||
final postRepliesProvider = AsyncNotifierProvider.autoDispose.family(
|
||||
PostRepliesNotifier.new,
|
||||
);
|
||||
|
||||
class PostRepliesNotifier
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<SnPost>, String>
|
||||
with FamilyAsyncPaginationController<SnPost, String> {
|
||||
static const int _pageSize = 20;
|
||||
class PostRepliesNotifier extends AsyncNotifier<List<SnPost>>
|
||||
with AsyncPaginationController<SnPost> {
|
||||
static const int pageSize = 20;
|
||||
|
||||
final String arg;
|
||||
PostRepliesNotifier(this.arg);
|
||||
|
||||
@override
|
||||
Future<List<SnPost>> fetch() async {
|
||||
@@ -20,7 +23,7 @@ class PostRepliesNotifier
|
||||
|
||||
final response = await client.get(
|
||||
'/sphere/posts/$arg/replies',
|
||||
queryParameters: {'offset': fetchedCount, 'take': _pageSize},
|
||||
queryParameters: {'offset': fetchedCount, 'take': pageSize},
|
||||
);
|
||||
|
||||
totalCount = int.parse(response.headers.value('X-Total') ?? '0');
|
||||
@@ -42,7 +45,7 @@ class PostRepliesList extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final provider = postRepliesNotifierProvider(postId);
|
||||
final provider = postRepliesProvider(postId);
|
||||
|
||||
return PaginationList(
|
||||
provider: provider,
|
||||
|
||||
@@ -41,7 +41,7 @@ class PostRepliesSheet extends HookConsumerWidget {
|
||||
child: PostQuickReply(
|
||||
parent: post,
|
||||
onPosted: () {
|
||||
ref.invalidate(postRepliesNotifierProvider(post.id));
|
||||
ref.invalidate(postRepliesProvider(post.id));
|
||||
},
|
||||
onLaunch: () {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
@@ -115,7 +115,7 @@ class PostReplyPreview extends HookConsumerWidget {
|
||||
}, [parent]);
|
||||
|
||||
final featuredReply =
|
||||
isOpenable ? null : ref.watch(PostFeaturedReplyProvider(parent.id));
|
||||
isOpenable ? null : ref.watch(postFeaturedReplyProvider(parent.id));
|
||||
|
||||
final itemWidget =
|
||||
isOpenable
|
||||
|
||||
@@ -6,147 +6,74 @@ part of 'post_shared.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$postFeaturedReplyHash() => r'3f0ac0d51ad21f8754a63dd94109eb8ac4812293';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [postFeaturedReply].
|
||||
@ProviderFor(postFeaturedReply)
|
||||
const postFeaturedReplyProvider = PostFeaturedReplyFamily();
|
||||
const postFeaturedReplyProvider = PostFeaturedReplyFamily._();
|
||||
|
||||
/// See also [postFeaturedReply].
|
||||
class PostFeaturedReplyFamily extends Family<AsyncValue<SnPost?>> {
|
||||
/// See also [postFeaturedReply].
|
||||
const PostFeaturedReplyFamily();
|
||||
final class PostFeaturedReplyProvider
|
||||
extends $FunctionalProvider<AsyncValue<SnPost?>, SnPost?, FutureOr<SnPost?>>
|
||||
with $FutureModifier<SnPost?>, $FutureProvider<SnPost?> {
|
||||
const PostFeaturedReplyProvider._({
|
||||
required PostFeaturedReplyFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'postFeaturedReplyProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [postFeaturedReply].
|
||||
PostFeaturedReplyProvider call(String id) {
|
||||
return PostFeaturedReplyProvider(id);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$postFeaturedReplyHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'postFeaturedReplyProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
PostFeaturedReplyProvider getProviderOverride(
|
||||
covariant PostFeaturedReplyProvider provider,
|
||||
) {
|
||||
return call(provider.id);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<SnPost?> $createElement($ProviderPointer pointer) =>
|
||||
$FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'postFeaturedReplyProvider';
|
||||
}
|
||||
|
||||
/// See also [postFeaturedReply].
|
||||
class PostFeaturedReplyProvider extends AutoDisposeFutureProvider<SnPost?> {
|
||||
/// See also [postFeaturedReply].
|
||||
PostFeaturedReplyProvider(String id)
|
||||
: this._internal(
|
||||
(ref) => postFeaturedReply(ref as PostFeaturedReplyRef, id),
|
||||
from: postFeaturedReplyProvider,
|
||||
name: r'postFeaturedReplyProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$postFeaturedReplyHash,
|
||||
dependencies: PostFeaturedReplyFamily._dependencies,
|
||||
allTransitiveDependencies:
|
||||
PostFeaturedReplyFamily._allTransitiveDependencies,
|
||||
id: id,
|
||||
);
|
||||
|
||||
PostFeaturedReplyProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.id,
|
||||
}) : super.internal();
|
||||
|
||||
final String id;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<SnPost?> Function(PostFeaturedReplyRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: PostFeaturedReplyProvider._internal(
|
||||
(ref) => create(ref as PostFeaturedReplyRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
id: id,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<SnPost?> createElement() {
|
||||
return _PostFeaturedReplyProviderElement(this);
|
||||
FutureOr<SnPost?> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return postFeaturedReply(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is PostFeaturedReplyProvider && other.id == id;
|
||||
return other is PostFeaturedReplyProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, id.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin PostFeaturedReplyRef on AutoDisposeFutureProviderRef<SnPost?> {
|
||||
/// The parameter `id` of this provider.
|
||||
String get id;
|
||||
}
|
||||
String _$postFeaturedReplyHash() => r'3f0ac0d51ad21f8754a63dd94109eb8ac4812293';
|
||||
|
||||
class _PostFeaturedReplyProviderElement
|
||||
extends AutoDisposeFutureProviderElement<SnPost?>
|
||||
with PostFeaturedReplyRef {
|
||||
_PostFeaturedReplyProviderElement(super.provider);
|
||||
final class PostFeaturedReplyFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<SnPost?>, String> {
|
||||
const PostFeaturedReplyFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'postFeaturedReplyProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
PostFeaturedReplyProvider call(String id) =>
|
||||
PostFeaturedReplyProvider._(argument: id, from: this);
|
||||
|
||||
@override
|
||||
String get id => (origin as PostFeaturedReplyProvider).id;
|
||||
String toString() => r'postFeaturedReplyProvider';
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
@@ -38,9 +38,9 @@ class PostShuffleScreen extends HookConsumerWidget {
|
||||
kBottomControlHeight + MediaQuery.of(context).padding.bottom,
|
||||
),
|
||||
child: Builder(
|
||||
key: ValueKey(postListState.valueOrNull?.length ?? 0),
|
||||
key: ValueKey(postListState.value?.length ?? 0),
|
||||
builder: (context) {
|
||||
final items = postListState.valueOrNull ?? [];
|
||||
final items = postListState.value ?? [];
|
||||
if (items.isNotEmpty) {
|
||||
return CardSwiper(
|
||||
controller: cardSwiperController,
|
||||
|
||||
@@ -11,9 +11,11 @@ import 'package:styled_widget/styled_widget.dart';
|
||||
final realmListNotifierProvider = AsyncNotifierProvider.autoDispose
|
||||
.family<RealmListNotifier, List<SnRealm>, String?>(RealmListNotifier.new);
|
||||
|
||||
class RealmListNotifier
|
||||
extends AutoDisposeFamilyAsyncNotifier<List<SnRealm>, String?>
|
||||
with FamilyAsyncPaginationController<SnRealm, String?> {
|
||||
class RealmListNotifier extends AsyncNotifier<List<SnRealm>>
|
||||
with AsyncPaginationController<SnRealm> {
|
||||
String? arg;
|
||||
RealmListNotifier(this.arg);
|
||||
|
||||
static const int _pageSize = 20;
|
||||
|
||||
@override
|
||||
@@ -61,9 +63,9 @@ class SliverRealmList extends HookConsumerWidget {
|
||||
).center(),
|
||||
),
|
||||
if (index <
|
||||
(ref.read(provider).valueOrNull?.length ?? 0) -
|
||||
(ref.read(provider).value?.length ?? 0) -
|
||||
1) // Add gap except for last item? Actually PaginationList handles loading indicator which might look like last item.
|
||||
// Wait, ref.read(provider).valueOrNull?.length might change.
|
||||
// Wait, ref.read(provider).value?.length might change.
|
||||
// Simpler to just add bottom padding to all, or Gap.
|
||||
const Gap(8),
|
||||
],
|
||||
|
||||
@@ -664,7 +664,7 @@ class _ChatRoomsList extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final chatRooms = ref.watch(chatRoomJoinedNotifierProvider);
|
||||
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
||||
|
||||
return chatRooms.when(
|
||||
data: (rooms) {
|
||||
|
||||
@@ -463,7 +463,6 @@ Future<void> showStickerPickerPopover(
|
||||
width: math.min(480, MediaQuery.of(context).size.width * 0.9),
|
||||
height: 480,
|
||||
child: ProviderScope(
|
||||
parent: ProviderScope.containerOf(context),
|
||||
child: StickerPicker(
|
||||
onPick: (ph) {
|
||||
onPick(ph);
|
||||
|
||||
@@ -6,27 +6,53 @@ part of 'sticker_picker.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$myStickerPacksHash() => r'1e19832e8ab1cb139ad18aebfa5aebdf4fdea499';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
/// Fetch user-added sticker packs (with stickers) from API:
|
||||
/// GET /sphere/stickers/me
|
||||
|
||||
@ProviderFor(myStickerPacks)
|
||||
const myStickerPacksProvider = MyStickerPacksProvider._();
|
||||
|
||||
/// Fetch user-added sticker packs (with stickers) from API:
|
||||
/// GET /sphere/stickers/me
|
||||
///
|
||||
/// Copied from [myStickerPacks].
|
||||
@ProviderFor(myStickerPacks)
|
||||
final myStickerPacksProvider =
|
||||
AutoDisposeFutureProvider<List<SnStickerPack>>.internal(
|
||||
myStickerPacks,
|
||||
name: r'myStickerPacksProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$myStickerPacksHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
typedef MyStickerPacksRef = AutoDisposeFutureProviderRef<List<SnStickerPack>>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
final class MyStickerPacksProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<List<SnStickerPack>>,
|
||||
List<SnStickerPack>,
|
||||
FutureOr<List<SnStickerPack>>
|
||||
>
|
||||
with
|
||||
$FutureModifier<List<SnStickerPack>>,
|
||||
$FutureProvider<List<SnStickerPack>> {
|
||||
/// Fetch user-added sticker packs (with stickers) from API:
|
||||
/// GET /sphere/stickers/me
|
||||
const MyStickerPacksProvider._()
|
||||
: super(
|
||||
from: null,
|
||||
argument: null,
|
||||
retry: null,
|
||||
name: r'myStickerPacksProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$myStickerPacksHash();
|
||||
|
||||
@$internal
|
||||
@override
|
||||
$FutureProviderElement<List<SnStickerPack>> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
FutureOr<List<SnStickerPack>> create(Ref ref) {
|
||||
return myStickerPacks(ref);
|
||||
}
|
||||
}
|
||||
|
||||
String _$myStickerPacksHash() => r'1e19832e8ab1cb139ad18aebfa5aebdf4fdea499';
|
||||
|
||||
@@ -13,15 +13,15 @@ final thoughtSequenceListNotifierProvider = AsyncNotifierProvider.autoDispose<
|
||||
>(ThoughtSequenceListNotifier.new);
|
||||
|
||||
class ThoughtSequenceListNotifier
|
||||
extends AutoDisposeAsyncNotifier<List<SnThinkingSequence>>
|
||||
with AutoDisposeAsyncPaginationController<SnThinkingSequence> {
|
||||
static const int _pageSize = 20;
|
||||
extends AsyncNotifier<List<SnThinkingSequence>>
|
||||
with AsyncPaginationController<SnThinkingSequence> {
|
||||
static const int pageSize = 20;
|
||||
|
||||
@override
|
||||
Future<List<SnThinkingSequence>> fetch() async {
|
||||
final client = ref.read(apiClientProvider);
|
||||
|
||||
final queryParams = {'offset': fetchedCount, 'take': _pageSize};
|
||||
final queryParams = {'offset': fetchedCount, 'take': pageSize};
|
||||
|
||||
final response = await client.get(
|
||||
'/insight/thought/sequences',
|
||||
|
||||
@@ -11,7 +11,7 @@ class TourTriggerWidget extends HookConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final tourStatus = ref.watch(tourStatusNotifierProvider.notifier);
|
||||
final tourStatus = ref.watch(tourStatusProvider.notifier);
|
||||
|
||||
useEffect(() {
|
||||
Future(() async {
|
||||
|
||||
@@ -6,146 +6,80 @@ part of 'fund_envelope.dart';
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$walletFundHash() => r'521fa280708e71266f8164268ba11f135f4ba810';
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint, type=warning
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
_SystemHash._();
|
||||
|
||||
static int combine(int hash, int value) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + value);
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
|
||||
return hash ^ (hash >> 6);
|
||||
}
|
||||
|
||||
static int finish(int hash) {
|
||||
// ignore: parameter_assignments
|
||||
hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
|
||||
// ignore: parameter_assignments
|
||||
hash = hash ^ (hash >> 11);
|
||||
return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
|
||||
}
|
||||
}
|
||||
|
||||
/// See also [walletFund].
|
||||
@ProviderFor(walletFund)
|
||||
const walletFundProvider = WalletFundFamily();
|
||||
const walletFundProvider = WalletFundFamily._();
|
||||
|
||||
/// See also [walletFund].
|
||||
class WalletFundFamily extends Family<AsyncValue<SnWalletFund>> {
|
||||
/// See also [walletFund].
|
||||
const WalletFundFamily();
|
||||
final class WalletFundProvider
|
||||
extends
|
||||
$FunctionalProvider<
|
||||
AsyncValue<SnWalletFund>,
|
||||
SnWalletFund,
|
||||
FutureOr<SnWalletFund>
|
||||
>
|
||||
with $FutureModifier<SnWalletFund>, $FutureProvider<SnWalletFund> {
|
||||
const WalletFundProvider._({
|
||||
required WalletFundFamily super.from,
|
||||
required String super.argument,
|
||||
}) : super(
|
||||
retry: null,
|
||||
name: r'walletFundProvider',
|
||||
isAutoDispose: true,
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
/// See also [walletFund].
|
||||
WalletFundProvider call(String fundId) {
|
||||
return WalletFundProvider(fundId);
|
||||
@override
|
||||
String debugGetCreateSourceHash() => _$walletFundHash();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return r'walletFundProvider'
|
||||
''
|
||||
'($argument)';
|
||||
}
|
||||
|
||||
@$internal
|
||||
@override
|
||||
WalletFundProvider getProviderOverride(
|
||||
covariant WalletFundProvider provider,
|
||||
) {
|
||||
return call(provider.fundId);
|
||||
}
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _dependencies = null;
|
||||
$FutureProviderElement<SnWalletFund> $createElement(
|
||||
$ProviderPointer pointer,
|
||||
) => $FutureProviderElement(pointer);
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get dependencies => _dependencies;
|
||||
|
||||
static const Iterable<ProviderOrFamily>? _allTransitiveDependencies = null;
|
||||
|
||||
@override
|
||||
Iterable<ProviderOrFamily>? get allTransitiveDependencies =>
|
||||
_allTransitiveDependencies;
|
||||
|
||||
@override
|
||||
String? get name => r'walletFundProvider';
|
||||
}
|
||||
|
||||
/// See also [walletFund].
|
||||
class WalletFundProvider extends AutoDisposeFutureProvider<SnWalletFund> {
|
||||
/// See also [walletFund].
|
||||
WalletFundProvider(String fundId)
|
||||
: this._internal(
|
||||
(ref) => walletFund(ref as WalletFundRef, fundId),
|
||||
from: walletFundProvider,
|
||||
name: r'walletFundProvider',
|
||||
debugGetCreateSourceHash:
|
||||
const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$walletFundHash,
|
||||
dependencies: WalletFundFamily._dependencies,
|
||||
allTransitiveDependencies: WalletFundFamily._allTransitiveDependencies,
|
||||
fundId: fundId,
|
||||
);
|
||||
|
||||
WalletFundProvider._internal(
|
||||
super._createNotifier, {
|
||||
required super.name,
|
||||
required super.dependencies,
|
||||
required super.allTransitiveDependencies,
|
||||
required super.debugGetCreateSourceHash,
|
||||
required super.from,
|
||||
required this.fundId,
|
||||
}) : super.internal();
|
||||
|
||||
final String fundId;
|
||||
|
||||
@override
|
||||
Override overrideWith(
|
||||
FutureOr<SnWalletFund> Function(WalletFundRef provider) create,
|
||||
) {
|
||||
return ProviderOverride(
|
||||
origin: this,
|
||||
override: WalletFundProvider._internal(
|
||||
(ref) => create(ref as WalletFundRef),
|
||||
from: from,
|
||||
name: null,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
debugGetCreateSourceHash: null,
|
||||
fundId: fundId,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
AutoDisposeFutureProviderElement<SnWalletFund> createElement() {
|
||||
return _WalletFundProviderElement(this);
|
||||
FutureOr<SnWalletFund> create(Ref ref) {
|
||||
final argument = this.argument as String;
|
||||
return walletFund(ref, argument);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is WalletFundProvider && other.fundId == fundId;
|
||||
return other is WalletFundProvider && other.argument == argument;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
var hash = _SystemHash.combine(0, runtimeType.hashCode);
|
||||
hash = _SystemHash.combine(hash, fundId.hashCode);
|
||||
|
||||
return _SystemHash.finish(hash);
|
||||
return argument.hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated('Will be removed in 3.0. Use Ref instead')
|
||||
// ignore: unused_element
|
||||
mixin WalletFundRef on AutoDisposeFutureProviderRef<SnWalletFund> {
|
||||
/// The parameter `fundId` of this provider.
|
||||
String get fundId;
|
||||
}
|
||||
String _$walletFundHash() => r'521fa280708e71266f8164268ba11f135f4ba810';
|
||||
|
||||
class _WalletFundProviderElement
|
||||
extends AutoDisposeFutureProviderElement<SnWalletFund>
|
||||
with WalletFundRef {
|
||||
_WalletFundProviderElement(super.provider);
|
||||
final class WalletFundFamily extends $Family
|
||||
with $FunctionalFamilyOverride<FutureOr<SnWalletFund>, String> {
|
||||
const WalletFundFamily._()
|
||||
: super(
|
||||
retry: null,
|
||||
name: r'walletFundProvider',
|
||||
dependencies: null,
|
||||
$allTransitiveDependencies: null,
|
||||
isAutoDispose: true,
|
||||
);
|
||||
|
||||
WalletFundProvider call(String fundId) =>
|
||||
WalletFundProvider._(argument: fundId, from: this);
|
||||
|
||||
@override
|
||||
String get fundId => (origin as WalletFundProvider).fundId;
|
||||
String toString() => r'walletFundProvider';
|
||||
}
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package
|
||||
|
||||
Reference in New Issue
Block a user