Dart - this keyword Last Updated : 02 Apr, 2025 Comments Improve Suggest changes 4 Likes Like Report this keyword represents an implicit object pointing to the current class object. It refers to the current instance of the class in a method or constructor. The this keyword is mainly used to eliminate the ambiguity between class attributes and parameters with the same name. When the class attributes and the parameter names are the same, this keyword is used to avoid ambiguity by prefixing class attributes with this keyword. this keyword can be used to refer to any member of the current object from within an instance method or a constructor.Uses of this KeywordIt can be used to refer to the instance variable of the current class.It can be used to make or initiate a current class constructor.It can be passed as an argument in the method call.It can be passed as an argument in the constructor call.It can be used to make a current class method.It can be used to return the current class Instance.Referring to Instance VariablesExample : Dart // Dart program to illustrate // this keyword void main() { Student s1 = new Student('S001'); } class Student { // defining local st_id variable var st_id; Student(var st_id) { // using this keyword this.st_id = st_id; print("GFG - Dart THIS Example"); print("The Student ID is : ${st_id}"); } } Output:GFG - Dart THIS ExampleThe Student ID is : S001Returning the Current Class InstanceExample : Dart // Dart program to illustrate // this keyword void main() { mob m1 = new mob(); m1.Car("M101"); } class mob { String mobile = ""; Car(String mobile) { // use of this keyword this.mobile = mobile; print("The mobile is : ${mobile}"); } } Output:The mobile is : M101ConclusionThe this keyword in Dart is a powerful tool that provides clear and unambiguous access to class members. It enhances code readability, enables constructor chaining, and allows method calls within the same instance. By utilizing this, developers can write cleaner and more efficient Dart programs. Comment N nitin_sharma Follow 4 Improve N nitin_sharma Follow 4 Improve Article Tags : Dart Dart-Keywords Explore Dart Tutorial 7 min read BasicsIntroduction to Dart Programming Language 4 min read Dart SDK Installation 4 min read Dart - Comments 2 min read Dart - Variables 5 min read Operators in Dart 11 min read Dart - Standard Input Output 3 min read Data TypesDart - Data Types 8 min read Basics of Numbers in Dart 6 min read Strings in Dart 6 min read Dart - Sets 6 min read Dart Programming - Map 7 min read Queues in Dart 3 min read Data Enumeration in Dart 3 min read Control FlowSwitch Case in Dart 2 min read Dart - Loops 4 min read Dart - Loop Control Statements (Break and Continue) 4 min read Labels in Dart 2 min read Key FunctionsDart - Anonymous Functions 2 min read Dart - main() Function 2 min read Dart - Common Collection Methods 2 min read How to Exit a Dart Application Unconditionally? 2 min read Dart - Getters and Setters 3 min read Dart - Classes And Objects 4 min read Object-Oriented ProgrammingDart - this keyword 2 min read Dart - Static Keyword 3 min read Dart - Super and This keyword 4 min read Dart - Concept of Inheritance 5 min read Instance and class methods in Dart 3 min read Method Overriding in Dart 3 min read Getter and Setter Methods in Dart 2 min read Abstract Classes in Dart 4 min read Dart - Builder Class 4 min read Concept of Callable Classes in Dart 4 min read Interface in Dart 3 min read Dart - extends Vs with Vs implements 4 min read Dart - Date and Time 3 min read Using await async in Dart 4 min read Dart UtilitiesHow to Combine Lists in Dart? 3 min read Dart - Finding Minimum and Maximum Value in a List 5 min read Dart - Splitting of String 1 min read Dart ProgramsDart - Sort a List 2 min read Dart - String toUpperCase() Function with Examples 1 min read Dart - Convert All Characters of a String in Lowercase 1 min read How to Replace a Substring of a String in Dart? 2 min read How to Check String is Empty or Not in Dart (Null Safety)? 1 min read Exception Handling in Dart 3 min read Assert Statements in Dart 3 min read Fallthrough Condition in Dart 3 min read Concept of Isolates in Dart 2 min read Advance ConceptsDart - Collections 7 min read Dart - Basics of Packages 2 min read Dart - String codeUnits Property 1 min read HTML Document Object Model and Dart Programming 3 min read Like