mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 23:08:59 +00:00
Compass app (#2446)
This commit is contained in:
27
compass_app/server/lib/model/user/user.dart
Normal file
27
compass_app/server/lib/model/user/user.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright 2024 The Flutter team. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user