Skip to content

Commit cad13fa

Browse files
committed
refactor(headline-details): use List.from instead of List.of
- Replace List.of with List.from for creating a shallow copy of savedHeadlines list - This change improves code readability and follows the more common practice in the Flutter community
1 parent 071d5f2 commit cad13fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/headline-details/view/headline_details_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
205205
.where((h) => h.id != headline.id)
206206
.toList();
207207
} else {
208-
updatedSavedHeadlines = List.of(currentPreferences.savedHeadlines)
208+
updatedSavedHeadlines = List.from(currentPreferences.savedHeadlines)
209209
..add(headline);
210210
}
211211

0 commit comments

Comments
 (0)