import 'package:flutter/foundation.dart';

import 'package:pshared/models/account/base.dart';
import 'package:pshared/models/describable.dart';


@immutable
class Account extends AccountBase {
  final String login;
  final String locale;

  const Account({
    required super.storable,
    required super.describable,
    required super.avatarUrl,
    required super.lastName,
    required this.login,
    required this.locale,
  });

  @override
  Account copyWith({
    Describable? describable,
    String? lastName,
    String? Function()? avatarUrl,
    String? locale,
  }) => Account(
    storable: storable,
    describable: describableCopyWithOther(this.describable, describable),
    lastName: lastName ?? this.lastName,
    avatarUrl: avatarUrl != null ? avatarUrl() : this.avatarUrl,
    login: login,
    locale: locale ?? this.locale,
  );
}