Unhandled Exception: 'package:realm_dart/src/helpers.dart': error: line 26 pos 3: native function 'Helpers_invokeStatic' (2 arguments) cannot be found
While starting the application its working perfectly and fetching data but when I restart the application it throws above error.
main.dart
void ints() {
print("initState");
var config = new Configuration();
config.schema.add(Car);
var realm = new Realm(config);
realm.write(() {
print("realm write callback");
var car = realm.create(new Car()..make = "Audi");
print("The car is ${car.make}");
car.make = "VW";
print("The car is ${car.make}");
});
var objects = realm.objects<Car>();
var indexedCar = objects[1];
print('here');
print("The indexedCar is ${indexedCar.make}");
}
Configuration.dart
add(Type type) {
print(type);
var schema = Helpers.invokeStatic(type, "getSchema");
//set the static field on the T class.
TypeStaticProperties.setValue(type, "schema", schema);
// _generateSchema(type);
innerList.add(type);
}
Helpers.dart
class Helpers {
static DateTime createDateTime(int miliseconds) {
return DateTime.fromMillisecondsSinceEpoch(miliseconds, isUtc: true);
}
static dynamic invokeStatic(Type type, String name) native "Helpers_invokeStatic";
}