Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Feat: 로그인유지 기능 구현 #11

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

seochan99
Copy link
Member

feat: 로그인유지 기능 구현

⛅️ 작업 내용

  • get dialog 리펙토링
  • 로그인 정보 기기값에 저장
  • 로그인/로그아웃 기기값 연결

유저정보 이용하는 방법

  final User? user;
                user != null
                    ? Text("오늘도 이어립스 해볼까요, ${user!.email}")
                    : const Text(
                        "로그인 하러가기",
                        style: TextStyle(color: Colors.blue),
                      ),

예시)

import 'package:earlips/views/auth/login_screen.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class ProfileHeader extends StatelessWidget {
  final User? user;

  const ProfileHeader({super.key, this.user});

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: GestureDetector(
        onTap: () => user != null ? null : Get.to(() => LoginScreen()),
        child: Container(
          color: Colors.white,
          child: Padding(
            padding: const EdgeInsets.fromLTRB(20, 62, 20, 24),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                // 유저 정보가 있으면 이메일을 보여주고, 없으면 로그인 버튼 보여줌
                user != null
                    ? Text("오늘도 이어립스 해볼까요, ${user!.email}")
                    : const Text(
                        "로그인 하러가기",
                        style: TextStyle(color: Colors.blue),
                      ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

feat: 로그인유지 기능 구현
Copy link
Contributor

@bunju20 bunju20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고많으셨습니다! 저도 후딱 할게요...

@bunju20 bunju20 merged commit 88f1dca into GDSC-DGU:develop Feb 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants