Skip to content

Commit

Permalink
유저 모델 업데이트 ( FCM 토큰, 권한 설정용 String ) (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwson-automation authored Jul 25, 2024
2 parents 5158e74 + 00377df commit 9baa489
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/model/UserModel.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'generated/UserModel.freezed.dart';
part 'generated/UserModel.g.dart';

// TODO : User Class 추가
part 'generated/UserModel.g.dart';

@freezed
class UserModel with _$UserModel {
const factory UserModel({
required String userClass,
required String userId,
required String name,
required String email,
required int age,
required String profileImageUrl,
required DateTime createdAt,
String? profileImageUrl,
String? fcmToken,
}) = _UserModel;

factory UserModel.fromJson(Map<String, dynamic> json) => _$UserModelFromJson(json);
factory UserModel.fromJson(Map<String, dynamic> json) =>
_$UserModelFromJson(json);
}
3 changes: 2 additions & 1 deletion lib/providers/user/UserInfoProvider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ final userInfoNotifierProvider =
email: '',
age: 123,
profileImageUrl: '',
createdAt: DateTime.now())));
createdAt: DateTime.now(),
userClass: 'user')));
});

// 유저 정보 업데이트를 위한 노티파이어
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/mypage/signup/ConfirmationPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ConfirmationPage extends ConsumerWidget {
// 초기 나이 값, 필요에 따라 수정
profileImageUrl: '',
// 초기 프로필 사진 URL, 필요에 따라 수정
createdAt: DateTime.now() // 계정 생성 날짜
createdAt: DateTime.now(), userClass: 'user' // 계정 생성 날짜
);

// Firestore에 사용자 정보 저장
Expand Down

0 comments on commit 9baa489

Please sign in to comment.