chore: Adjust onboarding design

This commit is contained in:
Krille Fear 2022-12-29 20:38:13 +01:00
parent 7da70ebeba
commit d930b569fc
7 changed files with 101 additions and 103 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -2985,5 +2985,6 @@
"endToEndEncryption": "End to end encryption",
"disableEncryptionWarning": "For security reasons you can not disable encryption in a chat, where it has been enabled before.",
"sorryThatsNotPossible": "Sorry... that is not possible",
"deviceKeys": "Device keys:"
"deviceKeys": "Device keys:",
"letsStart": "Let's start"
}

View File

@ -40,9 +40,12 @@ class ConnectPageView extends StatelessWidget {
elevation: Theme.of(context)
.appBarTheme
.scrolledUnderElevation ??
4,
10,
color: Colors.transparent,
shadowColor: Theme.of(context).appBarTheme.shadowColor,
shadowColor: Theme.of(context)
.colorScheme
.onBackground
.withAlpha(64),
clipBehavior: Clip.hardEdge,
child: CircleAvatar(
radius: 64,
@ -103,13 +106,14 @@ class ConnectPageView extends StatelessWidget {
padding: const EdgeInsets.all(12.0),
child: Hero(
tag: 'loginButton',
child: ElevatedButton(
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Theme.of(context).colorScheme.onPrimary,
),
onPressed: controller.loading ? () {} : controller.signUp,
child: controller.loading
icon: const Icon(Icons.person_add_outlined),
label: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.signUp),
),
@ -198,7 +202,8 @@ class ConnectPageView extends StatelessWidget {
padding: const EdgeInsets.all(12.0),
child: Hero(
tag: 'signinButton',
child: ElevatedButton(
child: ElevatedButton.icon(
icon: const Icon(Icons.login_outlined),
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
@ -206,7 +211,7 @@ class ConnectPageView extends StatelessWidget {
Theme.of(context).colorScheme.onPrimaryContainer,
),
onPressed: controller.loading ? () {} : controller.login,
child: Text(L10n.of(context)!.login),
label: Text(L10n.of(context)!.login),
),
),
),

View File

@ -48,7 +48,8 @@ class HomeserverPickerView extends StatelessWidget {
),
),
Expanded(
child: ListView(
child: controller.displayServerList
? ListView(
children: [
if (controller.displayServerList)
Padding(
@ -56,13 +57,16 @@ class HomeserverPickerView extends StatelessWidget {
child: Material(
borderRadius:
BorderRadius.circular(AppConfig.borderRadius),
color: Theme.of(context).colorScheme.onInverseSurface,
color: Theme.of(context)
.colorScheme
.onInverseSurface,
clipBehavior: Clip.hardEdge,
child: benchmarkResults == null
? const Center(
child: Padding(
padding: EdgeInsets.all(12.0),
child: CircularProgressIndicator.adaptive(),
child:
CircularProgressIndicator.adaptive(),
))
: Column(
children: controller.filteredHomeservers
@ -73,50 +77,39 @@ class HomeserverPickerView extends StatelessWidget {
Icons.info_outlined,
color: Colors.black,
),
onPressed: () =>
controller.showServerInfo(server),
onPressed: () => controller
.showServerInfo(server),
),
onTap: () => controller.setServer(
server.homeserver.baseUrl.host),
server
.homeserver.baseUrl.host),
title: Text(
server.homeserver.baseUrl.host,
style: const TextStyle(
color: Colors.black),
),
subtitle: Text(
server.homeserver.description ?? '',
server.homeserver.description ??
'',
style: TextStyle(
color: Colors.grey.shade700),
color:
Colors.grey.shade700),
),
),
)
.toList(),
),
),
),
],
)
else ...[
Container(
alignment: Alignment.center,
height: 200,
: Container(
alignment: Alignment.topCenter,
child: Image.asset(
'assets/info-logo.png',
'assets/banner_transparent.png',
filterQuality: FilterQuality.medium,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child: Text(
AppConfig.applicationWelcomeMessage ??
L10n.of(context)!.welcomeText,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 20),
),
),
),
],
],
),
),
SafeArea(
child: Container(
@ -126,21 +119,17 @@ class HomeserverPickerView extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextButton(
style: TextButton.styleFrom(
foregroundColor:
Theme.of(context).colorScheme.onSurfaceVariant,
),
onPressed: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
),
TextButton(
onPressed: () => launch(AppConfig.privacyUrl),
child: Text(L10n.of(context)!.privacy),
),
TextButton(
onPressed: controller.restoreBackup,
child: Text(L10n.of(context)!.hydrate),
),
Hero(
tag: 'loginButton',
child: ElevatedButton(
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primary,
@ -150,9 +139,10 @@ class HomeserverPickerView extends StatelessWidget {
onPressed: controller.isLoading
? null
: controller.checkHomeserverAction,
child: controller.isLoading
icon: const Icon(Icons.start_outlined),
label: controller.isLoading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.connect),
: Text(L10n.of(context)!.letsStart),
),
),
],

View File

@ -82,7 +82,7 @@ class LoginView extends StatelessWidget {
tag: 'signinButton',
child: Padding(
padding: const EdgeInsets.all(12.0),
child: ElevatedButton(
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Theme.of(context).colorScheme.onPrimary,
@ -90,7 +90,8 @@ class LoginView extends StatelessWidget {
onPressed: controller.loading
? null
: () => controller.login(context),
child: controller.loading
icon: const Icon(Icons.login_outlined),
label: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.login),
),
@ -124,14 +125,15 @@ class LoginView extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.all(12.0),
child: ElevatedButton(
child: ElevatedButton.icon(
onPressed:
controller.loading ? () {} : controller.passwordForgotten,
style: ElevatedButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.error,
backgroundColor: Theme.of(context).colorScheme.onError,
),
child: Text(L10n.of(context)!.passwordForgotten),
icon: const Icon(Icons.safety_check_outlined),
label: Text(L10n.of(context)!.passwordForgotten),
),
),
],

View File

@ -94,13 +94,14 @@ class SignupPageView extends StatelessWidget {
tag: 'loginButton',
child: Padding(
padding: const EdgeInsets.all(12),
child: ElevatedButton(
child: ElevatedButton.icon(
icon: const Icon(Icons.person_add_outlined),
style: ElevatedButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.onPrimary,
backgroundColor: Theme.of(context).colorScheme.primary,
),
onPressed: controller.loading ? () {} : controller.signup,
child: controller.loading
label: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.signUp),
),

View File

@ -43,15 +43,13 @@ class LoginScaffold extends StatelessWidget {
),
),
child: Center(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Material(
color: Theme.of(context).brightness == Brightness.light
? Theme.of(context).scaffoldBackgroundColor.withOpacity(0.9)
: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.75),
borderRadius: isMobileMode
? null
: BorderRadius.circular(AppConfig.borderRadius),
elevation: isMobileMode ? 0 : 10,
color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.925),
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
clipBehavior: Clip.hardEdge,
elevation: 10,
shadowColor: Colors.black,
child: ConstrainedBox(
constraints: isMobileMode
@ -61,6 +59,7 @@ class LoginScaffold extends StatelessWidget {
),
),
),
),
);
}
}