mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
copyWith should create new instances of collections
This commit is contained in:
parent
b5685d1d65
commit
2bddfcbf8c
4 changed files with 8 additions and 6 deletions
|
@ -36,7 +36,7 @@ class Account with EquatableMixin {
|
|||
address ?? this.address,
|
||||
username ?? this.username,
|
||||
password ?? this.password,
|
||||
roots ?? _roots,
|
||||
roots ?? List.of(_roots),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ class ListSharingBlocSuccess extends ListSharingBlocState {
|
|||
}) =>
|
||||
ListSharingBlocSuccess(
|
||||
account ?? this.account,
|
||||
items ?? this.items,
|
||||
items ?? List.of(this.items),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ class ListSharingBlocFailure extends ListSharingBlocState {
|
|||
}) =>
|
||||
ListSharingBlocFailure(
|
||||
account ?? this.account,
|
||||
items ?? this.items,
|
||||
items ?? List.of(this.items),
|
||||
exception ?? this.exception,
|
||||
);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import 'package:nc_photos/entity/file/data_source.dart';
|
|||
import 'package:nc_photos/exception.dart';
|
||||
import 'package:nc_photos/int_util.dart' as int_util;
|
||||
import 'package:nc_photos/iterable_extension.dart';
|
||||
import 'package:nc_photos/object_extension.dart';
|
||||
import 'package:nc_photos/or_null.dart';
|
||||
import 'package:nc_photos/remote_storage_util.dart' as remote_storage_util;
|
||||
import 'package:nc_photos/type.dart';
|
||||
|
@ -154,7 +155,8 @@ class Album with EquatableMixin {
|
|||
provider: provider ?? this.provider,
|
||||
coverProvider: coverProvider ?? this.coverProvider,
|
||||
sortProvider: sortProvider ?? this.sortProvider,
|
||||
shares: shares == null ? this.shares : shares.obj,
|
||||
shares:
|
||||
shares == null ? this.shares?.run((obj) => List.of(obj)) : shares.obj,
|
||||
albumFile: albumFile == null ? this.albumFile : albumFile.obj,
|
||||
savedVersion: savedVersion,
|
||||
);
|
||||
|
|
|
@ -141,7 +141,7 @@ class AlbumStaticProvider extends AlbumProviderBase {
|
|||
return AlbumStaticProvider(
|
||||
latestItemTime:
|
||||
latestItemTime == null ? this.latestItemTime : latestItemTime.obj,
|
||||
items: items ?? this.items,
|
||||
items: items ?? List.of(this.items),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ class AlbumDirProvider extends AlbumDynamicProvider {
|
|||
return AlbumDirProvider(
|
||||
latestItemTime:
|
||||
latestItemTime == null ? this.latestItemTime : latestItemTime.obj,
|
||||
dirs: dirs ?? this.dirs,
|
||||
dirs: dirs ?? List.of(this.dirs),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue