mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 08:20:40 +00:00
fixed feature checkbox width calculation
This commit is contained in:
parent
0b06d9b8c7
commit
719e50ed52
2 changed files with 6 additions and 16 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue