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, 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 Duration animationDuration = Duration(milliseconds: 250);
static const Curve animationCurve = Curves.easeInOut; 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 bottomSheetPadding = FluffyThemes.isColumnMode(context) ? 16.0 : 8.0;
final colorScheme = Theme.of(context).colorScheme;
return VWidgetGuard( return VWidgetGuard(
onSystemPop: (redirector) async { onSystemPop: (redirector) async {
@ -220,14 +219,9 @@ class ChatView extends StatelessWidget {
else else
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: FluffyThemes.backgroundGradient(
begin: Alignment.topCenter, context,
colors: [ 64,
colorScheme.primaryContainer.withAlpha(64),
colorScheme.secondaryContainer.withAlpha(64),
colorScheme.tertiaryContainer.withAlpha(64),
colorScheme.primaryContainer.withAlpha(64),
],
), ),
), ),
), ),

View File

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