chore:cleanup-packages breaking: remove isar (#474)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2025-08-24 21:16:51 +02:00 committed by GitHub
parent ab6182f69d
commit 6357b9843c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 31400 additions and 25673 deletions

View file

@ -46,7 +46,7 @@ enum LibraryViewType {
}
@Freezed(fromJson: false, toJson: false, copyWith: true)
class LibraryScreenModel with _$LibraryScreenModel {
abstract class LibraryScreenModel with _$LibraryScreenModel {
factory LibraryScreenModel({
@Default([]) List<ViewModel> views,
ViewModel? selectedViewModel,

View file

@ -1,5 +1,5 @@
// coverage:ignore-file
// 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
@ -9,101 +9,37 @@ part of 'library_screen_provider.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$LibraryScreenModel {
List<ViewModel> get views => throw _privateConstructorUsedError;
ViewModel? get selectedViewModel => throw _privateConstructorUsedError;
Set<LibraryViewType> get viewType => throw _privateConstructorUsedError;
List<RecommendedModel> get recommendations =>
throw _privateConstructorUsedError;
List<RecommendedModel> get genres => throw _privateConstructorUsedError;
List<ItemBaseModel> get favourites => throw _privateConstructorUsedError;
List<ViewModel> get views;
ViewModel? get selectedViewModel;
Set<LibraryViewType> get viewType;
List<RecommendedModel> get recommendations;
List<RecommendedModel> get genres;
List<ItemBaseModel> get favourites;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LibraryScreenModelCopyWith<LibraryScreenModel> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $LibraryScreenModelCopyWith<$Res> {
factory $LibraryScreenModelCopyWith(
LibraryScreenModel value, $Res Function(LibraryScreenModel) then) =
_$LibraryScreenModelCopyWithImpl<$Res, LibraryScreenModel>;
@useResult
$Res call(
{List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites});
}
/// @nodoc
class _$LibraryScreenModelCopyWithImpl<$Res, $Val extends LibraryScreenModel>
implements $LibraryScreenModelCopyWith<$Res> {
_$LibraryScreenModelCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
$LibraryScreenModelCopyWith<LibraryScreenModel> get copyWith =>
_$LibraryScreenModelCopyWithImpl<LibraryScreenModel>(
this as LibraryScreenModel, _$identity);
@override
$Res call({
Object? views = null,
Object? selectedViewModel = freezed,
Object? viewType = null,
Object? recommendations = null,
Object? genres = null,
Object? favourites = null,
}) {
return _then(_value.copyWith(
views: null == views
? _value.views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _value.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _value.viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _value.recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _value.genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _value.favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
) as $Val);
String toString() {
return 'LibraryScreenModel(views: $views, selectedViewModel: $selectedViewModel, viewType: $viewType, recommendations: $recommendations, genres: $genres, favourites: $favourites)';
}
}
/// @nodoc
abstract class _$$LibraryScreenModelImplCopyWith<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
factory _$$LibraryScreenModelImplCopyWith(_$LibraryScreenModelImpl value,
$Res Function(_$LibraryScreenModelImpl) then) =
__$$LibraryScreenModelImplCopyWithImpl<$Res>;
@override
abstract mixin class $LibraryScreenModelCopyWith<$Res> {
factory $LibraryScreenModelCopyWith(
LibraryScreenModel value, $Res Function(LibraryScreenModel) _then) =
_$LibraryScreenModelCopyWithImpl;
@useResult
$Res call(
{List<ViewModel> views,
@ -115,12 +51,12 @@ abstract class _$$LibraryScreenModelImplCopyWith<$Res>
}
/// @nodoc
class __$$LibraryScreenModelImplCopyWithImpl<$Res>
extends _$LibraryScreenModelCopyWithImpl<$Res, _$LibraryScreenModelImpl>
implements _$$LibraryScreenModelImplCopyWith<$Res> {
__$$LibraryScreenModelImplCopyWithImpl(_$LibraryScreenModelImpl _value,
$Res Function(_$LibraryScreenModelImpl) _then)
: super(_value, _then);
class _$LibraryScreenModelCopyWithImpl<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
_$LibraryScreenModelCopyWithImpl(this._self, this._then);
final LibraryScreenModel _self;
final $Res Function(LibraryScreenModel) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@ -134,39 +70,220 @@ class __$$LibraryScreenModelImplCopyWithImpl<$Res>
Object? genres = null,
Object? favourites = null,
}) {
return _then(_$LibraryScreenModelImpl(
return _then(_self.copyWith(
views: null == views
? _value._views
? _self.views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _value.selectedViewModel
? _self.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _value._viewType
? _self.viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _value._recommendations
? _self.recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _value._genres
? _self.genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _value._favourites
? _self.favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
));
}
}
/// Adds pattern-matching-related methods to [LibraryScreenModel].
extension LibraryScreenModelPatterns on LibraryScreenModel {
/// 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(_LibraryScreenModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() 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(_LibraryScreenModel value) $default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel():
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(_LibraryScreenModel value)? $default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() 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(
List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() when $default != null:
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
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(
List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)
$default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel():
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
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(
List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites)?
$default,
) {
final _that = this;
switch (_that) {
case _LibraryScreenModel() when $default != null:
return $default(_that.views, _that.selectedViewModel, _that.viewType,
_that.recommendations, _that.genres, _that.favourites);
case _:
return null;
}
}
}
/// @nodoc
class _$LibraryScreenModelImpl implements _LibraryScreenModel {
_$LibraryScreenModelImpl(
class _LibraryScreenModel implements LibraryScreenModel {
_LibraryScreenModel(
{final List<ViewModel> views = const [],
this.selectedViewModel,
final Set<LibraryViewType> viewType = const {
@ -229,47 +346,84 @@ class _$LibraryScreenModelImpl implements _LibraryScreenModel {
return EqualUnmodifiableListView(_favourites);
}
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$LibraryScreenModelCopyWith<_LibraryScreenModel> get copyWith =>
__$LibraryScreenModelCopyWithImpl<_LibraryScreenModel>(this, _$identity);
@override
String toString() {
return 'LibraryScreenModel(views: $views, selectedViewModel: $selectedViewModel, viewType: $viewType, recommendations: $recommendations, genres: $genres, favourites: $favourites)';
}
}
/// @nodoc
abstract mixin class _$LibraryScreenModelCopyWith<$Res>
implements $LibraryScreenModelCopyWith<$Res> {
factory _$LibraryScreenModelCopyWith(
_LibraryScreenModel value, $Res Function(_LibraryScreenModel) _then) =
__$LibraryScreenModelCopyWithImpl;
@override
@useResult
$Res call(
{List<ViewModel> views,
ViewModel? selectedViewModel,
Set<LibraryViewType> viewType,
List<RecommendedModel> recommendations,
List<RecommendedModel> genres,
List<ItemBaseModel> favourites});
}
/// @nodoc
class __$LibraryScreenModelCopyWithImpl<$Res>
implements _$LibraryScreenModelCopyWith<$Res> {
__$LibraryScreenModelCopyWithImpl(this._self, this._then);
final _LibraryScreenModel _self;
final $Res Function(_LibraryScreenModel) _then;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LibraryScreenModelImplCopyWith<_$LibraryScreenModelImpl> get copyWith =>
__$$LibraryScreenModelImplCopyWithImpl<_$LibraryScreenModelImpl>(
this, _$identity);
$Res call({
Object? views = null,
Object? selectedViewModel = freezed,
Object? viewType = null,
Object? recommendations = null,
Object? genres = null,
Object? favourites = null,
}) {
return _then(_LibraryScreenModel(
views: null == views
? _self._views
: views // ignore: cast_nullable_to_non_nullable
as List<ViewModel>,
selectedViewModel: freezed == selectedViewModel
? _self.selectedViewModel
: selectedViewModel // ignore: cast_nullable_to_non_nullable
as ViewModel?,
viewType: null == viewType
? _self._viewType
: viewType // ignore: cast_nullable_to_non_nullable
as Set<LibraryViewType>,
recommendations: null == recommendations
? _self._recommendations
: recommendations // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
genres: null == genres
? _self._genres
: genres // ignore: cast_nullable_to_non_nullable
as List<RecommendedModel>,
favourites: null == favourites
? _self._favourites
: favourites // ignore: cast_nullable_to_non_nullable
as List<ItemBaseModel>,
));
}
}
abstract class _LibraryScreenModel implements LibraryScreenModel {
factory _LibraryScreenModel(
{final List<ViewModel> views,
final ViewModel? selectedViewModel,
final Set<LibraryViewType> viewType,
final List<RecommendedModel> recommendations,
final List<RecommendedModel> genres,
final List<ItemBaseModel> favourites}) = _$LibraryScreenModelImpl;
@override
List<ViewModel> get views;
@override
ViewModel? get selectedViewModel;
@override
Set<LibraryViewType> get viewType;
@override
List<RecommendedModel> get recommendations;
@override
List<RecommendedModel> get genres;
@override
List<ItemBaseModel> get favourites;
/// Create a copy of LibraryScreenModel
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LibraryScreenModelImplCopyWith<_$LibraryScreenModelImpl> get copyWith =>
throw _privateConstructorUsedError;
}
// dart format on

View file

@ -52,7 +52,7 @@ class SessionInfo extends _$SessionInfo {
}
@freezed
class SessionInfoModel with _$SessionInfoModel {
abstract class SessionInfoModel with _$SessionInfoModel {
const SessionInfoModel._();
factory SessionInfoModel({

View file

@ -1,5 +1,5 @@
// coverage:ignore-file
// 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
@ -9,61 +9,206 @@ part of 'session_info_provider.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
SessionInfoModel _$SessionInfoModelFromJson(Map<String, dynamic> json) {
return _SessionInfoModel.fromJson(json);
}
/// @nodoc
mixin _$SessionInfoModel {
String? get playbackModel => throw _privateConstructorUsedError;
TranscodingInfo? get transCodeInfo => throw _privateConstructorUsedError;
String? get playbackModel;
TranscodingInfo? get transCodeInfo;
/// Serializes this SessionInfoModel to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Map<String, dynamic> toJson();
@override
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
}
/// Adds pattern-matching-related methods to [SessionInfoModel].
extension SessionInfoModelPatterns on SessionInfoModel {
/// 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(_SessionInfoModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SessionInfoModel() 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(_SessionInfoModel value) $default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel():
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(_SessionInfoModel value)? $default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel() 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? playbackModel, TranscodingInfo? transCodeInfo)?
$default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _SessionInfoModel() when $default != null:
return $default(_that.playbackModel, _that.transCodeInfo);
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? playbackModel, TranscodingInfo? transCodeInfo)
$default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel():
return $default(_that.playbackModel, _that.transCodeInfo);
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? playbackModel, TranscodingInfo? transCodeInfo)?
$default,
) {
final _that = this;
switch (_that) {
case _SessionInfoModel() when $default != null:
return $default(_that.playbackModel, _that.transCodeInfo);
case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _$SessionInfoModelImpl extends _SessionInfoModel {
_$SessionInfoModelImpl({this.playbackModel, this.transCodeInfo}) : super._();
factory _$SessionInfoModelImpl.fromJson(Map<String, dynamic> json) =>
_$$SessionInfoModelImplFromJson(json);
class _SessionInfoModel extends SessionInfoModel {
_SessionInfoModel({this.playbackModel, this.transCodeInfo}) : super._();
factory _SessionInfoModel.fromJson(Map<String, dynamic> json) =>
_$SessionInfoModelFromJson(json);
@override
final String? playbackModel;
@override
final TranscodingInfo? transCodeInfo;
@override
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
@override
Map<String, dynamic> toJson() {
return _$$SessionInfoModelImplToJson(
return _$SessionInfoModelToJson(
this,
);
}
}
abstract class _SessionInfoModel extends SessionInfoModel {
factory _SessionInfoModel(
{final String? playbackModel,
final TranscodingInfo? transCodeInfo}) = _$SessionInfoModelImpl;
_SessionInfoModel._() : super._();
factory _SessionInfoModel.fromJson(Map<String, dynamic> json) =
_$SessionInfoModelImpl.fromJson;
@override
String? get playbackModel;
@override
TranscodingInfo? get transCodeInfo;
String toString() {
return 'SessionInfoModel(playbackModel: $playbackModel, transCodeInfo: $transCodeInfo)';
}
}
// dart format on

View file

@ -6,9 +6,8 @@ part of 'session_info_provider.dart';
// JsonSerializableGenerator
// **************************************************************************
_$SessionInfoModelImpl _$$SessionInfoModelImplFromJson(
Map<String, dynamic> json) =>
_$SessionInfoModelImpl(
_SessionInfoModel _$SessionInfoModelFromJson(Map<String, dynamic> json) =>
_SessionInfoModel(
playbackModel: json['playbackModel'] as String?,
transCodeInfo: json['transCodeInfo'] == null
? null
@ -16,8 +15,7 @@ _$SessionInfoModelImpl _$$SessionInfoModelImplFromJson(
json['transCodeInfo'] as Map<String, dynamic>),
);
Map<String, dynamic> _$$SessionInfoModelImplToJson(
_$SessionInfoModelImpl instance) =>
Map<String, dynamic> _$SessionInfoModelToJson(_SessionInfoModel instance) =>
<String, dynamic>{
'playbackModel': instance.playbackModel,
'transCodeInfo': instance.transCodeInfo,

View file

@ -41,7 +41,6 @@ import 'package:fladder/providers/user_provider.dart';
import 'package:fladder/screens/shared/fladder_snackbar.dart';
import 'package:fladder/util/duration_extensions.dart';
import 'package:fladder/util/localization_helper.dart';
import 'package:fladder/util/migration/isar_drift_migration.dart';
final syncProvider = StateNotifierProvider<SyncNotifier, SyncSettingsModel>((ref) => throw UnimplementedError());
@ -67,11 +66,6 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
updateSyncStates();
}
void migrateFromIsar() async {
await isarMigration(ref, _db, mainDirectory.path);
_initializeQueryStream();
}
Future<void> updateSyncStates() async {
final lastState =
(await _db.getAllItems.get()).where((item) => item.unSyncedData && item.userData != null).toList();
@ -114,7 +108,7 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
updateSyncStates();
}
});
migrateFromIsar();
_initializeQueryStream();
}
void _initializeQueryStream({String? id}) async {

View file

@ -1,13 +0,0 @@
import 'dart:io';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:isar/isar.dart';
class AbstractSyncNotifier {
final Ref ref;
final Isar? isar;
final Directory mobileDirectory;
final String subPath = "Synced";
AbstractSyncNotifier(this.ref, this.isar, this.mobileDirectory);
}

View file

@ -77,7 +77,7 @@ class Update extends _$Update {
}
@Freezed(toJson: false, fromJson: false)
class UpdatesModel with _$UpdatesModel {
abstract class UpdatesModel with _$UpdatesModel {
const UpdatesModel._();
factory UpdatesModel({

View file

@ -1,5 +1,5 @@
// coverage:ignore-file
// 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
@ -9,20 +9,187 @@ part of 'update_provider.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
/// @nodoc
mixin _$UpdatesModel {
List<ReleaseInfo> get lastRelease => throw _privateConstructorUsedError;
mixin _$UpdatesModel implements DiagnosticableTreeMixin {
List<ReleaseInfo> get lastRelease;
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
properties
..add(DiagnosticsProperty('type', 'UpdatesModel'))
..add(DiagnosticsProperty('lastRelease', lastRelease));
}
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
}
/// Adds pattern-matching-related methods to [UpdatesModel].
extension UpdatesModelPatterns on UpdatesModel {
/// 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(_UpdatesModel value)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _UpdatesModel() 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(_UpdatesModel value) $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel():
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(_UpdatesModel value)? $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel() 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(List<ReleaseInfo> lastRelease)? $default, {
required TResult orElse(),
}) {
final _that = this;
switch (_that) {
case _UpdatesModel() when $default != null:
return $default(_that.lastRelease);
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(List<ReleaseInfo> lastRelease) $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel():
return $default(_that.lastRelease);
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(List<ReleaseInfo> lastRelease)? $default,
) {
final _that = this;
switch (_that) {
case _UpdatesModel() when $default != null:
return $default(_that.lastRelease);
case _:
return null;
}
}
}
/// @nodoc
class _$UpdatesModelImpl extends _UpdatesModel with DiagnosticableTreeMixin {
_$UpdatesModelImpl({final List<ReleaseInfo> lastRelease = const []})
class _UpdatesModel extends UpdatesModel with DiagnosticableTreeMixin {
_UpdatesModel({final List<ReleaseInfo> lastRelease = const []})
: _lastRelease = lastRelease,
super._();
@ -35,25 +202,17 @@ class _$UpdatesModelImpl extends _UpdatesModel with DiagnosticableTreeMixin {
return EqualUnmodifiableListView(_lastRelease);
}
@override
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'UpdatesModel'))
..add(DiagnosticsProperty('lastRelease', lastRelease));
}
}
abstract class _UpdatesModel extends UpdatesModel {
factory _UpdatesModel({final List<ReleaseInfo> lastRelease}) =
_$UpdatesModelImpl;
_UpdatesModel._() : super._();
@override
List<ReleaseInfo> get lastRelease;
String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
return 'UpdatesModel(lastRelease: $lastRelease)';
}
}
// dart format on