chore: Streamline background gradients

This commit is contained in:
Krille 2023-06-29 16:56:15 +09:00
parent b2d9986cd3
commit 277885a61e
No known key found for this signature in database
3 changed files with 20 additions and 19 deletions

View File

@ -41,6 +41,22 @@ abstract class FluffyThemes {
titleSmall: fallbackTextStyle,
);
static LinearGradient backgroundGradient(
BuildContext context,
int alpha,
) {
final colorScheme = Theme.of(context).colorScheme;
return LinearGradient(
begin: Alignment.topCenter,
colors: [
colorScheme.primaryContainer.withAlpha(alpha),
colorScheme.secondaryContainer.withAlpha(alpha),
colorScheme.tertiaryContainer.withAlpha(alpha),
colorScheme.primaryContainer.withAlpha(alpha),
],
);
}
static const Duration animationDuration = Duration(milliseconds: 250);
static const Curve animationCurve = Curves.easeInOut;

View File

@ -146,7 +146,6 @@ class ChatView extends StatelessWidget {
);
}
final bottomSheetPadding = FluffyThemes.isColumnMode(context) ? 16.0 : 8.0;
final colorScheme = Theme.of(context).colorScheme;
return VWidgetGuard(
onSystemPop: (redirector) async {
@ -220,14 +219,9 @@ class ChatView extends StatelessWidget {
else
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
colors: [
colorScheme.primaryContainer.withAlpha(64),
colorScheme.secondaryContainer.withAlpha(64),
colorScheme.tertiaryContainer.withAlpha(64),
colorScheme.primaryContainer.withAlpha(64),
],
gradient: FluffyThemes.backgroundGradient(
context,
64,
),
),
),

View File

@ -48,18 +48,9 @@ class LoginScaffold extends StatelessWidget {
: null,
);
if (isMobileMode) return scaffold;
final colorScheme = Theme.of(context).colorScheme;
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
colors: [
colorScheme.primaryContainer.withAlpha(64),
colorScheme.secondaryContainer.withAlpha(64),
colorScheme.tertiaryContainer.withAlpha(64),
colorScheme.primaryContainer.withAlpha(64),
],
),
gradient: FluffyThemes.backgroundGradient(context, 156),
),
child: Column(
children: [