feat: replace mail protocol with smolmail and rebuild the UI
This commit is contained in:
parent
cb24b68069
commit
e94e4158cc
93 changed files with 6387 additions and 3479 deletions
|
|
@ -1,95 +1,143 @@
|
|||
import "package:flutter/material.dart";
|
||||
|
||||
final ThemeData appTheme = ThemeData(
|
||||
colorScheme: ColorScheme.fromSwatch().copyWith(
|
||||
primary: const Color.fromRGBO(63, 207, 142, 1),
|
||||
background: const Color.fromRGBO(1, 17, 29, 1),
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Color.fromRGBO(1, 17, 29, 1),
|
||||
iconTheme: IconThemeData(
|
||||
color: Colors.white,
|
||||
size: 30,
|
||||
),
|
||||
titleTextStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 30,
|
||||
),
|
||||
elevation: 0.0,
|
||||
),
|
||||
textTheme: const TextTheme(
|
||||
bodySmall: TextStyle(
|
||||
import "package:smol_mail/presentation/theme/app_colors.dart";
|
||||
|
||||
const _seedColor = Color.fromRGBO(63, 207, 142, 1);
|
||||
const _darkSurface = Color.fromRGBO(1, 17, 29, 1);
|
||||
|
||||
TextTheme _textTheme(TextTheme base, Color mutedColor) {
|
||||
return base.copyWith(
|
||||
bodySmall: base.bodySmall?.copyWith(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
),
|
||||
bodyMedium: TextStyle(
|
||||
bodyMedium: base.bodyMedium?.copyWith(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 20,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
bodyLarge: TextStyle(
|
||||
bodyLarge: base.bodyLarge?.copyWith(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 24,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
titleMedium: TextStyle(
|
||||
color: Colors.white,
|
||||
titleMedium: base.titleMedium?.copyWith(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w300,
|
||||
),
|
||||
titleLarge: TextStyle(
|
||||
titleLarge: base.titleLarge?.copyWith(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 35,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
labelSmall: TextStyle(
|
||||
labelSmall: base.labelSmall?.copyWith(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 16,
|
||||
color: Color.fromRGBO(127, 133, 140, 1),
|
||||
color: mutedColor,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
snackBarTheme: const SnackBarThemeData(
|
||||
backgroundColor: Colors.red,
|
||||
contentTextStyle: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color.fromRGBO(63, 207, 142, 1),
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
textStyle: const TextStyle(
|
||||
);
|
||||
}
|
||||
|
||||
ThemeData _buildTheme(ColorScheme scheme, AppColors appColors) {
|
||||
return ThemeData(
|
||||
colorScheme: scheme,
|
||||
// ThemeData defaults this legacy field to Colors.grey[900] on a dark
|
||||
// theme when unset, which is nearly invisible against our dark surfaces —
|
||||
// several screens still read it via Theme.of(context).primaryColor.
|
||||
primaryColor: scheme.primary,
|
||||
scaffoldBackgroundColor: scheme.surface,
|
||||
extensions: [appColors],
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: scheme.surface,
|
||||
iconTheme: IconThemeData(color: scheme.onSurface, size: 30),
|
||||
titleTextStyle: TextStyle(
|
||||
color: scheme.onSurface,
|
||||
fontFamily: "Inter",
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 30,
|
||||
),
|
||||
elevation: 0.0,
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: const Color.fromRGBO(63, 207, 412, 1),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
textStyle: const TextStyle(
|
||||
textTheme: _textTheme(
|
||||
ThemeData(brightness: scheme.brightness).textTheme,
|
||||
scheme.onSurfaceVariant,
|
||||
),
|
||||
snackBarTheme: SnackBarThemeData(
|
||||
backgroundColor: scheme.inverseSurface,
|
||||
contentTextStyle: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 17,
|
||||
fontSize: 16,
|
||||
color: scheme.onInverseSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
useMaterial3: true,
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: scheme.primary,
|
||||
foregroundColor: scheme.onPrimary,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
|
||||
textStyle: const TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: scheme.primary,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
|
||||
textStyle: const TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 17,
|
||||
),
|
||||
),
|
||||
),
|
||||
// Without this, an empty/unfocused field's resting label inherits
|
||||
// bodyLarge (24px bold) — that's what made "Host" etc. look huge.
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
floatingLabelStyle: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: scheme.primary,
|
||||
),
|
||||
hintStyle: TextStyle(
|
||||
fontFamily: "Inter",
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
),
|
||||
useMaterial3: true,
|
||||
);
|
||||
}
|
||||
|
||||
final ThemeData appThemeDark = _buildTheme(
|
||||
ColorScheme.fromSeed(
|
||||
seedColor: _seedColor,
|
||||
brightness: Brightness.dark,
|
||||
).copyWith(surface: _darkSurface),
|
||||
AppColors.dark,
|
||||
);
|
||||
|
||||
final ThemeData appThemeLight = _buildTheme(
|
||||
ColorScheme.fromSeed(
|
||||
seedColor: _seedColor,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
AppColors.light,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue