mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-24 16:04:43 +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,
|
address ?? this.address,
|
||||||
username ?? this.username,
|
username ?? this.username,
|
||||||
password ?? this.password,
|
password ?? this.password,
|
||||||
roots ?? _roots,
|
roots ?? List.of(_roots),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ class ListSharingBlocSuccess extends ListSharingBlocState {
|
||||||
}) =>
|
}) =>
|
||||||
ListSharingBlocSuccess(
|
ListSharingBlocSuccess(
|
||||||
account ?? this.account,
|
account ?? this.account,
|
||||||
items ?? this.items,
|
items ?? List.of(this.items),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ class ListSharingBlocFailure extends ListSharingBlocState {
|
||||||
}) =>
|
}) =>
|
||||||
ListSharingBlocFailure(
|
ListSharingBlocFailure(
|
||||||
account ?? this.account,
|
account ?? this.account,
|
||||||
items ?? this.items,
|
items ?? List.of(this.items),
|
||||||
exception ?? this.exception,
|
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/exception.dart';
|
||||||
import 'package:nc_photos/int_util.dart' as int_util;
|
import 'package:nc_photos/int_util.dart' as int_util;
|
||||||
import 'package:nc_photos/iterable_extension.dart';
|
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/or_null.dart';
|
||||||
import 'package:nc_photos/remote_storage_util.dart' as remote_storage_util;
|
import 'package:nc_photos/remote_storage_util.dart' as remote_storage_util;
|
||||||
import 'package:nc_photos/type.dart';
|
import 'package:nc_photos/type.dart';
|
||||||
|
@ -154,7 +155,8 @@ class Album with EquatableMixin {
|
||||||
provider: provider ?? this.provider,
|
provider: provider ?? this.provider,
|
||||||
coverProvider: coverProvider ?? this.coverProvider,
|
coverProvider: coverProvider ?? this.coverProvider,
|
||||||
sortProvider: sortProvider ?? this.sortProvider,
|
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,
|
albumFile: albumFile == null ? this.albumFile : albumFile.obj,
|
||||||
savedVersion: savedVersion,
|
savedVersion: savedVersion,
|
||||||
);
|
);
|
||||||
|
|
|
@ -141,7 +141,7 @@ class AlbumStaticProvider extends AlbumProviderBase {
|
||||||
return AlbumStaticProvider(
|
return AlbumStaticProvider(
|
||||||
latestItemTime:
|
latestItemTime:
|
||||||
latestItemTime == null ? this.latestItemTime : latestItemTime.obj,
|
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(
|
return AlbumDirProvider(
|
||||||
latestItemTime:
|
latestItemTime:
|
||||||
latestItemTime == null ? this.latestItemTime : latestItemTime.obj,
|
latestItemTime == null ? this.latestItemTime : latestItemTime.obj,
|
||||||
dirs: dirs ?? this.dirs,
|
dirs: dirs ?? List.of(this.dirs),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue