Skip to content

Commit

Permalink
used named properties for record type
Browse files Browse the repository at this point in the history
  • Loading branch information
codinesh committed Dec 15, 2023
1 parent 116504a commit 51b706a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions packages/app_center/lib/src/manage/manage_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class ManageModel extends ChangeNotifier {

List<Snap>? _installedSnaps;
List<String>? _refreshableSnapNames;
Map<String, (Snap snap, SnapdChange snapdChange)> snapsWithInprogressChange =
{};
Map<String, ({Snap snap, SnapdChange snapdChange})>
snapsWithInprogressChange = {};

bool _isRefreshable(Snap snap) => updatesModel.hasUpdate(snap.name);
Iterable<Snap> get refreshableSnaps =>
Expand Down Expand Up @@ -70,7 +70,8 @@ class ManageModel extends ChangeNotifier {
if (change.status == 'Done') {
snapsWithInprogressChange.remove(snap.name);
} else {
snapsWithInprogressChange.putIfAbsent(snap.name, () => (snap, change));
snapsWithInprogressChange.putIfAbsent(
snap.name, () => (snap: snap, snapdChange: change));
}

await _getInstalledSnaps();
Expand Down
4 changes: 2 additions & 2 deletions packages/app_center/lib/src/manage/manage_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class _ManageView extends ConsumerWidget {
.elementAt(index)]!;

return _ManageSnapTile(
snapdChangeId: snapDetails.$2.id,
snap: snapDetails.$1,
snapdChangeId: snapDetails.snapdChange.id,
snap: snapDetails.snap,
position: index ==
(manageModel.snapsWithInprogressChange.length - 1)
? index == 0
Expand Down

0 comments on commit 51b706a

Please sign in to comment.