name27 / flutter

0 stars 0 forks source link

클래스, @override #86

Open name27 opened 1 year ago

name27 commented 1 year ago

image

class UserData {
  String id;
  DateTime birth;
  String email;
  DateTime lastLoginData;
  String name;
  String phoneNumber;

  UserData(
      {required this.id,
      required this.birth,
      required this.email,
      required this.lastLoginData,
      required this.name,
      required this.phoneNumber});

  @override
  String toString() {
    return '''id: $id
birth: $birth
email: $email
lastLoginData: $lastLoginData
name: $name
phoneNumber: $id''';
  }
}
void main() {
  UserData userData = UserData(
      id: 'sniperfactory',
      birth: DateTime.now(),
      email: 'sniperfactory@naver.com',
      lastLoginData: DateTime.now(),
      name: '스나이퍼',
      phoneNumber: '01023456789');

  print(userData);
}