Skip to content

Commit

Permalink
feat(device_info_plus): LinuxDeviceInfo toString method (fluttercommu…
Browse files Browse the repository at this point in the history
  • Loading branch information
defuncart authored and suquant committed Mar 4, 2024
1 parent 6814bec commit 42a04ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,9 @@ class LinuxDeviceInfo implements BaseDeviceInfo {
'machineId': machineId,
};
}

@override
String toString() {
return 'LinuxDeviceInfo(name: $name, version: $version, id: $id, idLike: $idLike, versionCodename: $versionCodename, versionId: $versionId, prettyName: $prettyName, buildId: $buildId, variant: $variant, variantId: $variantId, machineId: $machineId)';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,26 @@ void main() {
'machineId': 'machineId',
});
});

test('toString should return string representation', () {
final linuxDeviceInfo = LinuxDeviceInfo(
name: 'name',
version: 'version',
id: 'id',
idLike: ['idLike'],
versionCodename: 'versionCodename',
versionId: 'versionId',
prettyName: 'prettyName',
buildId: 'buildId',
variant: 'variant',
variantId: 'variantId',
machineId: 'machineId',
);

expect(
linuxDeviceInfo.toString(),
'LinuxDeviceInfo(name: name, version: version, id: id, idLike: [idLike], versionCodename: versionCodename, versionId: versionId, prettyName: prettyName, buildId: buildId, variant: variant, variantId: variantId, machineId: machineId)',
);
});
});
}

0 comments on commit 42a04ce

Please sign in to comment.