Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

refactor: Add toMap and fromMap functions in app_info_extractor.dart #245

Merged
merged 2 commits into from
Mar 30, 2022

Conversation

wal33d006
Copy link
Contributor

Added these functions so that we can save some app version information to plain data storage

@wal33d006 wal33d006 added Technical 🛠 Technical task not closely coupled with any feature 🛠 Refactor 🛠 labels Mar 30, 2022
@wal33d006 wal33d006 self-assigned this Mar 30, 2022
@wal33d006 wal33d006 requested review from andrzejchm and Zfinix March 30, 2022 05:49
Copy link
Contributor

@Zfinix Zfinix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@andrzejchm andrzejchm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's stay consistent with naming for the fromJson and toJson :)

@@ -23,4 +23,18 @@ class AppInfo {
final String packageName;
final String version;
final String buildNumber;

AppInfo fromMap(Map<String, dynamic> json) => AppInfo(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AppInfo fromMap(Map<String, dynamic> json) => AppInfo(
AppInfo fromJson(Map<String, dynamic> json) => AppInfo(

version: json['version'] as String? ?? '',
);

Map<String, dynamic> toMap() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Map<String, dynamic> toMap() => {
Map<String, dynamic> toJson() => {

@wal33d006 wal33d006 merged commit 76dcfa3 into main Mar 30, 2022
@wal33d006 wal33d006 deleted the refactor-app-info branch March 30, 2022 08:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🛠 Refactor 🛠 Technical 🛠 Technical task not closely coupled with any feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants