@@ -35,43 +35,43 @@ class AndroidDeviceInfo {
3535 systemFeatures = List <String >.unmodifiable (systemFeatures);
3636
3737 /// Android operating system version values derived from `android.os.Build.VERSION` .
38- final AndroidBuildVersion ? version;
38+ final AndroidBuildVersion version;
3939
4040 /// The name of the underlying board, like "goldfish".
41- final String ? board;
41+ final String board;
4242
4343 /// The system bootloader version number.
44- final String ? bootloader;
44+ final String bootloader;
4545
4646 /// The consumer-visible brand with which the product/hardware will be associated, if any.
47- final String ? brand;
47+ final String brand;
4848
4949 /// The name of the industrial design.
50- final String ? device;
50+ final String device;
5151
5252 /// A build ID string meant for displaying to the user.
53- final String ? display;
53+ final String display;
5454
5555 /// A string that uniquely identifies this build.
56- final String ? fingerprint;
56+ final String fingerprint;
5757
5858 /// The name of the hardware (from the kernel command line or /proc).
59- final String ? hardware;
59+ final String hardware;
6060
6161 /// Hostname.
62- final String ? host;
62+ final String host;
6363
6464 /// Either a changelist number, or a label like "M4-rc20".
65- final String ? id;
65+ final String id;
6666
6767 /// The manufacturer of the product/hardware.
68- final String ? manufacturer;
68+ final String manufacturer;
6969
7070 /// The end-user-visible name for the end product.
71- final String ? model;
71+ final String model;
7272
7373 /// The name of the overall product.
74- final String ? product;
74+ final String product;
7575
7676 /// An ordered list of 32 bit ABIs supported by this device.
7777 final List <String > supported32BitAbis;
@@ -83,16 +83,16 @@ class AndroidDeviceInfo {
8383 final List <String > supportedAbis;
8484
8585 /// Comma-separated tags describing the build, like "unsigned,debug".
86- final String ? tags;
86+ final String tags;
8787
8888 /// The type of build, like "user" or "eng".
89- final String ? type;
89+ final String type;
9090
9191 /// `false` if the application is running in an emulator, `true` otherwise.
92- final bool ? isPhysicalDevice;
92+ final bool isPhysicalDevice;
9393
9494 /// The Android hardware device ID that is unique between the device + user and app signing.
95- final String ? androidId;
95+ final String androidId;
9696
9797 /// Describes what features are available on the current device.
9898 ///
@@ -115,25 +115,25 @@ class AndroidDeviceInfo {
115115 return AndroidDeviceInfo (
116116 version: AndroidBuildVersion ._fromMap (
117117 map['version' ]? .cast <String , dynamic >() ?? {}),
118- board: map['board' ],
119- bootloader: map['bootloader' ],
120- brand: map['brand' ],
121- device: map['device' ],
122- display: map['display' ],
123- fingerprint: map['fingerprint' ],
124- hardware: map['hardware' ],
125- host: map['host' ],
126- id: map['id' ],
127- manufacturer: map['manufacturer' ],
128- model: map['model' ],
129- product: map['product' ],
118+ board: map['board' ] ?? '' ,
119+ bootloader: map['bootloader' ] ?? '' ,
120+ brand: map['brand' ] ?? '' ,
121+ device: map['device' ] ?? '' ,
122+ display: map['display' ] ?? '' ,
123+ fingerprint: map['fingerprint' ] ?? '' ,
124+ hardware: map['hardware' ] ?? '' ,
125+ host: map['host' ] ?? '' ,
126+ id: map['id' ] ?? '' ,
127+ manufacturer: map['manufacturer' ] ?? '' ,
128+ model: map['model' ] ?? '' ,
129+ product: map['product' ] ?? '' ,
130130 supported32BitAbis: _fromList (map['supported32BitAbis' ] ?? []),
131131 supported64BitAbis: _fromList (map['supported64BitAbis' ] ?? []),
132132 supportedAbis: _fromList (map['supportedAbis' ] ?? []),
133- tags: map['tags' ],
134- type: map['type' ],
135- isPhysicalDevice: map['isPhysicalDevice' ],
136- androidId: map['androidId' ],
133+ tags: map['tags' ] ?? '' ,
134+ type: map['type' ] ?? '' ,
135+ isPhysicalDevice: map['isPhysicalDevice' ] ?? '' ,
136+ androidId: map['androidId' ] ?? '' ,
137137 systemFeatures: _fromList (map['systemFeatures' ] ?? []),
138138 );
139139 }
@@ -161,38 +161,38 @@ class AndroidBuildVersion {
161161 });
162162
163163 /// The base OS build the product is based on.
164- final String ? baseOS;
164+ final String baseOS;
165165
166166 /// The current development codename, or the string "REL" if this is a release build.
167- final String ? codename;
167+ final String codename;
168168
169169 /// The internal value used by the underlying source control to represent this build.
170- final String ? incremental;
170+ final String incremental;
171171
172172 /// The developer preview revision of a prerelease SDK.
173- final int ? previewSdkInt;
173+ final int previewSdkInt;
174174
175175 /// The user-visible version string.
176- final String ? release;
176+ final String release;
177177
178178 /// The user-visible SDK version of the framework.
179179 ///
180180 /// Possible values are defined in: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html
181- final int ? sdkInt;
181+ final int sdkInt;
182182
183183 /// The user-visible security patch level.
184- final String ? securityPatch;
184+ final String securityPatch;
185185
186186 /// Deserializes from the map message received from [_kChannel] .
187187 static AndroidBuildVersion _fromMap (Map <String , dynamic > map) {
188188 return AndroidBuildVersion ._(
189- baseOS: map['baseOS' ],
190- codename: map['codename' ],
191- incremental: map['incremental' ],
192- previewSdkInt: map['previewSdkInt' ],
193- release: map['release' ],
194- sdkInt: map['sdkInt' ],
195- securityPatch: map['securityPatch' ],
189+ baseOS: map['baseOS' ] ?? '' ,
190+ codename: map['codename' ] ?? '' ,
191+ incremental: map['incremental' ] ?? '' ,
192+ previewSdkInt: map['previewSdkInt' ] ?? '' ,
193+ release: map['release' ] ?? '' ,
194+ sdkInt: map['sdkInt' ] ?? '' ,
195+ securityPatch: map['securityPatch' ] ?? '' ,
196196 );
197197 }
198198}
0 commit comments