mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-23 16:00:41 +00:00
f0d707b071
* Upgraded `targetSdkVersion` to 34
* added price to `IAPProduct`
* implemented `ProFeaturesScreen` (wip)
* finalized `ProFeaturesScreen` layout
* replaced `ProFeaturesDialog` with `ProFeaturesScreen`
* added translations
* fixed feature checkbox width calculation
* fixed tests
* separated android & ios features
* NPE
* changed "get pro" tile colors
* unified Lightmeter Pro related naming
* typo
* updated golden tests
* use iap 0.11.0
* revert unrelated changes
This reverts commit bae5ead8f0
.
* lint
* adjusted eng translation
* updated goldens
36 lines
743 B
Dart
36 lines
743 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lightmeter/res/dimens.dart';
|
|
|
|
double dialogTextHeight(
|
|
BuildContext context,
|
|
String text,
|
|
TextStyle? style,
|
|
double textPadding,
|
|
) =>
|
|
textHeight(
|
|
text,
|
|
style,
|
|
MediaQuery.sizeOf(context).width - Dimens.dialogMargin.horizontal - textPadding,
|
|
);
|
|
|
|
double textHeight(
|
|
String text,
|
|
TextStyle? style,
|
|
double maxWidth,
|
|
) =>
|
|
textSize(text, style, maxWidth).height;
|
|
|
|
Size textSize(
|
|
String text,
|
|
TextStyle? style,
|
|
double maxWidth,
|
|
) {
|
|
final TextPainter titlePainter = TextPainter(
|
|
text: TextSpan(
|
|
text: text,
|
|
style: style,
|
|
),
|
|
textDirection: TextDirection.ltr,
|
|
)..layout(maxWidth: maxWidth);
|
|
return titlePainter.size;
|
|
}
|