mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
483 B
24 lines
483 B
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'user.freezed.dart';
|
|
part 'user.g.dart';
|
|
|
|
@freezed
|
|
abstract class User with _$User {
|
|
const factory User({
|
|
/// The user's ID.
|
|
required String id,
|
|
|
|
/// The user's name.
|
|
required String name,
|
|
|
|
/// The user's email.
|
|
required String email,
|
|
|
|
/// The user's picture URL.
|
|
required String picture,
|
|
}) = _User;
|
|
|
|
factory User.fromJson(Map<String, Object?> json) => _$UserFromJson(json);
|
|
}
|