Get immediate access to this and over 1,500+ other videos and books.

Boost your skills with a raywenderlich.com Beginner subscription. With over 60+ video courses and our core foundational programming books bundled in one subscription, it’s simply the best investment you can make in your development career.

Understand Inheritance

This video was last updated on Jun 28 2022

Learn about the concept of class inheritance then see how it works using Dart.

Contributors

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.

Often times, you’ll define a class but you may need to make a slight alteration to a class for a specific situation. This is would result in you either copying and pasting the class to make your edits or you’d jury rig some solution that would increase the overall complexity of the class.

class Person {

}
String firstName;
String lastName;
Person(this.firstName, this.lastName);
String getFullName() => '$firstName $lastName';
class Student extends Person {

}
Student(this.firstName, this.lastName);
Student(String firstName, String lastName) : super(firstName, lastName);
Student(super.firstName, super.lastName) 
var student = Student('Ray', 'Wenderlich');
print(student.getFullName());
student.

Reviews

Comments