Skip to content

Commit

Permalink
fix wrong numbering in hive fields
Browse files Browse the repository at this point in the history
  • Loading branch information
wuuzw committed Jan 20, 2021
1 parent 9f67a29 commit bae29fe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
20 changes: 14 additions & 6 deletions lib/app/shared/models/feed_item.dart
Expand Up @@ -6,30 +6,38 @@ import 'item_type.dart';
part 'feed_item.g.dart';

@HiveType(typeId: 1)
@JsonSerializable()
@JsonSerializable(explicitToJson: true)
class FeedItem extends HiveObject {
@HiveField(0)
final int id;

@HiveField(1)
final String title;

@HiveField(2)
final int points;

@HiveField(3)
final String user;

@HiveField(4)
final int time;

@HiveField(5)
@JsonKey(name: 'time_ago')
@HiveField(6)
final String timeAgo;

@JsonKey(name: 'comments_count')
@HiveField(7)
@HiveField(6)
final int commentsCount;
@HiveField(8)

@HiveField(7)
final ItemType type;
@HiveField(9)

@HiveField(8)
final String url;
@HiveField(10)

@HiveField(9)
final String domain;

FeedItem(this.id, this.title, this.points, this.user, this.time, this.timeAgo, this.commentsCount, this.type,
Expand Down
14 changes: 7 additions & 7 deletions lib/app/shared/models/feed_item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bae29fe

Please sign in to comment.