Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast running from WINDOWS flutter
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
**Steps to Reproduce**
Declare
`@HiveType(typeId: 1)
class Pings extends HiveObject {
@HiveField(0)
late String ip;
@HiveField(1)
late String mac; //mac
@HiveField(2)
late DateTime last_ping;
@HiveField(3)
bool connected=false;
@HiveField(4)
String user=" ";
@HiveField(5)
String pass=" ";
@HiveField(6)
String port=" ";
Pings({
required this.ip,
required this.mac, //mac
required this.last_ping,
required this.connected,
required this.user,
required this.pass,
required this.port
});
@override
String toString() {
return 'Pings{ip: $ip, mac: $mac, name: $last_ping, connected:$connected, user: $user, pass:$pass, port:$port }';
}
}`
Compile and works OK on flutter running on Android, but crash on start on flutter running on Windows with: "Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast running from WINDOWS flutter"
I think could be a database corrupted issue but can locate hive database path in Windows. Please provide path where hive stores databases in Windows?
Thanks and best regards
**Code sample**
```
Provide a few simple lines of code to show your problem.
```
**Version**
- Platform: iOS, Android, Mac, Windows, Linux, Web
- Flutter version: [e.g. 1.5.4]
- Hive version: [e.g. 0.5.0]
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.