Skip to content

Commit

Permalink
fix: Fixed a problem with color transitions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Mar 8, 2023
1 parent 81ee609 commit 4d5511b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
16 changes: 12 additions & 4 deletions packages/masamune/lib/universal/universal_app_bar.dart
Expand Up @@ -586,14 +586,22 @@ class UniversalAppBar extends StatelessWidget with UniversalAppBarMixin {
style:
Theme.of(context).textTheme.titleLarge ??
const TextStyle(),
child: title!,
child: _DynamicExtentForegroundColor(
startForegroundColor: foregroundColor,
endForegroundColor: expandedForegroundColor,
child: title!,
),
),
if (subtitle != null)
DefaultTextStyle.merge(
style:
Theme.of(context).textTheme.labelSmall ??
const TextStyle(),
child: subtitle!,
child: _DynamicExtentForegroundColor(
startForegroundColor: foregroundColor,
endForegroundColor: expandedForegroundColor,
child: subtitle!,
),
),
],
),
Expand Down Expand Up @@ -951,8 +959,8 @@ class _DynamicExtentForegroundColor extends StatelessWidget {
);
}

final lerp =
settings.currentExtent / (settings.maxExtent - settings.minExtent);
final lerp = (settings.currentExtent - settings.minExtent) /
(settings.maxExtent - settings.minExtent);
final color = Color.lerp(startColor, endColor, lerp);
return DefaultTextStyle.merge(
style: TextStyle(color: color),
Expand Down
12 changes: 6 additions & 6 deletions packages/masamune/pubspec.lock
Expand Up @@ -244,18 +244,18 @@ packages:
dependency: "direct main"
description:
name: katana_form
sha256: "33e7f18cafec0fc858f55eae81b460a5eee08b03d28490c4de676e14b7ccd98c"
sha256: b545252d133b85fddccc572a42f2bd5600d216ee5672dc40fc94181528df225b
url: "https://pub.dev"
source: hosted
version: "1.3.16"
version: "1.3.17"
katana_functions:
dependency: "direct main"
description:
name: katana_functions
sha256: "37a80e38df7babbcb6082f294334d54251d9c327d18ab09870c03e6715d56c7a"
sha256: "4ecc5b0321c3aa93d5a1dcebabc63c112d09a12d8c05f6e12e4eea3f0a0c9cf8"
url: "https://pub.dev"
source: hosted
version: "1.1.14"
version: "1.1.15"
katana_indicator:
dependency: "direct main"
description:
Expand Down Expand Up @@ -388,10 +388,10 @@ packages:
dependency: "direct main"
description:
name: katana_ui
sha256: "367a09b85e4b495538fcf3c9397cfbe0580faa5483ceb9b5c2b3f15c2a4e4ba8"
sha256: a897c68f8205bc5a22d86fa4a5a5d4a28149f7257fd5dffce10a1b35e28aa0fa
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.2.2"
lints:
dependency: transitive
description:
Expand Down

0 comments on commit 4d5511b

Please sign in to comment.