chore: Polish login design

This commit is contained in:
Krille 2024-11-04 13:52:43 +01:00
commit 3a8bb47e2c
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 42 additions and 48 deletions

View file

@ -2804,5 +2804,6 @@
"supportPage": "Support page", "supportPage": "Support page",
"serverInformation": "Server information:", "serverInformation": "Server information:",
"name": "Name", "name": "Name",
"version": "Version" "version": "Version",
"website": "Website"
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

View file

@ -21,6 +21,7 @@ abstract class AppConfig {
static String _privacyUrl = static String _privacyUrl =
'https://github.com/krille-chan/fluffychat/blob/main/PRIVACY.md'; 'https://github.com/krille-chan/fluffychat/blob/main/PRIVACY.md';
static String get privacyUrl => _privacyUrl; static String get privacyUrl => _privacyUrl;
static const String website = 'https://fluffychat.im';
static const String enablePushTutorial = static const String enablePushTutorial =
'https://github.com/krille-chan/fluffychat/wiki/Push-Notifications-without-Google-Services'; 'https://github.com/krille-chan/fluffychat/wiki/Push-Notifications-without-Google-Services';
static const String encryptionTutorial = static const String encryptionTutorial =

View file

@ -97,7 +97,7 @@ abstract class FluffyThemes {
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(
toolbarHeight: FluffyThemes.isColumnMode(context) ? 72 : 56, toolbarHeight: FluffyThemes.isColumnMode(context) ? 72 : 56,
shadowColor: FluffyThemes.isColumnMode(context) shadowColor: FluffyThemes.isColumnMode(context)
? Colors.grey.withAlpha(64) ? colorScheme.surfaceContainer.withAlpha(64)
: null, : null,
surfaceTintColor: surfaceTintColor:
FluffyThemes.isColumnMode(context) ? colorScheme.surface : null, FluffyThemes.isColumnMode(context) ? colorScheme.surface : null,

View file

@ -1,5 +1,3 @@
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -27,30 +25,23 @@ class LoginScaffold extends StatelessWidget {
final isMobileMode = final isMobileMode =
enforceMobileMode || !FluffyThemes.isColumnMode(context); enforceMobileMode || !FluffyThemes.isColumnMode(context);
final scaffold = Scaffold( if (isMobileMode) {
key: const Key('LoginScaffold'), return Scaffold(
appBar: appBar == null key: const Key('LoginScaffold'),
? null appBar: appBar,
: AppBar( body: SafeArea(child: body),
titleSpacing: appBar?.titleSpacing, );
automaticallyImplyLeading: }
appBar?.automaticallyImplyLeading ?? true,
centerTitle: appBar?.centerTitle,
title: appBar?.title,
leading: appBar?.leading,
actions: appBar?.actions,
backgroundColor: isMobileMode ? null : Colors.transparent,
),
body: SafeArea(child: body),
backgroundColor:
isMobileMode ? null : theme.colorScheme.surface.withOpacity(0.8),
);
if (isMobileMode) return scaffold;
return Container( return Container(
decoration: const BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( gradient: LinearGradient(
fit: BoxFit.cover, colors: [
image: AssetImage('assets/login_wallpaper.png'), theme.colorScheme.surfaceContainerLow,
theme.colorScheme.surfaceContainer,
theme.colorScheme.surfaceContainerHighest,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
), ),
), ),
child: Column( child: Column(
@ -61,7 +52,6 @@ class LoginScaffold extends StatelessWidget {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Material( child: Material(
color: Colors.transparent,
borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderRadius: BorderRadius.circular(AppConfig.borderRadius),
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
elevation: theme.appBarTheme.scrolledUnderElevation ?? 4, elevation: theme.appBarTheme.scrolledUnderElevation ?? 4,
@ -70,12 +60,10 @@ class LoginScaffold extends StatelessWidget {
constraints: isMobileMode constraints: isMobileMode
? const BoxConstraints() ? const BoxConstraints()
: const BoxConstraints(maxWidth: 480, maxHeight: 640), : const BoxConstraints(maxWidth: 480, maxHeight: 640),
child: BackdropFilter( child: Scaffold(
filter: ImageFilter.blur( key: const Key('LoginScaffold'),
sigmaX: 10.0, appBar: appBar,
sigmaY: 10.0, body: SafeArea(child: body),
),
child: scaffold,
), ),
), ),
), ),
@ -95,18 +83,8 @@ class _PrivacyButtons extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final shadowTextStyle = FluffyThemes.isColumnMode(context) final theme = Theme.of(context);
? const TextStyle( final shadowTextStyle = TextStyle(color: theme.colorScheme.secondary);
color: Colors.white,
shadows: [
Shadow(
offset: Offset(0.0, 0.0),
blurRadius: 3,
color: Colors.black,
),
],
)
: null;
return SizedBox( return SizedBox(
height: 64, height: 64,
child: Padding( child: Padding(
@ -115,9 +93,16 @@ class _PrivacyButtons extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment, mainAxisAlignment: mainAxisAlignment,
children: [ children: [
TextButton( TextButton(
onPressed: () => PlatformInfos.showDialog(context), onPressed: () => launchUrlString(AppConfig.website),
child: Text( child: Text(
L10n.of(context).about, L10n.of(context).website,
style: shadowTextStyle,
),
),
TextButton(
onPressed: () => launchUrlString(AppConfig.supportUrl),
child: Text(
L10n.of(context).help,
style: shadowTextStyle, style: shadowTextStyle,
), ),
), ),
@ -128,6 +113,13 @@ class _PrivacyButtons extends StatelessWidget {
style: shadowTextStyle, style: shadowTextStyle,
), ),
), ),
TextButton(
onPressed: () => PlatformInfos.showDialog(context),
child: Text(
L10n.of(context).about,
style: shadowTextStyle,
),
),
], ],
), ),
), ),