it seems like the issue is that you are trying to call a named constructor GaitPatient._internal that does not exist. To resolve this error, you need to define a named constructor _internal in your GaitPatient class.
However, instead of defining a new _internal constructor in GaitPatient, you can use the existing Patient._internal constructor by extending the Patient class and adding additional properties and factory constructors to the subclass. Here's an example of how you could do this:
class GaitPatient extends Patient {
final int strideLength;
GaitPatient._internal({required String id, required String name, required String family_name, required TemporalDate dob, required Gender gender, required double height_in_inches, List<Assessment>? Assessments, TemporalDateTime? createdAt, TemporalDateTime? updatedAt, required this.strideLength})
: super._internal(id: id, name: name, family_name: family_name, dob: dob, gender: gender, height_in_inches: height_in_inches, Assessments: Assessments, createdAt: createdAt, updatedAt: updatedAt);
factory GaitPatient({String? id, required String name, required String family_name, required TemporalDate dob, required Gender gender, required double height_in_inches, List<Assessment>? Assessments, TemporalDateTime? createdAt, TemporalDateTime? updatedAt, required int strideLength}) {
return GaitPatient._internal(
id: id == null ? UUID.getUUID() : id,
name: name,
family_name: family_name,
dob: dob,
gender: gender,
height_in_inches: height_in_inches,
Assessments: Assessments != null ? List<Assessment>.unmodifiable(Assessments) : Assessments,
createdAt: createdAt,
updatedAt: updatedAt,
strideLength: strideLength,
);
}
// Add additional factory constructors or methods here
}
In this example, we define a new class GaitPatient that extends the existing Patient class. We define a new property strideLength that is specific to GaitPatient, and we define a new named constructor GaitPatient._internal that calls the superclass constructor Patient._internal.
We also define a new factory constructor GaitPatient that calls the GaitPatient._internal constructor, passing in the new strideLength parameter as well as any other parameters that are required by the superclass constructor.
You can add additional factory constructors or methods to GaitPatient as needed. This approach allows you to reuse the existing implementation of Patient while also adding new properties and methods to the subclass.
Ready to level up your coding game? Uncover the realm of microservices with our cutting-edge Microservices Developer Certification!