import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'login_info_model.g.dart';


@JsonSerializable()
class LoginInfo extends Equatable {
    final String token;
    final User user;

    factory LoginInfo.fromJson(Map<String, dynamic> json) =>
        _$LoginInfoFromJson(json);

    const LoginInfo({
        required this.token,
        required this.user,
    });

    @override
    List<Object?> get props => [token, user];
}

@JsonSerializable()
class User extends Equatable {
    final int id;
    final String name;

    const User({
        required this.id,
        required this.name,
    });

    factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

    @override
    List<Object?> get props =>
        [
            id,
            name,
        ];
}