Skip to content

Commit

Permalink
Add toString() and make the constructor private
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-kim committed Nov 27, 2023
1 parent 7f185fe commit 0ee22d9
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions packages/device_info_plus/lib/device_info_plus_tizen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'package:flutter/services.dart';
///
/// See: https://docs.tizen.org/application/native/guides/device/system
class TizenDeviceInfo {
/// Tizen device info class.
TizenDeviceInfo({
TizenDeviceInfo._({
required this.data,
required this.modelName,
required this.cpuArch,
required this.nativeApiVersion,
Expand All @@ -32,6 +32,9 @@ class TizenDeviceInfo {
required this.tizenId,
});

/// Device information data.
final Map<String, dynamic> data;

/// http://tizen.org/system/model_name
final String? modelName;

Expand Down Expand Up @@ -88,7 +91,8 @@ class TizenDeviceInfo {

/// Creates a [TizenDeviceInfo] from the [map].
static TizenDeviceInfo fromMap(Map<String, dynamic> map) {
return TizenDeviceInfo(
return TizenDeviceInfo._(
data: map,
modelName: map['modelName'],
cpuArch: map['cpuArch'],
nativeApiVersion: map['nativeApiVersion'],
Expand All @@ -110,27 +114,10 @@ class TizenDeviceInfo {
);
}

/// Device information data.
Map<String, dynamic> get data => {
'modelName': modelName,
'cpuArch': cpuArch,
'nativeApiVersion': nativeApiVersion,
'platformVersion': platformVersion,
'webApiVersion': webApiVersion,
'profile': profile,
'buildDate': buildDate,
'buildId': buildId,
'buildString': buildString,
'buildTime': buildTime,
'buildType': buildType,
'buildVariant': buildVariant,
'buildRelease': buildRelease,
'deviceType': deviceType,
'manufacturer': manufacturer,
'platformName': platformName,
'platformProcessor': platformProcessor,
'tizenId': tizenId,
};
@override
String toString() {
return 'TizenDeviceInfo{data: $data}';
}
}

class _MethodChannelDeviceInfo {
Expand Down

0 comments on commit 0ee22d9

Please sign in to comment.