feat: welcome screen UI improvement (#3057)

This commit is contained in:
Yijing Huang 2023-07-31 10:01:12 -05:00 committed by GitHub
parent 338e342410
commit 3039944c74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 94 deletions

View File

@ -7,7 +7,7 @@ import 'package:appflowy/core/config/kv_keys.dart';
import 'package:appflowy/startup/startup.dart';
class WindowSizeManager {
static const double minWindowHeight = 400.0;
static const double minWindowHeight = 600.0;
static const double minWindowWidth = 800.0;
static const width = 'width';

View File

@ -171,9 +171,7 @@ class CreateFolderWidgetState extends State<CreateFolderWidget> {
const VSpace(4.0),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: Row(
children: [
_buildTextButton(
child: _buildTextButton(
context,
LocaleKeys.settings_files_create.tr(),
() async {
@ -187,8 +185,6 @@ class CreateFolderWidgetState extends State<CreateFolderWidget> {
}
},
),
],
),
)
],
);
@ -218,13 +214,10 @@ Widget _buildTextButton(
String title,
VoidCallback onPressed,
) {
return SizedBox(
width: 60,
child: SecondaryTextButton(
return SecondaryTextButton(
title,
mode: SecondaryTextButtonMode.small,
onPressed: onPressed,
),
);
}
@ -243,17 +236,18 @@ class _FolderCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
const cardSpacing = 16.0;
return Card(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 16.0,
horizontal: 16.0,
vertical: cardSpacing,
horizontal: cardSpacing,
),
child: Row(
children: [
if (icon != null)
Padding(
padding: const EdgeInsets.only(right: 20),
padding: const EdgeInsets.only(right: cardSpacing),
child: icon!,
),
Expanded(
@ -280,7 +274,7 @@ class _FolderCard extends StatelessWidget {
),
),
if (trailing != null) ...[
const HSpace(40),
const HSpace(cardSpacing),
trailing!,
],
],

View File

@ -85,7 +85,6 @@ class _SkipLogInScreenState extends State<SkipLogInScreen> {
),
),
const Spacer(),
const VSpace(48),
const SkipLoginPageFooter(),
const VSpace(20),
],
@ -172,7 +171,10 @@ class SubscribeButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
return Wrap(
alignment: WrapAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
@ -182,6 +184,7 @@ class SubscribeButtons extends StatelessWidget {
),
FlowyTextButton(
LocaleKeys.githubStarText.tr(),
padding: const EdgeInsets.symmetric(horizontal: 4),
fontWeight: FontWeight.w500,
fontColor: Theme.of(context).colorScheme.primary,
hoverColor: Colors.transparent,
@ -190,13 +193,19 @@ class SubscribeButtons extends StatelessWidget {
'https://github.com/AppFlowy-IO/appflowy',
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
FlowyText.regular(
LocaleKeys.and.tr(),
fontSize: FontSizes.s12,
),
FlowyTextButton(
LocaleKeys.subscribeNewsletterText.tr(),
overflow: TextOverflow.ellipsis,
padding: const EdgeInsets.symmetric(horizontal: 4.0),
fontWeight: FontWeight.w500,
fontColor: Theme.of(context).colorScheme.primary,
hoverColor: Colors.transparent,
@ -204,6 +213,8 @@ class SubscribeButtons extends StatelessWidget {
onPressed: () => _launchURL('https://www.appflowy.io/blog'),
),
],
),
],
);
}
@ -224,8 +235,6 @@ class LanguageSelectorOnWelcomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocBuilder<AppearanceSettingsCubit, AppearanceSettingsState>(
builder: (context, state) {
return AppFlowyPopover(
offset: const Offset(0, -450),
direction: PopoverDirection.bottomWithRightAligned,
@ -240,10 +249,15 @@ class LanguageSelectorOnWelcomePage extends StatelessWidget {
size: Size.square(20),
),
const HSpace(4),
FlowyText(
languageFromLocale(state.locale),
Builder(
builder: (context) {
final currentLocale =
context.watch<AppearanceSettingsCubit>().state.locale;
return FlowyText(
languageFromLocale(currentLocale),
);
},
),
// const HSpace(4),
const FlowySvg(
name: 'home/drop_down_hide',
size: Size.square(20),
@ -262,8 +276,6 @@ class LanguageSelectorOnWelcomePage extends StatelessWidget {
);
},
);
},
);
}
}

View File

@ -195,6 +195,7 @@ class FlowyTextButton extends StatelessWidget {
highlightColor: Colors.transparent,
elevation: 0,
constraints: constraints,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: () {},
child: child,
);