diff --git a/lib/core/models/about/author.dart b/lib/core/models/about/author.dart index feab6944..b4256b0d 100644 --- a/lib/core/models/about/author.dart +++ b/lib/core/models/about/author.dart @@ -7,12 +7,14 @@ import 'package:unn_mobile/core/constants/api/protocol_type.dart'; import 'package:unn_mobile/core/misc/json/json_utils.dart'; class _AuthorJsonKeys { + static const String userId = 'user_id'; static const String fullname = 'fullname'; static const String educationGroup = 'education_group'; static const String avatar = 'avatar'; } class Author { + final int? userId; final String fullname; final String? educationGroup; final String avatar; @@ -23,16 +25,19 @@ class Author { Author({ required this.fullname, required this.avatar, + this.userId, this.educationGroup, }); factory Author.fromJson(JsonMap json) => Author( + userId: json[_AuthorJsonKeys.userId] as int?, fullname: json[_AuthorJsonKeys.fullname]! as String, educationGroup: json[_AuthorJsonKeys.educationGroup] as String?, avatar: json[_AuthorJsonKeys.avatar]! as String, ); JsonMap toJson() => { + _AuthorJsonKeys.userId: userId, _AuthorJsonKeys.fullname: fullname, _AuthorJsonKeys.educationGroup: educationGroup, _AuthorJsonKeys.avatar: avatar, diff --git a/pubspec.yaml b/pubspec.yaml index 5f8ee076..4b5b5cba 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: unn_mobile description: A mobile application for UNN Portal website publish_to: 'none' -version: 0.6.0+376 +version: 0.6.0+377 environment: sdk: '>=3.1.2 <4.0.0'