major update
This commit is contained in:
@@ -25,6 +25,9 @@ class FeedArticle with FastEquatable implements Insertable<FeedArticle> {
|
||||
final String? contentMarkdown;
|
||||
final String? contentPlain;
|
||||
|
||||
//Derived by view from feed table, should not get inserted
|
||||
final Uri? icon;
|
||||
|
||||
FeedArticle({
|
||||
required this.id,
|
||||
required this.feedId,
|
||||
@@ -40,6 +43,7 @@ class FeedArticle with FastEquatable implements Insertable<FeedArticle> {
|
||||
this.summaryPlain,
|
||||
this.contentMarkdown,
|
||||
this.contentPlain,
|
||||
this.icon,
|
||||
});
|
||||
|
||||
factory FeedArticle.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -109,5 +113,6 @@ class FeedArticle with FastEquatable implements Insertable<FeedArticle> {
|
||||
summaryPlain,
|
||||
contentMarkdown,
|
||||
contentPlain,
|
||||
icon,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ FeedArticle _$FeedArticleFromJson(Map<String, dynamic> json) => FeedArticle(
|
||||
summaryPlain: json['summaryPlain'] as String?,
|
||||
contentMarkdown: json['contentMarkdown'] as String?,
|
||||
contentPlain: json['contentPlain'] as String?,
|
||||
icon: json['icon'] == null ? null : Uri.parse(json['icon'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$FeedArticleToJson(FeedArticle instance) =>
|
||||
@@ -57,4 +58,5 @@ Map<String, dynamic> _$FeedArticleToJson(FeedArticle instance) =>
|
||||
'summaryPlain': instance.summaryPlain,
|
||||
'contentMarkdown': instance.contentMarkdown,
|
||||
'contentPlain': instance.contentPlain,
|
||||
'icon': instance.icon?.toString(),
|
||||
};
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import 'package:lensai/features/web_feed/data/models/feed_article.dart';
|
||||
|
||||
class FeedArticleQueryResult extends FeedArticle {
|
||||
final String? titleHighlight;
|
||||
final String? summarySnippet;
|
||||
final String? contentSnippet;
|
||||
|
||||
final double weightedRank;
|
||||
|
||||
FeedArticleQueryResult({
|
||||
@@ -8,19 +12,29 @@ class FeedArticleQueryResult extends FeedArticle {
|
||||
required super.feedId,
|
||||
required super.fetched,
|
||||
required this.weightedRank,
|
||||
super.created,
|
||||
super.updated,
|
||||
super.lastRead,
|
||||
super.title,
|
||||
super.authors,
|
||||
super.tags,
|
||||
super.links,
|
||||
super.summaryMarkdown,
|
||||
super.summaryPlain,
|
||||
super.contentMarkdown,
|
||||
super.contentPlain,
|
||||
required super.created,
|
||||
required super.updated,
|
||||
required super.lastRead,
|
||||
required super.title,
|
||||
required super.authors,
|
||||
required super.tags,
|
||||
required super.links,
|
||||
required super.summaryMarkdown,
|
||||
required super.summaryPlain,
|
||||
required super.contentMarkdown,
|
||||
required super.contentPlain,
|
||||
required super.icon,
|
||||
this.titleHighlight,
|
||||
this.summarySnippet,
|
||||
this.contentSnippet,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [...super.hashParameters, weightedRank];
|
||||
List<Object?> get hashParameters => [
|
||||
...super.hashParameters,
|
||||
weightedRank,
|
||||
summarySnippet,
|
||||
contentSnippet,
|
||||
titleHighlight,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:fast_equatable/fast_equatable.dart';
|
||||
|
||||
part 'feed_filter.g.dart';
|
||||
|
||||
@CopyWith()
|
||||
class FeedFilter with FastEquatable {
|
||||
final Uri? feedId;
|
||||
final String? query;
|
||||
final Set<String>? tags;
|
||||
|
||||
FeedFilter({this.feedId, this.query, this.tags});
|
||||
|
||||
@override
|
||||
List<Object?> get hashParameters => [feedId, query, tags];
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'feed_filter.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$FeedFilterCWProxy {
|
||||
FeedFilter feedId(Uri? feedId);
|
||||
|
||||
FeedFilter query(String? query);
|
||||
|
||||
FeedFilter tags(Set<String>? tags);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FeedFilter(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// FeedFilter(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
FeedFilter call({Uri? feedId, String? query, Set<String>? tags});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfFeedFilter.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfFeedFilter.copyWith.fieldName(...)`
|
||||
class _$FeedFilterCWProxyImpl implements _$FeedFilterCWProxy {
|
||||
const _$FeedFilterCWProxyImpl(this._value);
|
||||
|
||||
final FeedFilter _value;
|
||||
|
||||
@override
|
||||
FeedFilter feedId(Uri? feedId) => this(feedId: feedId);
|
||||
|
||||
@override
|
||||
FeedFilter query(String? query) => this(query: query);
|
||||
|
||||
@override
|
||||
FeedFilter tags(Set<String>? tags) => this(tags: tags);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `FeedFilter(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// FeedFilter(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
FeedFilter call({
|
||||
Object? feedId = const $CopyWithPlaceholder(),
|
||||
Object? query = const $CopyWithPlaceholder(),
|
||||
Object? tags = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return FeedFilter(
|
||||
feedId:
|
||||
feedId == const $CopyWithPlaceholder()
|
||||
? _value.feedId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: feedId as Uri?,
|
||||
query:
|
||||
query == const $CopyWithPlaceholder()
|
||||
? _value.query
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: query as String?,
|
||||
tags:
|
||||
tags == const $CopyWithPlaceholder()
|
||||
? _value.tags
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tags as Set<String>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $FeedFilterCopyWith on FeedFilter {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfFeedFilter.copyWith(...)` or like so:`instanceOfFeedFilter.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$FeedFilterCWProxy get copyWith => _$FeedFilterCWProxyImpl(this);
|
||||
}
|
||||
Reference in New Issue
Block a user