커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
로그아웃 후 회원정보를 눌렀을때 [Display Name] andrew@domainname.com
[왕초보] 노코드로 수익형 AI 앱 만들기
3주차
북마크
변*수
댓글
6
추천
0
조회수
20
조회수
20
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


제목과 같습니다.

회원정보를 눌렀을때 [Display Name] andrew@domainname.com이 기본값으로 되어 있습니다.


로그인 (예:a@aaa.com) 후 로그아웃하면 또 위에 값으로 로그아웃되어 있어

재차 로그아웃을 해야 하는 경우가 발생합니다.






작성한 코드 및 에러 메세지

import '/auth/firebase_auth/auth_util.dart';

import '/components/draw_menu_widget.dart';

import '/flutter_flow/flutter_flow_animations.dart';

import '/flutter_flow/flutter_flow_theme.dart';

import '/flutter_flow/flutter_flow_util.dart';

import '/flutter_flow/flutter_flow_widgets.dart';

import 'dart:math';

import 'dart:ui';

import 'package:cached_network_image/cached_network_image.dart';

import 'package:flutter/material.dart';

import 'package:flutter/scheduler.dart';

import 'package:flutter_animate/flutter_animate.dart';

import 'package:google_fonts/google_fonts.dart';

import 'package:provider/provider.dart';


import 'auth2_profile_model.dart';

export 'auth2_profile_model.dart';


class Auth2ProfileWidget extends StatefulWidget {

 const Auth2ProfileWidget({super.key});


 @override

 State<Auth2ProfileWidget> createState() => _Auth2ProfileWidgetState();

}


class _Auth2ProfileWidgetState extends State<Auth2ProfileWidget>

  with TickerProviderStateMixin {

 late Auth2ProfileModel _model;


 final scaffoldKey = GlobalKey<ScaffoldState>();


 final animationsMap = <String, AnimationInfo>{};


 @override

 void initState() {

  super.initState();

  _model = createModel(context, () => Auth2ProfileModel());


  animationsMap.addAll({

   'containerOnPageLoadAnimation': AnimationInfo(

    trigger: AnimationTrigger.onPageLoad,

    effectsBuilder: () => [

     VisibilityEffect(duration: 1.ms),

     FadeEffect(

      curve: Curves.easeInOut,

      delay: 0.0.ms,

      duration: 800.0.ms,

      begin: 0.0,

      end: 1.0,

     ),

     ScaleEffect(

      curve: Curves.easeInOut,

      delay: 0.0.ms,

      duration: 800.0.ms,

      begin: Offset(3.0, 3.0),

      end: Offset(1.0, 1.0),

     ),

    ],

   ),

   'buttonOnPageLoadAnimation': AnimationInfo(

    trigger: AnimationTrigger.onPageLoad,

    effectsBuilder: () => [

     VisibilityEffect(duration: 400.ms),

     FadeEffect(

      curve: Curves.easeInOut,

      delay: 400.0.ms,

      duration: 600.0.ms,

      begin: 0.0,

      end: 1.0,

     ),

     MoveEffect(

      curve: Curves.easeInOut,

      delay: 400.0.ms,

      duration: 600.0.ms,

      begin: Offset(0.0, 60.0),

      end: Offset(0.0, 0.0),

     ),

    ],

   ),

  });


  WidgetsBinding.instance.addPostFrameCallback((_) => safeSetState(() {}));

 }


 @override

 void dispose() {

  _model.dispose();


  super.dispose();

 }


 @override

 Widget build(BuildContext context) {

  return GestureDetector(

   onTap: () {

    FocusScope.of(context).unfocus();

    FocusManager.instance.primaryFocus?.unfocus();

   },

   child: Scaffold(

    key: scaffoldKey,

    backgroundColor: FlutterFlowTheme.of(context).secondaryBackground,

    drawer: Drawer(

     elevation: 16,

     child: wrapWithModel(

      model: _model.drawMenuModel,

      updateCallback: () => safeSetState(() {}),

      child: DrawMenuWidget(),

     ),

    ),

    appBar: AppBar(

     backgroundColor: FlutterFlowTheme.of(context).primary,

     automaticallyImplyLeading: true,

     title: Text(

      'Page Title',

      style: FlutterFlowTheme.of(context).headlineMedium.override(

         fontFamily: 'Pretendard',

         color: Colors.white,

         fontSize: 22,

         letterSpacing: 0.0,

        ),

     ),

     actions: [],

     centerTitle: false,

     elevation: 2,

    ),

    body: Align(

     alignment: AlignmentDirectional(0, -1),

     child: Container(

      width: double.infinity,

      constraints: BoxConstraints(

       maxWidth: 770,

      ),

      decoration: BoxDecoration(

       color: FlutterFlowTheme.of(context).secondaryBackground,

      ),

      child: Column(

       mainAxisSize: MainAxisSize.max,

       crossAxisAlignment: CrossAxisAlignment.start,

       children: [

        Container(

         height: 180,

         child: Stack(

          children: [

           Padding(

            padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 16),

            child: Container(

             width: double.infinity,

             height: 140,

             decoration: BoxDecoration(

              gradient: LinearGradient(

               colors: [

                FlutterFlowTheme.of(context).primary,

                FlutterFlowTheme.of(context).error,

                FlutterFlowTheme.of(context).tertiary

               ],

               stops: [0, 0.5, 1],

               begin: AlignmentDirectional(-1, -1),

               end: AlignmentDirectional(1, 1),

              ),

             ),

             child: Container(

              width: 100,

              height: 200,

              decoration: BoxDecoration(

               gradient: LinearGradient(

                colors: [

                 Color(0x00FFFFFF),

                 FlutterFlowTheme.of(context)

                   .secondaryBackground

                ],

                stops: [0, 1],

                begin: AlignmentDirectional(0, -1),

                end: AlignmentDirectional(0, 1),

               ),

              ),

             ),

            ).animateOnPageLoad(

              animationsMap['containerOnPageLoadAnimation']!),

           ),

           Align(

            alignment: AlignmentDirectional(-1, 1),

            child: Padding(

             padding: EdgeInsetsDirectional.fromSTEB(24, 0, 0, 0),

             child: Container(

              width: 90,

              height: 90,

              decoration: BoxDecoration(

               color: FlutterFlowTheme.of(context).accent2,

               shape: BoxShape.circle,

               border: Border.all(

                color: FlutterFlowTheme.of(context).secondary,

                width: 2,

               ),

              ),

              child: Padding(

               padding: EdgeInsets.all(4),

               child: AuthUserStreamWidget(

                builder: (context) => ClipRRect(

                 borderRadius: BorderRadius.circular(50),

                 child: CachedNetworkImage(

                  fadeInDuration: Duration(milliseconds: 500),

                  fadeOutDuration:

                    Duration(milliseconds: 500),

                  imageUrl: currentUserPhoto,

                  width: 100,

                  height: 100,

                  fit: BoxFit.cover,

                 ),

                ),

               ),

              ),

             ),

            ),

           ),

          ],

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(24, 12, 0, 0),

         child: AuthUserStreamWidget(

          builder: (context) => Text(

           currentUserDisplayName,

           style: FlutterFlowTheme.of(context).displaySmall.override(

              fontFamily: 'Pretendard',

              letterSpacing: 0.0,

             ),

          ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(24, 4, 0, 16),

         child: Text(

          valueOrDefault<String>(

           currentUserEmail,

           'andrew@domainname.com',

          ),

          style: FlutterFlowTheme.of(context).labelLarge.override(

             fontFamily: 'Pretendard',

             color: FlutterFlowTheme.of(context).primary,

             letterSpacing: 0.0,

            ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(24, 4, 0, 0),

         child: Text(

          'Your Account',

          style: FlutterFlowTheme.of(context).labelMedium.override(

             fontFamily: 'Pretendard',

             letterSpacing: 0.0,

            ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(16, 12, 16, 0),

         child: InkWell(

          splashColor: Colors.transparent,

          focusColor: Colors.transparent,

          hoverColor: Colors.transparent,

          highlightColor: Colors.transparent,

          onTap: () async {

           context.pushNamed('auth_2_EditProfile');

          },

          child: Container(

           width: double.infinity,

           height: 60,

           decoration: BoxDecoration(

            color: FlutterFlowTheme.of(context).secondaryBackground,

            boxShadow: [

             BoxShadow(

              blurRadius: 3,

              color: Color(0x33000000),

              offset: Offset(

               0,

               1,

              ),

             )

            ],

            borderRadius: BorderRadius.circular(8),

            shape: BoxShape.rectangle,

            border: Border.all(

             color: FlutterFlowTheme.of(context).alternate,

             width: 1,

            ),

           ),

           child: Padding(

            padding: EdgeInsets.all(12),

            child: Row(

             mainAxisSize: MainAxisSize.max,

             children: [

              Icon(

               Icons.account_circle_outlined,

               color: FlutterFlowTheme.of(context).secondaryText,

               size: 24,

              ),

              Padding(

               padding:

                 EdgeInsetsDirectional.fromSTEB(12, 0, 0, 0),

               child: Text(

                'Edit Profile',

                style: FlutterFlowTheme.of(context)

                  .labelLarge

                  .override(

                   fontFamily: 'Pretendard',

                   letterSpacing: 0.0,

                  ),

               ),

              ),

              Expanded(

               child: Align(

                alignment: AlignmentDirectional(0.9, 0),

                child: Icon(

                 Icons.arrow_forward_ios,

                 color: FlutterFlowTheme.of(context)

                   .secondaryText,

                 size: 18,

                ),

               ),

              ),

             ],

            ),

           ),

          ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(24, 16, 0, 0),

         child: Text(

          'App Settings',

          style: FlutterFlowTheme.of(context).labelMedium.override(

             fontFamily: 'Pretendard',

             letterSpacing: 0.0,

            ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(16, 12, 16, 0),

         child: Container(

          width: double.infinity,

          height: 60,

          decoration: BoxDecoration(

           color: FlutterFlowTheme.of(context).secondaryBackground,

           boxShadow: [

            BoxShadow(

             blurRadius: 3,

             color: Color(0x33000000),

             offset: Offset(

              0,

              1,

             ),

            )

           ],

           borderRadius: BorderRadius.circular(8),

           shape: BoxShape.rectangle,

           border: Border.all(

            color: FlutterFlowTheme.of(context).alternate,

            width: 1,

           ),

          ),

          child: Padding(

           padding: EdgeInsets.all(12),

           child: Row(

            mainAxisSize: MainAxisSize.max,

            children: [

             Icon(

              Icons.help_outline_rounded,

              color: FlutterFlowTheme.of(context).secondaryText,

              size: 24,

             ),

             Padding(

              padding:

                EdgeInsetsDirectional.fromSTEB(12, 0, 0, 0),

              child: Text(

               'Support',

               style: FlutterFlowTheme.of(context)

                 .labelLarge

                 .override(

                  fontFamily: 'Pretendard',

                  letterSpacing: 0.0,

                 ),

              ),

             ),

             Expanded(

              child: Align(

               alignment: AlignmentDirectional(0.9, 0),

               child: Icon(

                Icons.arrow_forward_ios,

                color:

                  FlutterFlowTheme.of(context).secondaryText,

                size: 18,

               ),

              ),

             ),

            ],

           ),

          ),

         ),

        ),

        Padding(

         padding: EdgeInsetsDirectional.fromSTEB(16, 12, 16, 0),

         child: Container(

          width: double.infinity,

          height: 60,

          decoration: BoxDecoration(

           color: FlutterFlowTheme.of(context).secondaryBackground,

           boxShadow: [

            BoxShadow(

             blurRadius: 3,

             color: Color(0x33000000),

             offset: Offset(

              0,

              1,

             ),

            )

           ],

           borderRadius: BorderRadius.circular(8),

           shape: BoxShape.rectangle,

           border: Border.all(

            color: FlutterFlowTheme.of(context).alternate,

            width: 1,

           ),

          ),

          child: Padding(

           padding: EdgeInsets.all(12),

           child: Row(

            mainAxisSize: MainAxisSize.max,

            children: [

             Icon(

              Icons.privacy_tip_rounded,

              color: FlutterFlowTheme.of(context).secondaryText,

              size: 24,

             ),

             Padding(

              padding:

                EdgeInsetsDirectional.fromSTEB(12, 0, 0, 0),

              child: Text(

               'Terms of Service',

               style: FlutterFlowTheme.of(context)

                 .labelLarge

                 .override(

                  fontFamily: 'Pretendard',

                  letterSpacing: 0.0,

                 ),

              ),

             ),

             Expanded(

              child: Align(

               alignment: AlignmentDirectional(0.9, 0),

               child: Icon(

                Icons.arrow_forward_ios,

                color:

                  FlutterFlowTheme.of(context).secondaryText,

                size: 18,

               ),

              ),

             ),

            ],

           ),

          ),

         ),

        ),

        Align(

         alignment: AlignmentDirectional(0, 0),

         child: Padding(

          padding: EdgeInsetsDirectional.fromSTEB(0, 16, 0, 0),

          child: FFButtonWidget(

           onPressed: () async {

            GoRouter.of(context).prepareAuthEvent();

            await authManager.signOut();

            GoRouter.of(context).clearRedirectLocation();


            context.goNamedAuth('temp_account', context.mounted);

           },

           text: 'Log Out',

           options: FFButtonOptions(

            width: 150,

            height: 44,

            padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),

            iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),

            color: FlutterFlowTheme.of(context).primaryBackground,

            textStyle:

              FlutterFlowTheme.of(context).bodyLarge.override(

                 fontFamily: 'Pretendard',

                 letterSpacing: 0.0,

                ),

            elevation: 0,

            borderSide: BorderSide(

             color: FlutterFlowTheme.of(context).alternate,

             width: 1,

            ),

            borderRadius: BorderRadius.circular(12),

           ),

          ).animateOnPageLoad(

            animationsMap['buttonOnPageLoadAnimation']!),

         ),

        ),

       ],

      ),

     ),

    ),

   ),

  );

 }

}


취소
 공유
취소
댓글 0
댓글 알림
나의얼굴