Skip to content

Commit 1b54995

Browse files
authored
Merge pull request #8 from Peterkrol12/fix/dart-format
Applied dart format changes
2 parents 296cdf6 + 469de23 commit 1b54995

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+578
-368
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [0.7.2](https://pub.dev/packages/webfeed-revised/versions/0.7.2)
4+
- Applied dart format
5+
36
## [0.7.1](https://pub.dev/packages/webfeed-revised/versions/0.7.1)
47
- Updated dependencies
58
- Fixed RssItem pubDate optional seconds

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# WebFeed Revised
22

3-
[![Pub](https://img.shields.io/pub/v/webfeed-revised.svg)](https://pub.dev/packages/webfeed-revised)
3+
[![Pub](https://img.shields.io/pub/v/webfeed_revised.svg)](https://pub.dev/packages/webfeed-revised)
44

55
A dart package for parsing RSS and Atom feed.
66

lib/domain/atom_category.dart

+2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ class AtomCategory {
1717

1818
/// The category term
1919
final String? term;
20+
2021
/// The category scheme
2122
final String? scheme;
23+
2224
/// The category label
2325
final String? label;
2426
}

lib/domain/atom_feed.dart

+18-16
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,16 @@ class AtomFeed {
4040
title: feedElement.findElements('title').firstOrNull?.text,
4141
updated:
4242
parseDateTime(feedElement.findElements('updated').firstOrNull?.text),
43-
items: feedElement
44-
.findElements('entry')
45-
.map(AtomItem.parse)
46-
.toList(),
47-
links: feedElement
48-
.findElements('link')
49-
.map(AtomLink.parse)
50-
.toList(),
51-
authors: feedElement
52-
.findElements('author')
53-
.map(AtomPerson.parse)
54-
.toList(),
43+
items: feedElement.findElements('entry').map(AtomItem.parse).toList(),
44+
links: feedElement.findElements('link').map(AtomLink.parse).toList(),
45+
authors:
46+
feedElement.findElements('author').map(AtomPerson.parse).toList(),
5547
contributors: feedElement
5648
.findElements('contributor')
5749
.map(AtomPerson.parse)
5850
.toList(),
59-
categories: feedElement
60-
.findElements('category')
61-
.map(AtomCategory.parse)
62-
.toList(),
51+
categories:
52+
feedElement.findElements('category').map(AtomCategory.parse).toList(),
6353
generator: feedElement
6454
.findElements('generator')
6555
.map(AtomGenerator.parse)
@@ -73,28 +63,40 @@ class AtomFeed {
7363

7464
/// The feed id
7565
final String? id;
66+
7667
/// The feed title
7768
final String? title;
69+
7870
/// The feed updated date
7971
final DateTime? updated;
72+
8073
/// The feed items
8174
final List<AtomItem>? items;
75+
8276
/// The feed links
8377
final List<AtomLink>? links;
78+
8479
/// The feed authors
8580
final List<AtomPerson>? authors;
81+
8682
/// The feed contributors
8783
final List<AtomPerson>? contributors;
84+
8885
/// The feed categories
8986
final List<AtomCategory>? categories;
87+
9088
/// The feed generator
9189
final AtomGenerator? generator;
90+
9291
/// The feed icon
9392
final String? icon;
93+
9494
/// The feed logo
9595
final String? logo;
96+
9697
/// The feed rights
9798
final String? rights;
99+
98100
/// The feed subtitle
99101
final String? subtitle;
100102
}

lib/domain/atom_generator.dart

+2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ class AtomGenerator {
1717
/// The URI of the software used to generate the feed, must be an IRI
1818
/// reference
1919
final String? uri;
20+
2021
/// The version of the generating agent
2122
final String? version;
23+
2224
/// The name of the generating agent
2325
final String? value;
2426
}

lib/domain/atom_item.dart

+30-28
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import 'package:xml/xml.dart';
1010
/// Represents an Atom item
1111
/// See https://tools.ietf.org/html/rfc4287
1212
class AtomItem {
13-
1413
/// Default constructor for the AtomItem class
1514
AtomItem({
1615
this.id,
@@ -30,58 +29,61 @@ class AtomItem {
3029

3130
/// Parse constructor for the AtomItem class, used when 'parsing' a feed
3231
factory AtomItem.parse(XmlElement element) => AtomItem(
33-
id: element.findElements('id').firstOrNull?.text,
34-
title: element.findElements('title').firstOrNull?.text,
35-
updated: parseDateTime(element.findElements('updated').firstOrNull?.text),
36-
authors: element
37-
.findElements('author')
38-
.map(AtomPerson.parse)
39-
.toList(),
40-
links:
41-
element.findElements('link').map(AtomLink.parse).toList(),
42-
categories: element
43-
.findElements('category')
44-
.map(AtomCategory.parse)
45-
.toList(),
46-
contributors: element
47-
.findElements('contributor')
48-
.map(AtomPerson.parse)
49-
.toList(),
50-
source: element
51-
.findElements('source')
52-
.map(AtomSource.parse)
53-
.firstOrNull,
54-
published: element.findElements('published').firstOrNull?.text,
55-
content: element.findElements('content').firstOrNull?.text,
56-
summary: element.findElements('summary').firstOrNull?.text,
57-
rights: element.findElements('rights').firstOrNull?.text,
58-
media: Media.parse(element),
59-
);
32+
id: element.findElements('id').firstOrNull?.text,
33+
title: element.findElements('title').firstOrNull?.text,
34+
updated:
35+
parseDateTime(element.findElements('updated').firstOrNull?.text),
36+
authors: element.findElements('author').map(AtomPerson.parse).toList(),
37+
links: element.findElements('link').map(AtomLink.parse).toList(),
38+
categories:
39+
element.findElements('category').map(AtomCategory.parse).toList(),
40+
contributors:
41+
element.findElements('contributor').map(AtomPerson.parse).toList(),
42+
source:
43+
element.findElements('source').map(AtomSource.parse).firstOrNull,
44+
published: element.findElements('published').firstOrNull?.text,
45+
content: element.findElements('content').firstOrNull?.text,
46+
summary: element.findElements('summary').firstOrNull?.text,
47+
rights: element.findElements('rights').firstOrNull?.text,
48+
media: Media.parse(element),
49+
);
6050

6151
/// The item id
6252
final String? id;
53+
6354
/// The item title
6455
final String? title;
56+
6557
/// The item updated date
6658
final DateTime? updated;
59+
6760
/// The item authors
6861
final List<AtomPerson>? authors;
62+
6963
/// The item links
7064
final List<AtomLink>? links;
65+
7166
/// The item categories
7267
final List<AtomCategory>? categories;
68+
7369
/// The item contributors
7470
final List<AtomPerson>? contributors;
71+
7572
/// The item source
7673
final AtomSource? source;
74+
7775
/// The item published date
7876
final String? published;
77+
7978
/// The item content
8079
final String? content;
80+
8181
/// The item summary
8282
final String? summary;
83+
8384
/// The item rights
8485
final String? rights;
86+
8587
/// The item media
8688
final Media? media;
8789
}

lib/domain/atom_link.dart

+5
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,19 @@ class AtomLink {
2929

3030
/// The URI of the referenced resource
3131
final String? href;
32+
3233
/// The link relationship type
3334
final String? rel;
35+
3436
/// The media type of the referenced resource
3537
final String? type;
38+
3639
/// The language of the referenced resource
3740
final String? hreflang;
41+
3842
/// The human-readable information about the link
3943
final String? title;
44+
4045
/// The length of the resource, in bytes
4146
final int length;
4247
}

lib/domain/atom_person.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ class AtomPerson {
99

1010
/// Parse constructor for the AtomPerson class, used when 'parsing' a feed
1111
factory AtomPerson.parse(XmlElement element) => AtomPerson(
12-
name: element.findElements('name').firstOrNull?.text,
13-
uri: element.findElements('uri').firstOrNull?.text,
14-
email: element.findElements('email').firstOrNull?.text,
15-
);
12+
name: element.findElements('name').firstOrNull?.text,
13+
uri: element.findElements('uri').firstOrNull?.text,
14+
email: element.findElements('email').firstOrNull?.text,
15+
);
1616

1717
/// The name of the person
1818
final String? name;
19+
1920
/// The URI of the person, must be an IRI reference
2021
final String? uri;
22+
2123
/// The email of the person
2224
final String? email;
2325
}

lib/domain/atom_source.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ class AtomSource {
1414

1515
/// Parse constructor for the AtomSource class, used when 'parsing' a feed
1616
factory AtomSource.parse(XmlElement element) => AtomSource(
17-
id: element.findElements('id').firstOrNull?.text,
18-
title: element.findElements('title').firstOrNull?.text,
19-
updated: element.findElements('updated').firstOrNull?.text,
20-
);
17+
id: element.findElements('id').firstOrNull?.text,
18+
title: element.findElements('title').firstOrNull?.text,
19+
updated: element.findElements('updated').firstOrNull?.text,
20+
);
2121

2222
/// The id of the source feed
2323
final String? id;
24+
2425
/// The title of the source feed
2526
final String? title;
27+
2628
/// The last updated date of the source feed
2729
final String? updated;
2830
}

lib/domain/dublin_core/dublin_core.dart

+37-20
Original file line numberDiff line numberDiff line change
@@ -28,61 +28,78 @@ class DublinCore {
2828

2929
/// Parse constructor for the DublinCore class, used when 'parsing' a feed
3030
factory DublinCore.parse(XmlElement element) => DublinCore(
31-
title: element.findElements('dc:title').firstOrNull?.text,
32-
description: element.findElements('dc:description').firstOrNull?.text,
33-
creator: element.findElements('dc:creator').firstOrNull?.text,
34-
subject: element.findElements('dc:subject').firstOrNull?.text,
35-
publisher: element.findElements('dc:publisher').firstOrNull?.text,
36-
contributor: element.findElements('dc:contributor').firstOrNull?.text,
37-
date: parseDateTime(element.findElements('dc:date').firstOrNull?.text),
38-
created:
39-
parseDateTime(element.findElements('dc:created').firstOrNull?.text),
40-
modified:
41-
parseDateTime(element.findElements('dc:modified').firstOrNull?.text),
42-
type: element.findElements('dc:type').firstOrNull?.text,
43-
format: element.findElements('dc:format').firstOrNull?.text,
44-
identifier: element.findElements('dc:identifier').firstOrNull?.text,
45-
source: element.findElements('dc:source').firstOrNull?.text,
46-
language: element.findElements('dc:language').firstOrNull?.text,
47-
relation: element.findElements('dc:relation').firstOrNull?.text,
48-
coverage: element.findElements('dc:coverage').firstOrNull?.text,
49-
rights: element.findElements('dc:rights').firstOrNull?.text,
50-
);
31+
title: element.findElements('dc:title').firstOrNull?.text,
32+
description: element.findElements('dc:description').firstOrNull?.text,
33+
creator: element.findElements('dc:creator').firstOrNull?.text,
34+
subject: element.findElements('dc:subject').firstOrNull?.text,
35+
publisher: element.findElements('dc:publisher').firstOrNull?.text,
36+
contributor: element.findElements('dc:contributor').firstOrNull?.text,
37+
date: parseDateTime(element.findElements('dc:date').firstOrNull?.text),
38+
created:
39+
parseDateTime(element.findElements('dc:created').firstOrNull?.text),
40+
modified: parseDateTime(
41+
element.findElements('dc:modified').firstOrNull?.text,
42+
),
43+
type: element.findElements('dc:type').firstOrNull?.text,
44+
format: element.findElements('dc:format').firstOrNull?.text,
45+
identifier: element.findElements('dc:identifier').firstOrNull?.text,
46+
source: element.findElements('dc:source').firstOrNull?.text,
47+
language: element.findElements('dc:language').firstOrNull?.text,
48+
relation: element.findElements('dc:relation').firstOrNull?.text,
49+
coverage: element.findElements('dc:coverage').firstOrNull?.text,
50+
rights: element.findElements('dc:rights').firstOrNull?.text,
51+
);
5152

5253
/// The title of the resource
5354
final String? title;
55+
5456
/// A description of the resource
5557
final String? description;
58+
5659
/// An entity primarily responsible for making the resource
5760
final String? creator;
61+
5862
/// The topic of the resource
5963
final String? subject;
64+
6065
/// An entity responsible for making the resource available
6166
final String? publisher;
67+
6268
/// An entity responsible for making contributions to the resource
6369
final String? contributor;
70+
6471
/// A point or period of time associated with an event in the lifecycle of the
6572
/// resource
6673
final DateTime? date;
74+
6775
/// The date of creation of the resource
6876
final DateTime? created;
77+
6978
/// The date of modification of the resource
7079
final DateTime? modified;
80+
7181
/// The nature or genre of the resource
7282
final String? type;
83+
7384
/// The file format, physical medium, or dimensions of the resource
7485
final String? format;
86+
7587
/// An unambiguous reference to the resource within a given context
7688
final String? identifier;
89+
7790
/// A related resource from which the described resource is derived
7891
final String? source;
92+
7993
/// A language of the resource
8094
final String? language;
95+
8196
/// A related resource
8297
final String? relation;
98+
8399
/// The spatial or temporal topic of the resource, the spatial applicability
84100
/// of the resource, or the jurisdiction under which the resource is relevant
85101
final String? coverage;
102+
86103
/// Information about rights held in and over the resource
87104
final String? rights;
88105
}

0 commit comments

Comments
 (0)