i am using realm: ^3.1.0 for the very first time but i can’t get schema form my model class.
This is my model class which is private according to the package
import 'dart:developer';
import 'package:realm/realm.dart';
@RealmModel()
class _$ProjectModal{
@RealmPropertyType.int
late int project_id;
@RealmPropertyType.string
late String project_name;
@RealmPropertyType.int
late int student_id;
@RealmPropertyType.string
late String? image_url;
}
class ProjectTmp extends _$ProjectModal {
int project_id;
String project_name;
int student_id;
String? image_url;
ProjectTmp({required this.project_id, required this.project_name, required this.student_id, required this.image_url});
factory ProjectTmp.fromMap({required Map data}) {
log(data['image_url'].runtimeType.toString());
return ProjectTmp(
project_id: data['project_id'],
project_name: data['project_name'],
student_id: data['student_id'],
image_url: data['image_url'],
);
}
}
And Here i want to access schema
import 'package:realm/realm.dart';
import '../data/modal/project_modal.dart';
class RealmHelper{
RealmHelper._();
static final RealmHelper instance = RealmHelper._();
var config = Configuration.local([ProjectModal.schema]);// Shows error at .schema
}
But it shows error at schema .
I have tried using it’s Child class still i stucks at there.
Have you ever used this package.
i am expecting to use schema directly without getting error.