From 0ee22d97f8b0989e9eddf1c9ef8ebbcbe7dd6df1 Mon Sep 17 00:00:00 2001 From: Swift Kim Date: Mon, 27 Nov 2023 17:34:48 +0900 Subject: [PATCH] Add toString() and make the constructor private --- .../lib/device_info_plus_tizen.dart | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/packages/device_info_plus/lib/device_info_plus_tizen.dart b/packages/device_info_plus/lib/device_info_plus_tizen.dart index 5d1f917c4..d2cc0129a 100644 --- a/packages/device_info_plus/lib/device_info_plus_tizen.dart +++ b/packages/device_info_plus/lib/device_info_plus_tizen.dart @@ -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, @@ -32,6 +32,9 @@ class TizenDeviceInfo { required this.tizenId, }); + /// Device information data. + final Map data; + /// http://tizen.org/system/model_name final String? modelName; @@ -88,7 +91,8 @@ class TizenDeviceInfo { /// Creates a [TizenDeviceInfo] from the [map]. static TizenDeviceInfo fromMap(Map map) { - return TizenDeviceInfo( + return TizenDeviceInfo._( + data: map, modelName: map['modelName'], cpuArch: map['cpuArch'], nativeApiVersion: map['nativeApiVersion'], @@ -110,27 +114,10 @@ class TizenDeviceInfo { ); } - /// Device information data. - Map 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 {