@@ -2,106 +2,89 @@ import 'package:appflowy/env/cloud_env.dart';
22import 'package:appflowy/generated/flowy_svgs.g.dart' ;
33import 'package:appflowy/generated/locale_keys.g.dart' ;
44import 'package:appflowy/user/presentation/screens/sign_in_screen/widgets/widgets.dart' ;
5- import 'package:appflowy_editor/appflowy_editor.dart' ;
65import 'package:easy_localization/easy_localization.dart' ;
76import 'package:flowy_infra_ui/flowy_infra_ui.dart' ;
7+ import 'package:flutter/foundation.dart' ;
88import 'package:flutter/material.dart' ;
99
1010class MobileSignInScreen extends StatelessWidget {
11- const MobileSignInScreen ({super .key, required this .isLoading});
12- final bool isLoading;
11+ const MobileSignInScreen ({
12+ super .key,
13+ });
1314
1415 @override
1516 Widget build (BuildContext context) {
1617 const double spacing = 16 ;
17- // Welcome to Appflowy
18- final welcomeString = LocaleKeys .welcomeText.tr ();
19- final style = Theme .of (context);
18+ final colorScheme = Theme .of (context).colorScheme;
2019 return Scaffold (
21- resizeToAvoidBottomInset: false ,
22- body: isLoading
23- ? // TODO(yijing): improve loading effect in the future
24- const Center (
25- child: Column (
26- mainAxisAlignment: MainAxisAlignment .center,
27- children: [
28- Text ('Signing in...' ),
29- VSpace (spacing),
30- CircularProgressIndicator (),
31- ],
32- ),
33- )
34- : Padding (
35- padding: const EdgeInsets .fromLTRB (50 , 0 , 50 , 30 ),
36- child: Column (
37- children: [
38- const Spacer (
39- flex: 4 ,
40- ),
41- const FlowySvg (
42- FlowySvgs .flowy_logo_xl,
43- size: Size .square (64 ),
44- blendMode: null ,
45- ),
46- const VSpace (spacing * 2 ),
47- // Welcome to
48- Text (
49- welcomeString.substring (0 , welcomeString.length - 8 ),
50- style: style.textTheme.displayMedium,
51- textAlign: TextAlign .center,
52- ),
53- // Appflowy
54- Text (
55- welcomeString.substring (welcomeString.length - 8 ),
56- style: style.textTheme.displayLarge,
57- textAlign: TextAlign .center,
58- ),
59- const VSpace (spacing),
60- // TODO(yijing): confirm the subtitle before release app
61- Text (
62- 'You are in charge of your data and customizations.' ,
63- style: style.textTheme.bodyMedium? .copyWith (
64- color: style.colorScheme.onSecondary,
65- ),
66- textAlign: TextAlign .center,
67- ),
68- const Spacer (
69- flex: 2 ,
70- ),
71- if (! PlatformExtension .isMobile) ...[
72- const SignInAnonymousButton (),
73- const VSpace (spacing),
74- ],
75- if (isAuthEnabled) ...[
76- if (! PlatformExtension .isMobile) ...[
77- Row (
78- mainAxisAlignment: MainAxisAlignment .center,
79- children: [
80- const Expanded (child: Divider ()),
81- Padding (
82- padding: const EdgeInsets .symmetric (horizontal: 8 ),
83- child: Text (
84- LocaleKeys .signIn_or.tr (),
85- style: style.textTheme.bodyMedium? .copyWith (
86- color: style.colorScheme.onSecondary,
87- ),
88- ),
89- ),
90- const Expanded (child: Divider ()),
91- ],
20+ body: Padding (
21+ padding: const EdgeInsets .symmetric (vertical: 50 , horizontal: 40 ),
22+ child: Column (
23+ children: [
24+ const Spacer (
25+ flex: 4 ,
26+ ),
27+ const FlowySvg (
28+ FlowySvgs .flowy_logo_xl,
29+ size: Size .square (64 ),
30+ blendMode: null ,
31+ ),
32+ const VSpace (spacing * 2 ),
33+ // Welcome to
34+ FlowyText (
35+ LocaleKeys .welcomeTo.tr (),
36+ textAlign: TextAlign .center,
37+ fontSize: 32 ,
38+ fontWeight: FontWeight .w700,
39+ ),
40+ // AppFlowy
41+ FlowyText (
42+ LocaleKeys .appName.tr (),
43+ textAlign: TextAlign .center,
44+ fontSize: 32 ,
45+ color: const Color (0xFF00BCF0 ),
46+ fontWeight: FontWeight .w700,
47+ ),
48+ const VSpace (spacing),
49+ const Spacer (
50+ flex: 2 ,
51+ ),
52+
53+ // disable anonymous sign in release mode.
54+ if (kDebugMode) ...[
55+ const SignInAnonymousButton (),
56+ const VSpace (spacing),
57+ ],
58+
59+ // if the cloud env is enabled, show the third-party sign in buttons.
60+ if (isAuthEnabled) ...[
61+ if (kDebugMode) ...[
62+ Row (
63+ mainAxisAlignment: MainAxisAlignment .center,
64+ children: [
65+ const Expanded (child: Divider ()),
66+ Padding (
67+ padding: const EdgeInsets .symmetric (horizontal: 8 ),
68+ child: FlowyText (
69+ LocaleKeys .signIn_or.tr (),
70+ color: colorScheme.onSecondary,
9271 ),
93- const VSpace (spacing),
94- ],
95- const ThirdPartySignInButtons (),
96- ],
97- if (! isAuthEnabled)
98- const Spacer (
99- flex: 2 ,
10072 ),
101- const VSpace (spacing),
102- ],
73+ const Expanded (child: Divider ()),
74+ ],
75+ ),
76+ const VSpace (spacing),
77+ ],
78+ const ThirdPartySignInButtons (),
79+ ],
80+ if (! isAuthEnabled)
81+ const Spacer (
82+ flex: 2 ,
10383 ),
104- ),
84+ const VSpace (spacing),
85+ ],
86+ ),
87+ ),
10588 );
10689 }
10790}
0 commit comments