From 719e50ed52ff5af696d3000ccb0b11b314df63e9 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:37:19 +0200 Subject: [PATCH] fixed feature checkbox width calculation --- lib/data/models/app_feature.dart | 1 - .../pro_features/screen_pro_features.dart | 21 ++++++------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/data/models/app_feature.dart b/lib/data/models/app_feature.dart index d632815..7cf74ff 100644 --- a/lib/data/models/app_feature.dart +++ b/lib/data/models/app_feature.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/generated/l10n.dart'; -import 'package:lightmeter/providers/films_provider.dart'; enum AppFeature { reflectedLightMetering, diff --git a/lib/screens/pro_features/screen_pro_features.dart b/lib/screens/pro_features/screen_pro_features.dart index 9db2b60..ac34fb9 100644 --- a/lib/screens/pro_features/screen_pro_features.dart +++ b/lib/screens/pro_features/screen_pro_features.dart @@ -168,9 +168,6 @@ class _FeatureItem extends StatelessWidget { } class _FeatureHighlight extends StatelessWidget { - static double? _freeWidth; - static double? _proWidth; - final bool highlight; final bool roundedTop; final bool roundedBottom; @@ -185,20 +182,14 @@ class _FeatureHighlight extends StatelessWidget { @override Widget build(BuildContext context) { - _FeatureHighlight._freeWidth ??= textSize( - S.of(context).featuresFree, - Theme.of(context).textTheme.bodyMedium, - MediaQuery.sizeOf(context).width, - ).width; - _FeatureHighlight._proWidth ??= textSize( - S.of(context).featuresPro, - Theme.of(context).textTheme.bodyMedium, - MediaQuery.sizeOf(context).width, - ).width; return Container( constraints: BoxConstraints( - minWidth: - ((highlight ? _FeatureHighlight._proWidth : _FeatureHighlight._freeWidth) ?? 0.0) + Dimens.paddingM * 2, + minWidth: textSize( + highlight ? S.of(context).featuresPro : S.of(context).featuresFree, + Theme.of(context).textTheme.bodyMedium, + MediaQuery.sizeOf(context).width, + ).width + + Dimens.paddingM * 2, ), padding: const EdgeInsets.symmetric( horizontal: Dimens.paddingM,