feat: New material 3 design

This commit is contained in:
Christian Pauly 2022-07-07 18:50:13 +02:00
commit ccfda5bc96
28 changed files with 817 additions and 1307 deletions

View file

@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:fluffychat/config/themes.dart';
import 'package:fluffychat/pages/connect/connect_page.dart';
import 'package:fluffychat/widgets/layouts/login_scaffold.dart';
import 'package:fluffychat/widgets/matrix.dart';
@ -90,14 +89,14 @@ class ConnectPageView extends StatelessWidget {
child: TextField(
controller: controller.usernameController,
onSubmitted: (_) => controller.signUp(),
style: FluffyThemes.loginTextFieldStyle,
decoration: FluffyThemes.loginTextFieldDecoration(
prefixIcon: const Icon(
Icons.account_box_outlined,
color: Colors.black,
),
decoration: InputDecoration(
prefixIcon: const Icon(Icons.account_box_outlined),
hintText: L10n.of(context)!.chooseAUsername,
errorText: controller.signupError,
fillColor: Theme.of(context)
.colorScheme
.background
.withOpacity(0.75),
),
),
),
@ -106,12 +105,7 @@ class ConnectPageView extends StatelessWidget {
child: Hero(
tag: 'loginButton',
child: ElevatedButton(
onPressed: controller.loading ? null : controller.signUp,
style: ElevatedButton.styleFrom(
primary: Colors.white.withAlpha(200),
onPrimary: Colors.black,
shadowColor: Colors.white,
),
onPressed: controller.loading ? () {} : controller.signUp,
child: controller.loading
? const LinearProgressIndicator()
: Text(L10n.of(context)!.signUp),
@ -148,11 +142,6 @@ class ConnectPageView extends StatelessWidget {
child: ElevatedButton(
onPressed: () => controller
.ssoLoginAction(identityProviders.single.id!),
style: ElevatedButton.styleFrom(
primary: Colors.white.withAlpha(200),
onPrimary: Colors.black,
shadowColor: Colors.white,
),
child: Text(identityProviders.single.name ??
identityProviders.single.brand ??
L10n.of(context)!.loginWithOneClick),
@ -176,11 +165,6 @@ class ConnectPageView extends StatelessWidget {
tag: 'signinButton',
child: ElevatedButton(
onPressed: controller.loading ? () {} : controller.login,
style: ElevatedButton.styleFrom(
primary: Colors.white.withAlpha(200),
onPrimary: Colors.black,
shadowColor: Colors.white,
),
child: Text(L10n.of(context)!.login),
),
),

View file

@ -22,17 +22,17 @@ class SsoButton extends StatelessWidget {
onTap: onPressed,
borderRadius: BorderRadius.circular(7),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Material(
color: Colors.white,
borderRadius: BorderRadius.circular(7),
borderRadius: BorderRadius.circular(8),
clipBehavior: Clip.hardEdge,
child: Padding(
padding: const EdgeInsets.all(2.0),
padding: const EdgeInsets.all(4.0),
child: identityProvider.icon == null
? const Icon(Icons.web_outlined)
: CachedNetworkImage(