Skip to content

Commit

Permalink
fix: goldens
Browse files Browse the repository at this point in the history
  • Loading branch information
TesteurManiak committed Dec 20, 2023
1 parent 77a2742 commit 2b257b5
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions lib/src/components/buttons/primary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class DSFRPrimaryButton extends DSFRGroupeableButton {
final dsfrTypography = dsfrTheme.typography;
final dsfrButtonStyle = dsfrTheme.buttonStyle;

final scale = MediaQuery.textScalerOf(context)
.scale(dsfrTypography.medium.fontSize ?? 1);
final scale = MediaQuery.textScalerOf(context).textScaleFactor;
final double gap =
scale <= 1 ? 8 : lerpDouble(8, 4, math.min(scale - 1, 1))!;

Expand Down
3 changes: 1 addition & 2 deletions lib/src/components/buttons/secondary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class DSFRSecondaryButton extends DSFRGroupeableButton {
final dsfrColors = dsfrTheme.colors;
final dsfrButtonStyle = dsfrTheme.buttonStyle;

final scale = MediaQuery.textScalerOf(context)
.scale(dsfrTypography.medium.fontSize ?? 1);
final scale = MediaQuery.textScalerOf(context).textScaleFactor;
final double gap =
scale <= 1 ? 8 : lerpDouble(8, 4, math.min(scale - 1, 1))!;

Expand Down
3 changes: 1 addition & 2 deletions lib/src/components/buttons/tertiary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class DSFRTertiaryButton extends DSFRBaseButton {
final dsfrColors = dsfrTheme.colors;
final dsfrTypography = dsfrTheme.typography;

final scale = MediaQuery.textScalerOf(context)
.scale(dsfrTypography.medium.fontSize ?? 1);
final scale = MediaQuery.textScalerOf(context).textScaleFactor;
final double gap =
scale <= 1 ? 8 : lerpDouble(8, 4, math.min(scale - 1, 1))!;

Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dev_dependencies:

flutter:
generate: true
uses-material-design: true
fonts:
- family: Marianne
fonts:
Expand Down
Binary file modified test/components/buttons/goldens/ci/primary_button_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/components/buttons/goldens/ci/primary_button_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/components/buttons/goldens/ci/secondary_button_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/components/buttons/goldens/ci/secondary_button_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/components/buttons/goldens/ci/tertiary_button_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/components/buttons/goldens/ci/tertiary_button_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/flutter_test_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {

return AlchemistConfig.runWithConfig(
config: AlchemistConfig(
ciGoldensConfig: const CiGoldensConfig(tolerance: 0.001),
ciGoldensConfig: const CiGoldensConfig(tolerance: 0.01),
theme: ThemeData(
fontFamily: DSFRFonts.marianne,
brightness: Brightness.light,
Expand Down

0 comments on commit 2b257b5

Please sign in to comment.