mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-23 10:34:25 +01:00
chore: Design enhancements
This commit is contained in:
parent
d50fb9e73f
commit
a5c375bf6b
@ -16,7 +16,7 @@ abstract class AppConfig {
|
|||||||
static const double messageFontSize = 15.75;
|
static const double messageFontSize = 15.75;
|
||||||
static const bool allowOtherHomeservers = true;
|
static const bool allowOtherHomeservers = true;
|
||||||
static const bool enableRegistration = true;
|
static const bool enableRegistration = true;
|
||||||
static const Color primaryColor = Color(0xFF5625BA);
|
static const Color primaryColor = Color.fromARGB(255, 135, 103, 172);
|
||||||
static const Color primaryColorLight = Color(0xFFCCBDEA);
|
static const Color primaryColorLight = Color(0xFFCCBDEA);
|
||||||
static const Color secondaryColor = Color(0xFF41a2bc);
|
static const Color secondaryColor = Color(0xFF41a2bc);
|
||||||
static String _privacyUrl =
|
static String _privacyUrl =
|
||||||
|
@ -89,13 +89,13 @@ class Message extends StatelessWidget {
|
|||||||
final displayEvent = event.getDisplayEvent(timeline);
|
final displayEvent = event.getDisplayEvent(timeline);
|
||||||
final borderRadius = BorderRadius.only(
|
final borderRadius = BorderRadius.only(
|
||||||
topLeft: !ownMessage
|
topLeft: !ownMessage
|
||||||
? const Radius.circular(2)
|
? const Radius.circular(4)
|
||||||
: const Radius.circular(AppConfig.borderRadius),
|
|
||||||
topRight: ownMessage
|
|
||||||
? const Radius.circular(2)
|
|
||||||
: const Radius.circular(AppConfig.borderRadius),
|
: const Radius.circular(AppConfig.borderRadius),
|
||||||
|
topRight: const Radius.circular(AppConfig.borderRadius),
|
||||||
bottomLeft: const Radius.circular(AppConfig.borderRadius),
|
bottomLeft: const Radius.circular(AppConfig.borderRadius),
|
||||||
bottomRight: const Radius.circular(AppConfig.borderRadius),
|
bottomRight: ownMessage
|
||||||
|
? const Radius.circular(4)
|
||||||
|
: const Radius.circular(AppConfig.borderRadius),
|
||||||
);
|
);
|
||||||
final noBubble = {
|
final noBubble = {
|
||||||
MessageTypes.Video,
|
MessageTypes.Video,
|
||||||
|
@ -160,8 +160,6 @@ class ChatListController extends State<ChatList>
|
|||||||
bool isSearching = false;
|
bool isSearching = false;
|
||||||
static const String _serverStoreNamespace = 'im.fluffychat.search.server';
|
static const String _serverStoreNamespace = 'im.fluffychat.search.server';
|
||||||
|
|
||||||
StreamSubscription<String?>? _spacesSubscription;
|
|
||||||
|
|
||||||
void setServer() async {
|
void setServer() async {
|
||||||
final newServer = await showTextInputDialog(
|
final newServer = await showTextInputDialog(
|
||||||
useRootNavigator: false,
|
useRootNavigator: false,
|
||||||
@ -371,7 +369,6 @@ class ChatListController extends State<ChatList>
|
|||||||
_intentDataStreamSubscription?.cancel();
|
_intentDataStreamSubscription?.cancel();
|
||||||
_intentFileStreamSubscription?.cancel();
|
_intentFileStreamSubscription?.cancel();
|
||||||
_intentUriStreamSubscription?.cancel();
|
_intentUriStreamSubscription?.cancel();
|
||||||
_spacesSubscription?.cancel();
|
|
||||||
scrollController.removeListener(_onScroll);
|
scrollController.removeListener(_onScroll);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
@ -205,9 +205,9 @@ class ChatListItem extends StatelessWidget {
|
|||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
right: room.notificationCount > 0 ? 4.0 : 0.0),
|
right: room.notificationCount > 0 ? 4.0 : 0.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.push_pin_outlined,
|
Icons.push_pin,
|
||||||
size: 16,
|
size: 16,
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
|
@ -3,6 +3,7 @@ import 'dart:typed_data';
|
|||||||
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';
|
||||||
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/pages/connect/connect_page.dart';
|
import 'package:fluffychat/pages/connect/connect_page.dart';
|
||||||
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
|
||||||
@ -95,7 +96,6 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
hintText: L10n.of(context)!.chooseAUsername,
|
hintText: L10n.of(context)!.chooseAUsername,
|
||||||
errorText: controller.signupError,
|
errorText: controller.signupError,
|
||||||
errorStyle: const TextStyle(color: Colors.orange),
|
errorStyle: const TextStyle(color: Colors.orange),
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -150,9 +150,10 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
)
|
)
|
||||||
: Center(
|
: Center(
|
||||||
child: identityProviders.length == 1
|
child: identityProviders.length == 1
|
||||||
? Padding(
|
? Container(
|
||||||
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton.icon(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Theme.of(context)
|
backgroundColor: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@ -161,9 +162,22 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
.colorScheme
|
.colorScheme
|
||||||
.onPrimaryContainer,
|
.onPrimaryContainer,
|
||||||
),
|
),
|
||||||
|
icon: identityProviders.single.icon == null
|
||||||
|
? const Icon(
|
||||||
|
Icons.web_outlined,
|
||||||
|
size: 16,
|
||||||
|
)
|
||||||
|
: Image.network(
|
||||||
|
Uri.parse(identityProviders.single.icon!)
|
||||||
|
.getDownloadLink(Matrix.of(context)
|
||||||
|
.getLoginClient())
|
||||||
|
.toString(),
|
||||||
|
width: 32,
|
||||||
|
height: 32,
|
||||||
|
),
|
||||||
onPressed: () => controller
|
onPressed: () => controller
|
||||||
.ssoLoginAction(identityProviders.single.id!),
|
.ssoLoginAction(identityProviders.single.id!),
|
||||||
child: Text(identityProviders.single.name ??
|
label: Text(identityProviders.single.name ??
|
||||||
identityProviders.single.brand ??
|
identityProviders.single.brand ??
|
||||||
L10n.of(context)!.loginWithOneClick),
|
L10n.of(context)!.loginWithOneClick),
|
||||||
),
|
),
|
||||||
|
@ -16,6 +16,26 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final benchmarkResults = controller.benchmarkResults;
|
final benchmarkResults = controller.benchmarkResults;
|
||||||
return LoginScaffold(
|
return LoginScaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: TextField(
|
||||||
|
focusNode: controller.homeserverFocusNode,
|
||||||
|
controller: controller.homeserverController,
|
||||||
|
onChanged: controller.onChanged,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixText: '${L10n.of(context)!.homeserver}: ',
|
||||||
|
hintText: L10n.of(context)!.enterYourHomeserver,
|
||||||
|
suffixIcon: const Icon(Icons.search),
|
||||||
|
errorText: controller.error,
|
||||||
|
),
|
||||||
|
readOnly: !AppConfig.allowOtherHomeservers,
|
||||||
|
onSubmitted: (_) => controller.checkHomeserverAction(),
|
||||||
|
autocorrect: false,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
// display a prominent banner to import session for TOR browser
|
// display a prominent banner to import session for TOR browser
|
||||||
@ -44,32 +64,6 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
height: 200,
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/info-logo.png',
|
|
||||||
filterQuality: FilterQuality.medium,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(12.0),
|
|
||||||
child: TextField(
|
|
||||||
focusNode: controller.homeserverFocusNode,
|
|
||||||
controller: controller.homeserverController,
|
|
||||||
onChanged: controller.onChanged,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
prefixText: '${L10n.of(context)!.homeserver}: ',
|
|
||||||
hintText: L10n.of(context)!.enterYourHomeserver,
|
|
||||||
suffixIcon: const Icon(Icons.search),
|
|
||||||
errorText: controller.error,
|
|
||||||
fillColor: Theme.of(context).backgroundColor,
|
|
||||||
),
|
|
||||||
readOnly: !AppConfig.allowOtherHomeservers,
|
|
||||||
onSubmitted: (_) => controller.checkHomeserverAction(),
|
|
||||||
autocorrect: false,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (controller.displayServerList)
|
if (controller.displayServerList)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
@ -114,9 +108,17 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else
|
else ...[
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
height: 200,
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/info-logo.png',
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
|
),
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
AppConfig.applicationWelcomeMessage ??
|
AppConfig.applicationWelcomeMessage ??
|
||||||
@ -126,6 +128,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -47,7 +47,6 @@ class LoginView extends StatelessWidget {
|
|||||||
errorText: controller.usernameError,
|
errorText: controller.usernameError,
|
||||||
errorStyle: const TextStyle(color: Colors.orange),
|
errorStyle: const TextStyle(color: Colors.orange),
|
||||||
hintText: L10n.of(context)!.emailOrUsername,
|
hintText: L10n.of(context)!.emailOrUsername,
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -76,7 +75,6 @@ class LoginView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: L10n.of(context)!.password,
|
hintText: L10n.of(context)!.password,
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -46,7 +46,6 @@ class SignupPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
errorStyle: const TextStyle(color: Colors.orange),
|
errorStyle: const TextStyle(color: Colors.orange),
|
||||||
hintText: L10n.of(context)!.chooseAStrongPassword,
|
hintText: L10n.of(context)!.chooseAStrongPassword,
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -65,7 +64,6 @@ class SignupPageView extends StatelessWidget {
|
|||||||
prefixIcon: const Icon(Icons.repeat_outlined),
|
prefixIcon: const Icon(Icons.repeat_outlined),
|
||||||
hintText: L10n.of(context)!.repeatPassword,
|
hintText: L10n.of(context)!.repeatPassword,
|
||||||
errorStyle: const TextStyle(color: Colors.orange),
|
errorStyle: const TextStyle(color: Colors.orange),
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -83,7 +81,6 @@ class SignupPageView extends StatelessWidget {
|
|||||||
prefixIcon: const Icon(Icons.mail_outlined),
|
prefixIcon: const Icon(Icons.mail_outlined),
|
||||||
hintText: L10n.of(context)!.enterAnEmailAddress,
|
hintText: L10n.of(context)!.enterAnEmailAddress,
|
||||||
errorText: controller.error,
|
errorText: controller.error,
|
||||||
fillColor: Theme.of(context).colorScheme.background,
|
|
||||||
errorMaxLines: 4,
|
errorMaxLines: 4,
|
||||||
errorStyle: TextStyle(
|
errorStyle: TextStyle(
|
||||||
color: controller.emailController.text.isEmpty
|
color: controller.emailController.text.isEmpty
|
||||||
|
@ -16,6 +16,25 @@ class LoginScaffold extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final isMobileMode = !FluffyThemes.isColumnMode(context);
|
final isMobileMode = !FluffyThemes.isColumnMode(context);
|
||||||
|
final scaffold = Scaffold(
|
||||||
|
backgroundColor: isMobileMode ? null : Colors.transparent,
|
||||||
|
appBar: appBar == null
|
||||||
|
? null
|
||||||
|
: AppBar(
|
||||||
|
titleSpacing: appBar?.titleSpacing,
|
||||||
|
automaticallyImplyLeading:
|
||||||
|
appBar?.automaticallyImplyLeading ?? true,
|
||||||
|
centerTitle: appBar?.centerTitle,
|
||||||
|
title: appBar?.title,
|
||||||
|
leading: appBar?.leading,
|
||||||
|
actions: appBar?.actions,
|
||||||
|
backgroundColor: isMobileMode ? null : Colors.transparent,
|
||||||
|
),
|
||||||
|
extendBodyBehindAppBar: true,
|
||||||
|
extendBody: true,
|
||||||
|
body: body,
|
||||||
|
);
|
||||||
|
if (isMobileMode) return scaffold;
|
||||||
return Container(
|
return Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
@ -38,23 +57,7 @@ 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: Scaffold(
|
child: scaffold,
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
appBar: appBar == null
|
|
||||||
? null
|
|
||||||
: AppBar(
|
|
||||||
automaticallyImplyLeading:
|
|
||||||
appBar?.automaticallyImplyLeading ?? true,
|
|
||||||
centerTitle: appBar?.centerTitle,
|
|
||||||
title: appBar?.title,
|
|
||||||
leading: appBar?.leading,
|
|
||||||
actions: appBar?.actions,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
),
|
|
||||||
extendBodyBehindAppBar: true,
|
|
||||||
extendBody: true,
|
|
||||||
body: body,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user