mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-10-19 06:40:59 +00:00
8c016e548b
* unified scaffold background color * unified components elevation * use filled tonal icon buttons * aligned slider colors with guidelines * removed unused `CloseButton` * migrated to outlined icons * moved timer list tile to the top of the section * updated goldens * migrated to the latest material utils * reaplced `SchemeTonalSpot` with `SchemeRainbow` * fixed ruler slider ticks color * update goldens * fixed tests * fixed scheme mapping and returned to `SchemeTonalSpot`
62 lines
2.2 KiB
Dart
62 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lightmeter/generated/l10n.dart';
|
|
import 'package:lightmeter/providers/services_provider.dart';
|
|
import 'package:lightmeter/res/dimens.dart';
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/shared/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart';
|
|
import 'package:lightmeter/screens/shared/transparent_dialog/widget_dialog_transparent.dart';
|
|
import 'package:lightmeter/utils/text_height.dart';
|
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
|
|
|
class ProFeaturesDialog extends StatelessWidget {
|
|
const ProFeaturesDialog({super.key});
|
|
|
|
double height(BuildContext context) => TransparentDialog.height(
|
|
context,
|
|
title: S.of(context).proFeatures,
|
|
contextHeight: dialogTextHeight(
|
|
context,
|
|
S.of(context).unlockProFeaturesDescription,
|
|
Theme.of(context).textTheme.bodyMedium,
|
|
Dimens.paddingL * 2,
|
|
),
|
|
);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return TransparentDialog(
|
|
icon: Icons.star_outlined,
|
|
title: S.of(context).proFeatures,
|
|
scrollableContent: false,
|
|
content: Flexible(
|
|
child: SingleChildScrollView(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingL),
|
|
child: Text(
|
|
S.of(context).unlockProFeaturesDescription,
|
|
style: Theme.of(context).textTheme.bodyMedium,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => _close(context),
|
|
child: Text(S.of(context).cancel),
|
|
),
|
|
FilledButton(
|
|
onPressed: () {
|
|
_close(context).then((_) {
|
|
ServicesProvider.maybeOf(context)
|
|
?.analytics
|
|
.setCustomKey('iap_product_type', IAPProductType.paidFeatures.storeId);
|
|
IAPProductsProvider.maybeOf(context)?.buy(IAPProductType.paidFeatures);
|
|
});
|
|
},
|
|
child: Text(S.of(context).unlock),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Future<void> _close(BuildContext context) async => AnimatedDialog.maybeClose(context) ?? Navigator.of(context).pop();
|
|
}
|