mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-20 02:59:26 +01:00
chore: Adjust onboarding design
This commit is contained in:
parent
b473fa3ca4
commit
79a625a25f
@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
import 'app_config.dart';
|
import 'app_config.dart';
|
||||||
@ -59,7 +58,6 @@ abstract class FluffyThemes {
|
|||||||
filled: true,
|
filled: true,
|
||||||
),
|
),
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
systemOverlayStyle: SystemUiOverlayStyle.dark,
|
|
||||||
surfaceTintColor: Colors.white,
|
surfaceTintColor: Colors.white,
|
||||||
shadowColor: Colors.black.withAlpha(64),
|
shadowColor: Colors.black.withAlpha(64),
|
||||||
),
|
),
|
||||||
@ -92,6 +90,10 @@ abstract class FluffyThemes {
|
|||||||
filled: true,
|
filled: true,
|
||||||
),
|
),
|
||||||
dividerColor: Colors.blueGrey.shade900,
|
dividerColor: Colors.blueGrey.shade900,
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
surfaceTintColor: Colors.black,
|
||||||
|
shadowColor: Colors.black.withAlpha(64),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
static Color blackWhiteColor(BuildContext context) =>
|
static Color blackWhiteColor(BuildContext context) =>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import 'package:fluffychat/config/app_config.dart';
|
|
||||||
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:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
import 'package:fluffychat/pages/chat_list/chat_list.dart';
|
||||||
import 'package:fluffychat/pages/chat_list/client_chooser_button.dart';
|
import 'package:fluffychat/pages/chat_list/client_chooser_button.dart';
|
||||||
import 'package:fluffychat/widgets/matrix.dart';
|
import 'package:fluffychat/widgets/matrix.dart';
|
||||||
|
@ -33,7 +33,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (Matrix.of(context).loginRegistrationSupported ?? false) ...[
|
if (Matrix.of(context).loginRegistrationSupported ?? false) ...[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
@ -85,7 +85,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: controller.usernameController,
|
controller: controller.usernameController,
|
||||||
onSubmitted: (_) => controller.signUp(),
|
onSubmitted: (_) => controller.signUp(),
|
||||||
@ -101,7 +101,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: 'loginButton',
|
tag: 'loginButton',
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
@ -116,7 +116,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const Expanded(child: Divider(color: Colors.white)),
|
const Expanded(child: Divider(color: Colors.white)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
L10n.of(context)!.or,
|
L10n.of(context)!.or,
|
||||||
style: const TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
@ -138,7 +138,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
: Center(
|
: Center(
|
||||||
child: identityProviders.length == 1
|
child: identityProviders.length == 1
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () => controller
|
onPressed: () => controller
|
||||||
.ssoLoginAction(identityProviders.single.id!),
|
.ssoLoginAction(identityProviders.single.id!),
|
||||||
@ -160,7 +160,7 @@ class ConnectPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (controller.supportsLogin)
|
if (controller.supportsLogin)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: 'signinButton',
|
tag: 'signinButton',
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:vrouter/vrouter.dart';
|
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
import 'package:fluffychat/utils/platform_infos.dart';
|
import 'package:fluffychat/utils/platform_infos.dart';
|
||||||
@ -18,11 +17,36 @@ 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: VRouter.of(context).path == '/home'
|
appBar: AppBar(
|
||||||
? null
|
backgroundColor: Colors.transparent,
|
||||||
: AppBar(title: Text(L10n.of(context)!.addAccount)),
|
actions: [
|
||||||
body: SafeArea(
|
IconButton(
|
||||||
child: Column(
|
onPressed: controller.restoreBackup,
|
||||||
|
tooltip: L10n.of(context)!.hydrate,
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.restore_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
tooltip: L10n.of(context)!.privacy,
|
||||||
|
onPressed: () => launch(AppConfig.privacyUrl),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.shield_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
tooltip: L10n.of(context)!.about,
|
||||||
|
onPressed: () => PlatformInfos.showDialog(context),
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outlined,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
// display a prominent banner to import session for TOR browser
|
// display a prominent banner to import session for TOR browser
|
||||||
// users. This feature is just some UX sugar as TOR users are
|
// users. This feature is just some UX sugar as TOR users are
|
||||||
@ -52,11 +76,11 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
height: 256,
|
height: 200,
|
||||||
child: Image.asset('assets/info-logo.png'),
|
child: Image.asset('assets/info-logo.png'),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
focusNode: controller.homeserverFocusNode,
|
focusNode: controller.homeserverFocusNode,
|
||||||
controller: controller.homeserverController,
|
controller: controller.homeserverController,
|
||||||
@ -78,7 +102,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (controller.displayServerList)
|
if (controller.displayServerList)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Material(
|
child: Material(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(AppConfig.borderRadius),
|
BorderRadius.circular(AppConfig.borderRadius),
|
||||||
@ -87,7 +111,7 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
child: benchmarkResults == null
|
child: benchmarkResults == null
|
||||||
? const Center(
|
? const Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.all(16.0),
|
padding: EdgeInsets.all(12.0),
|
||||||
child: CircularProgressIndicator.adaptive(),
|
child: CircularProgressIndicator.adaptive(),
|
||||||
))
|
))
|
||||||
: Column(
|
: Column(
|
||||||
@ -120,36 +144,11 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Wrap(
|
|
||||||
alignment: WrapAlignment.center,
|
|
||||||
children: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => launch(AppConfig.privacyUrl),
|
|
||||||
child: Text(
|
|
||||||
L10n.of(context)!.privacy,
|
|
||||||
style: const TextStyle(
|
|
||||||
decoration: TextDecoration.underline,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => PlatformInfos.showDialog(context),
|
|
||||||
child: Text(
|
|
||||||
L10n.of(context)!.about,
|
|
||||||
style: const TextStyle(
|
|
||||||
decoration: TextDecoration.underline,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(12),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Hero(
|
child: Hero(
|
||||||
tag: 'loginButton',
|
tag: 'loginButton',
|
||||||
@ -163,33 +162,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: ExpansionTile(
|
|
||||||
title: Text(L10n.of(context)!.advanced),
|
|
||||||
children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: TextButton(
|
|
||||||
onPressed: controller.isLoading
|
|
||||||
? () {}
|
|
||||||
: controller.restoreBackup,
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
primary: Colors.white.withAlpha(200),
|
|
||||||
onPrimary: Colors.black,
|
|
||||||
shadowColor: Colors.white,
|
|
||||||
),
|
|
||||||
child: controller.isLoading
|
|
||||||
? const LinearProgressIndicator()
|
|
||||||
: Text(L10n.of(context)!.hydrate),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class LoginView extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
readOnly: controller.loading,
|
readOnly: controller.loading,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
@ -57,7 +57,7 @@ class LoginView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextField(
|
child: TextField(
|
||||||
readOnly: controller.loading,
|
readOnly: controller.loading,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
@ -91,7 +91,7 @@ class LoginView extends StatelessWidget {
|
|||||||
Hero(
|
Hero(
|
||||||
tag: 'signinButton',
|
tag: 'signinButton',
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: controller.loading
|
onPressed: controller.loading
|
||||||
? null
|
? null
|
||||||
@ -106,7 +106,7 @@ class LoginView extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
const Expanded(child: Divider(color: Colors.white)),
|
const Expanded(child: Divider(color: Colors.white)),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
L10n.of(context)!.or,
|
L10n.of(context)!.or,
|
||||||
style: const TextStyle(color: Colors.white),
|
style: const TextStyle(color: Colors.white),
|
||||||
@ -116,7 +116,7 @@ class LoginView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed:
|
onPressed:
|
||||||
controller.loading ? () {} : controller.passwordForgotten,
|
controller.loading ? () {} : controller.passwordForgotten,
|
||||||
|
@ -27,7 +27,7 @@ class SignupPageView extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
readOnly: controller.loading,
|
readOnly: controller.loading,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
@ -60,7 +60,7 @@ class SignupPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (controller.displaySecondPasswordField)
|
if (controller.displaySecondPasswordField)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
readOnly: controller.loading,
|
readOnly: controller.loading,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
@ -81,7 +81,7 @@ class SignupPageView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
readOnly: controller.loading,
|
readOnly: controller.loading,
|
||||||
autocorrect: false,
|
autocorrect: false,
|
||||||
@ -109,7 +109,7 @@ class SignupPageView extends StatelessWidget {
|
|||||||
Hero(
|
Hero(
|
||||||
tag: 'loginButton',
|
tag: 'loginButton',
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(12),
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: controller.loading ? () {} : controller.signup,
|
onPressed: controller.loading ? () {} : controller.signup,
|
||||||
child: controller.loading
|
child: controller.loading
|
||||||
|
Loading…
Reference in New Issue
Block a user