HiveList<HiveObjectMixin>?' can't be assigned to a variable of type 'HiveList<HiveObjectMixin>
- Dominant language
- Dart
- Stars
- 4.4k
- Forks
- 449
- PR merge metrics
- No merged PRs in 30d
Description
after build created database structure i get this error on `TABLE.g.dart` file:
error: A value of type 'HiveList?' can't be assigned to a variable of type 'HiveList'. (invalid_assignment at [XXXX] lib/database/user.g.dart:22)
for example:
```dart
return User()
..nameFamily = fields[0] as String
..mobileNumber = fields[1] as String
..address = (fields[2] as HiveList)?.castHiveList()
..wallet = (fields[3] as HiveList)?.castHiveList()
..transactions = (fields[4] as HiveList)?.castHiveList()
..categories = (fields[5] as HiveList)?.castHiveList()
..services = (fields[6] as HiveList)?.castHiveList();
```
removing `?` from `HiveList)?.castHiveList()` cause resolve this problem
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.