Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart .. operator

void main() {
  Person()
    ..name = "John"
    ..age = 30
    ..sex = "Male"
    ..describeMyself();
}

class Person {
  String? name;
  int? age;
  String? sex;

  Person({this.name, this.age, this.sex});

  void describeMyself() {
    print('Hello my name is $name, I am $age years old');
  }
}
 
PREVIOUS NEXT
Tagged: #dart #operator
ADD COMMENT
Topic
Name
4+9 =