diff --git a/lib/src/components/buttons/primary.dart b/lib/src/components/buttons/primary.dart index aa3ee80..2957eae 100644 --- a/lib/src/components/buttons/primary.dart +++ b/lib/src/components/buttons/primary.dart @@ -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))!; diff --git a/lib/src/components/buttons/secondary.dart b/lib/src/components/buttons/secondary.dart index 216cbc4..ebe2577 100644 --- a/lib/src/components/buttons/secondary.dart +++ b/lib/src/components/buttons/secondary.dart @@ -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))!; diff --git a/lib/src/components/buttons/tertiary.dart b/lib/src/components/buttons/tertiary.dart index ca962ad..28f8860 100644 --- a/lib/src/components/buttons/tertiary.dart +++ b/lib/src/components/buttons/tertiary.dart @@ -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))!; diff --git a/pubspec.yaml b/pubspec.yaml index bc0d8ad..9d7ad6d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,6 +24,7 @@ dev_dependencies: flutter: generate: true + uses-material-design: true fonts: - family: Marianne fonts: diff --git a/test/components/buttons/goldens/ci/primary_button_dark.png b/test/components/buttons/goldens/ci/primary_button_dark.png index 7e08851..c4e8637 100644 Binary files a/test/components/buttons/goldens/ci/primary_button_dark.png and b/test/components/buttons/goldens/ci/primary_button_dark.png differ diff --git a/test/components/buttons/goldens/ci/primary_button_light.png b/test/components/buttons/goldens/ci/primary_button_light.png index c5fa801..ce39bba 100644 Binary files a/test/components/buttons/goldens/ci/primary_button_light.png and b/test/components/buttons/goldens/ci/primary_button_light.png differ diff --git a/test/components/buttons/goldens/ci/secondary_button_dark.png b/test/components/buttons/goldens/ci/secondary_button_dark.png index eb7faf5..d96fd37 100644 Binary files a/test/components/buttons/goldens/ci/secondary_button_dark.png and b/test/components/buttons/goldens/ci/secondary_button_dark.png differ diff --git a/test/components/buttons/goldens/ci/secondary_button_light.png b/test/components/buttons/goldens/ci/secondary_button_light.png index 8447979..053f910 100644 Binary files a/test/components/buttons/goldens/ci/secondary_button_light.png and b/test/components/buttons/goldens/ci/secondary_button_light.png differ diff --git a/test/components/buttons/goldens/ci/tertiary_button_dark.png b/test/components/buttons/goldens/ci/tertiary_button_dark.png index fd0630d..eabaf37 100644 Binary files a/test/components/buttons/goldens/ci/tertiary_button_dark.png and b/test/components/buttons/goldens/ci/tertiary_button_dark.png differ diff --git a/test/components/buttons/goldens/ci/tertiary_button_light.png b/test/components/buttons/goldens/ci/tertiary_button_light.png index e2c43d2..46e196f 100644 Binary files a/test/components/buttons/goldens/ci/tertiary_button_light.png and b/test/components/buttons/goldens/ci/tertiary_button_light.png differ diff --git a/test/flutter_test_config.dart b/test/flutter_test_config.dart index 21b3ec7..25dffbb 100644 --- a/test/flutter_test_config.dart +++ b/test/flutter_test_config.dart @@ -13,7 +13,7 @@ Future testExecutable(FutureOr 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,