File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -276,11 +276,23 @@ class AppsPageState extends State<AppsPage> {
276276 );
277277 } else if (settingsProvider.sortColumn ==
278278 SortColumnSettings .releaseDate) {
279- result =
280- (a.app.releaseDate)? .compareTo (
281- b.app.releaseDate ?? DateTime .fromMicrosecondsSinceEpoch (0 ),
282- ) ??
283- 0 ;
279+ // Handle null dates: apps with unknown release dates are grouped at the end
280+ final aDate = a.app.releaseDate;
281+ final bDate = b.app.releaseDate;
282+ if (aDate == null && bDate == null ) {
283+ // Both null: sort by name for consistency
284+ result = ((a.name + a.author).toLowerCase ()).compareTo (
285+ (b.name + b.author).toLowerCase (),
286+ );
287+ } else if (aDate == null ) {
288+ // a has no date, push to end (ascending) or beginning (will be reversed for descending)
289+ result = 1 ;
290+ } else if (bDate == null ) {
291+ // b has no date, push to end
292+ result = - 1 ;
293+ } else {
294+ result = aDate.compareTo (bDate);
295+ }
284296 }
285297 return result;
286298 });
Original file line number Diff line number Diff line change @@ -1242,6 +1242,8 @@ class AppsProvider with ChangeNotifier {
12421242 }
12431243 if (sayInstalled) {
12441244 installedIds.add (id);
1245+ // Dismiss the update notification since the app was successfully installed
1246+ notificationsProvider? .cancel (UpdateNotification ([]).id);
12451247 }
12461248 } finally {
12471249 apps[id]? .downloadProgress = null ;
You can’t perform that action at this time.
0 commit comments