Rename NewsSource to Source now that it models every kind (review item 3)
The class and its file (lib/models/source.dart) follow the glossary term. Persisted JSON keys are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a3442ea02
commit
a47ff28ed1
33 files changed
+119
-119
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart' show ThemeMode;
|
||||
|
||||
import 'news_source.dart';
|
||||
import 'source.dart';
|
||||
|
||||
enum AiProvider {
|
||||
none('Off'),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'news_source.dart';
|
||||
import 'source.dart';
|
||||
|
||||
class Article {
|
||||
const Article({
|
||||
@@ -14,7 +14,7 @@ class Article {
|
||||
|
||||
final String title;
|
||||
final String link;
|
||||
final NewsSource source;
|
||||
final Source source;
|
||||
final DateTime? published;
|
||||
|
||||
/// Short plain-text teaser from the feed (description / summary).
|
||||
|
||||
@@ -20,9 +20,9 @@ enum SourceKind {
|
||||
final String label;
|
||||
}
|
||||
|
||||
/// A Source of any [kind]; the class name predates the kinds.
|
||||
class NewsSource {
|
||||
const NewsSource({
|
||||
/// A Source of any [kind]; see GLOSSARY.md.
|
||||
class Source {
|
||||
const Source({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.feedUrl,
|
||||
@@ -59,7 +59,7 @@ class NewsSource {
|
||||
'description': description,
|
||||
};
|
||||
|
||||
factory NewsSource.custom(Map<String, dynamic> json) => NewsSource(
|
||||
factory Source.custom(Map<String, dynamic> json) => Source(
|
||||
id: json['id'] as String,
|
||||
name: json['name'] as String,
|
||||
feedUrl: json['feedUrl'] as String,
|
||||
Reference in new issue
Block a user