Search code examples
flutterflutter-dependenciesflutter-isar

flutter: objects fields becoming null on creation in Isar inspector


I really liked Hive and recently i decided to try Isar as a local DB for my App ,However i'm facing a problem when trying to create an object into a collection using the Isar inspector as the fields are becoming null after creating the object .

User Class

import 'package:isar/isar.dart';
part 'user_model.g.dart';
@collection
class User {
  Id id = Isar.autoIncrement; // you can also use id = null to auto increment
  String? name;
  int? age;
}

Here is the class that i'm generating the collection from

Creating an object from Isar inspector

and here is a GIF to better discribe the problem fields are null on creation

any help or info is appreciated thank you


Solution

  • Simply put the text between double quotes on the inspector so instead of simple text be like that "simple text"