1차 보완(0.1.1+14) 내용 합치기
This commit is contained in:
@@ -215,6 +215,7 @@ class _SimpleLoginScreenState extends State<SimpleLoginScreen> {
|
||||
bool _busy = false;
|
||||
|
||||
Future<void> _signIn(SocialProvider provider) async {
|
||||
if (_busy) return;
|
||||
if (widget.signUp) {
|
||||
final agreed = await Navigator.of(context).push<Set<String>>(
|
||||
MaterialPageRoute(builder: (_) => const TermsScreen()),
|
||||
@@ -223,6 +224,8 @@ class _SimpleLoginScreenState extends State<SimpleLoginScreen> {
|
||||
// 인증 뒤 온보딩이 이 동의를 서버에 기록한다(약관 단계를 다시 묻지 않는다).
|
||||
widget.auth.pendingConsent = agreed;
|
||||
}
|
||||
// 제공자 화면에서 돌아온 뒤에도 서버 토큰 교환 · 로그인에 몇 초 걸린다(Kakao · LINE).
|
||||
// 끝날 때까지 화면 전체를 막고 진행 표시를 띄운다 — 다시 누르지 못하게.
|
||||
setState(() => _busy = true);
|
||||
final outcome = await widget.auth.signIn(provider, signUp: widget.signUp);
|
||||
if (!mounted) return;
|
||||
@@ -264,7 +267,7 @@ class _SimpleLoginScreenState extends State<SimpleLoginScreen> {
|
||||
for (final kind in _figmaOrder)
|
||||
...widget.auth.providers.where((p) => p.provider == kind),
|
||||
];
|
||||
return Scaffold(
|
||||
final scaffold = Scaffold(
|
||||
appBar: AppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [
|
||||
@@ -347,9 +350,26 @@ class _SimpleLoginScreenState extends State<SimpleLoginScreen> {
|
||||
),
|
||||
),
|
||||
);
|
||||
return PopScope(
|
||||
canPop: !_busy,
|
||||
child: Stack(children: [scaffold, if (_busy) const BlockingProgress()]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 진행 중 화면 전체를 막는 반투명 막 + 가운데 진행 표시.
|
||||
class BlockingProgress extends StatelessWidget {
|
||||
const BlockingProgress({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const Stack(
|
||||
children: [
|
||||
ModalBarrier(dismissible: false, color: Color(0x8A000000)),
|
||||
Center(child: CircularProgressIndicator()),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
const _figmaOrder = [
|
||||
AuthProviderKind.apple,
|
||||
AuthProviderKind.google,
|
||||
@@ -371,10 +391,12 @@ String providerButtonLabel(
|
||||
: t.authProviderLogin(kind.name);
|
||||
}
|
||||
|
||||
/// 로그인 결과 안내. 취소 · 중단도 안내한다 — 1차 검수 R01 「취소 · 실패 시 로그인 성공으로 처리하지 않음 ·
|
||||
/// 오류 안내와 정상 재시도 가능」. 아무 말 없이 화면이 그대로면 사용자는 앱이 멈춘 줄 안다.
|
||||
String? authNotice(AuthOutcome outcome, [AppLocalizations? l10n]) =>
|
||||
switch (outcome) {
|
||||
AuthSucceeded() => null,
|
||||
AuthCancelled() => null,
|
||||
AuthCancelled() => (l10n ?? koL10n).authSocialCancelled,
|
||||
AuthFailed(:final code, :final message) => '[$code] $message',
|
||||
AuthNotConfigured(:final provider) =>
|
||||
(l10n ?? koL10n).authNotConfiguredNotice(provider.shortName),
|
||||
|
||||
Reference in New Issue
Block a user