Skip to content

Commit

Permalink
Merge pull request #34 from ryanaidilp/hotfix/0.6.1
Browse files Browse the repository at this point in the history
fix: fix bug in press release
  • Loading branch information
ryanaidilp authored Sep 26, 2023
2 parents a015c5b + 38dc9d2 commit c4266c3
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 82 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.6.1+13

> 2023-09-26
### What's new?

- **Fixed** `PressRelease` abstract property is nullable

## 0.6.0+12

> 2023-09-26
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ for (final pressRelease in pressReleaseList) {
| `size` | `String` | The file size. |
| `pdf` | `String` | A link or reference to the associated PDF file for the press release. |
| `cover` | `String` | The thumbnail of the press release. |
| `abstract` | `String` | The abstract of the press release. |
| `abstract` | `String?` | The abstract of the press release. |
| `updatedAt` | `DateTime` | The date and time when the table was last updated. |
| `releaseDate` | `DateTime?` | The optional date and time when the table was created. |
| `slide` | `String` | A link or reference to the associated Slide file for the press release. |
Expand Down Expand Up @@ -1014,7 +1014,7 @@ print('Updated At: ${pressRelease.updatedAt}');
| `size` | `String` | The file size. |
| `pdf` | `String` | A link or reference to the associated PDF file for the press release. |
| `cover` | `String` | The thumbnail of the press release. |
| `abstract` | `String` | The abstract of the press release. |
| `abstract` | `String?` | The abstract of the press release. |
| `updatedAt` | `DateTime` | The date and time when the table was last updated. |
| `releaseDate` | `DateTime?` | The optional date and time when the table was created. |
| `slide` | `String` | A link or reference to the associated Slide file for the press release. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PressReleaseDetailView extends GetView<PressReleaseDetailController> {
controller.obx(
(state) => _PressReleaseDetailSection(
title: state!.title,
abstract: state.abstract,
abstract: state.abstract ?? '',
fileSize: state.size,
updatedAt: state.updatedAt,
releaseDate: state.releaseDate,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/core/di/service_locator.config.dart

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

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ abstract class PressReleaseModel with _$PressReleaseModel {
factory PressReleaseModel({
@JsonKey(name: 'brs_id') required int id,
required String title,
@AbstractSerializer() required String abstract,
@JsonKey(name: 'rl_date') required DateTime releaseDate,
required String pdf,
required String slide,
required String size,
@JsonKey(name: 'thumbnail') required String cover,
@AbstractSerializer() String? abstract,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? subject,
@JsonKey(name: 'updt_date') DateTime? updatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ PressReleaseModel _$PressReleaseModelFromJson(Map<String, dynamic> json) {
mixin _$PressReleaseModel {
@JsonKey(name: 'brs_id')
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? get subject => throw _privateConstructorUsedError;
String get title => throw _privateConstructorUsedError;
@AbstractSerializer()
String get abstract => throw _privateConstructorUsedError;
@JsonKey(name: 'rl_date')
DateTime get releaseDate => throw _privateConstructorUsedError;
String get pdf => throw _privateConstructorUsedError;
String get slide => throw _privateConstructorUsedError;
String get size => throw _privateConstructorUsedError;
@JsonKey(name: 'thumbnail')
String get cover => throw _privateConstructorUsedError;
@AbstractSerializer()
String? get abstract => throw _privateConstructorUsedError;
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? get subject => throw _privateConstructorUsedError;
@JsonKey(name: 'updt_date')
DateTime? get updatedAt => throw _privateConstructorUsedError;

Expand All @@ -51,15 +51,15 @@ abstract class $PressReleaseModelCopyWith<$Res> {
@useResult
$Res call(
{@JsonKey(name: 'brs_id') int id,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? subject,
String title,
@AbstractSerializer() String abstract,
@JsonKey(name: 'rl_date') DateTime releaseDate,
String pdf,
String slide,
String size,
@JsonKey(name: 'thumbnail') String cover,
@AbstractSerializer() String? abstract,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? subject,
@JsonKey(name: 'updt_date') DateTime? updatedAt});

$SubjectModelCopyWith<$Res>? get subject;
Expand All @@ -79,33 +79,25 @@ class _$PressReleaseModelCopyWithImpl<$Res, $Val extends PressReleaseModel>
@override
$Res call({
Object? id = null,
Object? subject = freezed,
Object? title = null,
Object? abstract = null,
Object? releaseDate = null,
Object? pdf = null,
Object? slide = null,
Object? size = null,
Object? cover = null,
Object? abstract = freezed,
Object? subject = freezed,
Object? updatedAt = freezed,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
subject: freezed == subject
? _value.subject
: subject // ignore: cast_nullable_to_non_nullable
as SubjectModel?,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
abstract: null == abstract
? _value.abstract
: abstract // ignore: cast_nullable_to_non_nullable
as String,
releaseDate: null == releaseDate
? _value.releaseDate
: releaseDate // ignore: cast_nullable_to_non_nullable
Expand All @@ -126,6 +118,14 @@ class _$PressReleaseModelCopyWithImpl<$Res, $Val extends PressReleaseModel>
? _value.cover
: cover // ignore: cast_nullable_to_non_nullable
as String,
abstract: freezed == abstract
? _value.abstract
: abstract // ignore: cast_nullable_to_non_nullable
as String?,
subject: freezed == subject
? _value.subject
: subject // ignore: cast_nullable_to_non_nullable
as SubjectModel?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -156,15 +156,15 @@ abstract class _$$_PressReleaseModelCopyWith<$Res>
@useResult
$Res call(
{@JsonKey(name: 'brs_id') int id,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? subject,
String title,
@AbstractSerializer() String abstract,
@JsonKey(name: 'rl_date') DateTime releaseDate,
String pdf,
String slide,
String size,
@JsonKey(name: 'thumbnail') String cover,
@AbstractSerializer() String? abstract,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? subject,
@JsonKey(name: 'updt_date') DateTime? updatedAt});

@override
Expand All @@ -183,33 +183,25 @@ class __$$_PressReleaseModelCopyWithImpl<$Res>
@override
$Res call({
Object? id = null,
Object? subject = freezed,
Object? title = null,
Object? abstract = null,
Object? releaseDate = null,
Object? pdf = null,
Object? slide = null,
Object? size = null,
Object? cover = null,
Object? abstract = freezed,
Object? subject = freezed,
Object? updatedAt = freezed,
}) {
return _then(_$_PressReleaseModel(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
subject: freezed == subject
? _value.subject
: subject // ignore: cast_nullable_to_non_nullable
as SubjectModel?,
title: null == title
? _value.title
: title // ignore: cast_nullable_to_non_nullable
as String,
abstract: null == abstract
? _value.abstract
: abstract // ignore: cast_nullable_to_non_nullable
as String,
releaseDate: null == releaseDate
? _value.releaseDate
: releaseDate // ignore: cast_nullable_to_non_nullable
Expand All @@ -230,6 +222,14 @@ class __$$_PressReleaseModelCopyWithImpl<$Res>
? _value.cover
: cover // ignore: cast_nullable_to_non_nullable
as String,
abstract: freezed == abstract
? _value.abstract
: abstract // ignore: cast_nullable_to_non_nullable
as String?,
subject: freezed == subject
? _value.subject
: subject // ignore: cast_nullable_to_non_nullable
as SubjectModel?,
updatedAt: freezed == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
Expand All @@ -243,14 +243,14 @@ class __$$_PressReleaseModelCopyWithImpl<$Res>
class _$_PressReleaseModel implements _PressReleaseModel {
_$_PressReleaseModel(
{@JsonKey(name: 'brs_id') required this.id,
@JsonKey(name: 'subj', readValue: _subjectValueReader) this.subject,
required this.title,
@AbstractSerializer() required this.abstract,
@JsonKey(name: 'rl_date') required this.releaseDate,
required this.pdf,
required this.slide,
required this.size,
@JsonKey(name: 'thumbnail') required this.cover,
@AbstractSerializer() this.abstract,
@JsonKey(name: 'subj', readValue: _subjectValueReader) this.subject,
@JsonKey(name: 'updt_date') this.updatedAt});

factory _$_PressReleaseModel.fromJson(Map<String, dynamic> json) =>
Expand All @@ -260,14 +260,8 @@ class _$_PressReleaseModel implements _PressReleaseModel {
@JsonKey(name: 'brs_id')
final int id;
@override
@JsonKey(name: 'subj', readValue: _subjectValueReader)
final SubjectModel? subject;
@override
final String title;
@override
@AbstractSerializer()
final String abstract;
@override
@JsonKey(name: 'rl_date')
final DateTime releaseDate;
@override
Expand All @@ -280,12 +274,18 @@ class _$_PressReleaseModel implements _PressReleaseModel {
@JsonKey(name: 'thumbnail')
final String cover;
@override
@AbstractSerializer()
final String? abstract;
@override
@JsonKey(name: 'subj', readValue: _subjectValueReader)
final SubjectModel? subject;
@override
@JsonKey(name: 'updt_date')
final DateTime? updatedAt;

@override
String toString() {
return 'PressReleaseModel(id: $id, subject: $subject, title: $title, abstract: $abstract, releaseDate: $releaseDate, pdf: $pdf, slide: $slide, size: $size, cover: $cover, updatedAt: $updatedAt)';
return 'PressReleaseModel(id: $id, title: $title, releaseDate: $releaseDate, pdf: $pdf, slide: $slide, size: $size, cover: $cover, abstract: $abstract, subject: $subject, updatedAt: $updatedAt)';
}

@override
Expand All @@ -294,24 +294,24 @@ class _$_PressReleaseModel implements _PressReleaseModel {
(other.runtimeType == runtimeType &&
other is _$_PressReleaseModel &&
(identical(other.id, id) || other.id == id) &&
(identical(other.subject, subject) || other.subject == subject) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.abstract, abstract) ||
other.abstract == abstract) &&
(identical(other.releaseDate, releaseDate) ||
other.releaseDate == releaseDate) &&
(identical(other.pdf, pdf) || other.pdf == pdf) &&
(identical(other.slide, slide) || other.slide == slide) &&
(identical(other.size, size) || other.size == size) &&
(identical(other.cover, cover) || other.cover == cover) &&
(identical(other.abstract, abstract) ||
other.abstract == abstract) &&
(identical(other.subject, subject) || other.subject == subject) &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, id, subject, title, abstract,
releaseDate, pdf, slide, size, cover, updatedAt);
int get hashCode => Object.hash(runtimeType, id, title, releaseDate, pdf,
slide, size, cover, abstract, subject, updatedAt);

@JsonKey(ignore: true)
@override
Expand All @@ -331,15 +331,15 @@ class _$_PressReleaseModel implements _PressReleaseModel {
abstract class _PressReleaseModel implements PressReleaseModel {
factory _PressReleaseModel(
{@JsonKey(name: 'brs_id') required final int id,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
final SubjectModel? subject,
required final String title,
@AbstractSerializer() required final String abstract,
@JsonKey(name: 'rl_date') required final DateTime releaseDate,
required final String pdf,
required final String slide,
required final String size,
@JsonKey(name: 'thumbnail') required final String cover,
@AbstractSerializer() final String? abstract,
@JsonKey(name: 'subj', readValue: _subjectValueReader)
final SubjectModel? subject,
@JsonKey(name: 'updt_date') final DateTime? updatedAt}) =
_$_PressReleaseModel;

Expand All @@ -350,14 +350,8 @@ abstract class _PressReleaseModel implements PressReleaseModel {
@JsonKey(name: 'brs_id')
int get id;
@override
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? get subject;
@override
String get title;
@override
@AbstractSerializer()
String get abstract;
@override
@JsonKey(name: 'rl_date')
DateTime get releaseDate;
@override
Expand All @@ -370,6 +364,12 @@ abstract class _PressReleaseModel implements PressReleaseModel {
@JsonKey(name: 'thumbnail')
String get cover;
@override
@AbstractSerializer()
String? get abstract;
@override
@JsonKey(name: 'subj', readValue: _subjectValueReader)
SubjectModel? get subject;
@override
@JsonKey(name: 'updt_date')
DateTime? get updatedAt;
@override
Expand Down
Loading

0 comments on commit c4266c3

Please sign in to comment.