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

@ -17,7 +17,6 @@ import 'package:fluffychat/pages/login/login.dart';
import 'package:fluffychat/pages/new_group/new_group.dart';
import 'package:fluffychat/pages/new_private_chat/new_private_chat.dart';
import 'package:fluffychat/pages/new_space/new_space.dart';
import 'package:fluffychat/pages/search/search.dart';
import 'package:fluffychat/pages/settings/settings.dart';
import 'package:fluffychat/pages/settings_3pid/settings_3pid.dart';
import 'package:fluffychat/pages/settings_account/settings_account.dart';
@ -92,10 +91,6 @@ class AppRoutes {
widget: const Settings(),
stackedRoutes: _settingsRoutes,
),
VWidget(
path: '/search',
widget: const Search(),
),
VWidget(
path: '/archive',
widget: const Archive(),
@ -225,14 +220,6 @@ class AppRoutes {
),
],
),
VWidget(
path: '/search',
widget: const TwoColumnLayout(
mainView: Search(),
sideView: EmptyPage(),
),
buildTransition: _fadeTransition,
),
VWidget(
path: '/archive',
widget: const TwoColumnLayout(

View file

@ -9,56 +9,10 @@ abstract class FluffyThemes {
static bool isColumnMode(BuildContext context) =>
MediaQuery.of(context).size.width > columnWidth * 2;
static const fallbackTextStyle =
TextStyle(fontFamily: 'Roboto', fontFamilyFallback: ['NotoEmoji']);
static const TextStyle loginTextFieldStyle = TextStyle(color: Colors.black);
static InputDecoration loginTextFieldDecoration({
String? errorText,
String? labelText,
String? hintText,
Widget? suffixIcon,
Widget? prefixIcon,
Color? errorColor,
}) =>
InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
fillColor: Colors.white.withAlpha(200),
labelText: labelText,
hintText: hintText,
suffixIcon: suffixIcon,
prefixIcon: prefixIcon,
suffixIconColor: Colors.black,
prefixIconColor: Colors.black,
iconColor: Colors.black,
errorText: errorText,
errorMaxLines: 4,
errorStyle: TextStyle(
color: errorColor ?? Colors.redAccent.shade200,
shadows: const [
Shadow(
color: Colors.black,
offset: Offset(0, 0),
blurRadius: 10,
),
],
),
hintStyle: TextStyle(color: Colors.grey.shade700),
labelStyle: const TextStyle(
color: Colors.white,
shadows: [
Shadow(
color: Colors.black,
offset: Offset(0, 0),
blurRadius: 5,
),
],
),
contentPadding: const EdgeInsets.all(16),
);
static const fallbackTextStyle = TextStyle(
fontFamily: 'Roboto',
fontFamilyFallback: ['NotoEmoji'],
);
static var fallbackTextTheme = const TextTheme(
bodyText1: fallbackTextStyle,
@ -83,12 +37,12 @@ abstract class FluffyThemes {
colorSchemeSeed: AppConfig.colorSchemeSeed ??
colorScheme?.primary ??
AppConfig.chatColor,
scaffoldBackgroundColor: Colors.white,
textTheme: PlatformInfos.isDesktop
? Typography.material2018().black.merge(fallbackTextTheme)
: null,
snackBarTheme:
const SnackBarThemeData(behavior: SnackBarBehavior.floating),
snackBarTheme: const SnackBarThemeData(
behavior: SnackBarBehavior.floating,
),
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.fuchsia: ZoomPageTransitionsBuilder(),
@ -100,31 +54,12 @@ abstract class FluffyThemes {
},
),
dividerColor: Colors.blueGrey.shade50,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
textStyle: const TextStyle(fontSize: 16),
elevation: 6,
shadowColor: const Color(0x44000000),
minimumSize: const Size.fromHeight(48),
padding: const EdgeInsets.all(12),
),
),
cardTheme: const CardTheme(
elevation: 6,
// shadowColor: Color(0x44000000),
clipBehavior: Clip.hardEdge,
),
inputDecorationTheme: InputDecorationTheme(
border: const UnderlineInputBorder(borderSide: BorderSide(width: 1)),
inputDecorationTheme: const InputDecorationTheme(
border: UnderlineInputBorder(borderSide: BorderSide(width: 1)),
filled: true,
fillColor: Colors.blueGrey.shade50,
),
appBarTheme: const AppBarTheme(
elevation: 6,
shadowColor: Color(0x44000000),
systemOverlayStyle: SystemUiOverlayStyle.dark,
surfaceTintColor: Colors.white,
backgroundColor: Colors.white,
),
);
@ -135,7 +70,6 @@ abstract class FluffyThemes {
colorSchemeSeed: AppConfig.colorSchemeSeed ??
colorScheme?.primary ??
AppConfig.chatColor,
scaffoldBackgroundColor: Colors.black,
textTheme: PlatformInfos.isDesktop
? Typography.material2018().white.merge(fallbackTextTheme)
: null,
@ -151,20 +85,11 @@ abstract class FluffyThemes {
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
},
),
dividerColor: Colors.blueGrey.shade600,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: AppConfig.chatColor,
onPrimary: Colors.white,
minimumSize: const Size.fromHeight(48),
textStyle: const TextStyle(fontSize: 16),
padding: const EdgeInsets.all(12),
),
),
appBarTheme: const AppBarTheme(
elevation: 6,
backgroundColor: Color(0xff1D1D1D),
inputDecorationTheme: const InputDecorationTheme(
border: UnderlineInputBorder(borderSide: BorderSide(width: 1)),
filled: true,
),
dividerColor: Colors.blueGrey.shade900,
);
static Color blackWhiteColor(BuildContext context) =>