Skip to content

Instantly share code, notes, and snippets.

@freedive-cebu30
Last active April 7, 2022 05:39
Show Gist options
  • Save freedive-cebu30/8413fa4afef741e62a8660e1016ef499 to your computer and use it in GitHub Desktop.
Save freedive-cebu30/8413fa4afef741e62a8660e1016ef499 to your computer and use it in GitHub Desktop.
class Person {
String name;
int age;
// {}をつけている
Person({required this.name, required this.age});
}
void main(){
// インスタンス化する時に、nameとageを指定している
Person jojo = Person(name: 'jojo', age: 30);
print(jojo); // Instance of 'Person'
print(jojo.name); // jojo
print(jojo.age); // 30
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment