2023-09-17 20:29:02 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:lightmeter/generated/l10n.dart';
|
|
|
|
import 'package:lightmeter/res/dimens.dart';
|
2024-01-12 11:55:29 +00:00
|
|
|
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';
|
2024-01-12 12:17:05 +00:00
|
|
|
import 'package:lightmeter/utils/text_height.dart';
|
2023-09-17 20:29:02 +00:00
|
|
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
|
|
|
|
2024-01-12 11:55:29 +00:00
|
|
|
class ProFeaturesDialog extends StatelessWidget {
|
|
|
|
const ProFeaturesDialog({super.key});
|
|
|
|
|
2024-01-12 12:17:05 +00:00
|
|
|
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,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2024-01-12 11:55:29 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return TransparentDialog(
|
|
|
|
icon: Icons.star,
|
|
|
|
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,
|
|
|
|
),
|
2023-11-11 20:05:11 +00:00
|
|
|
),
|
|
|
|
),
|
2024-01-12 11:55:29 +00:00
|
|
|
),
|
2023-09-17 20:29:02 +00:00
|
|
|
actions: [
|
|
|
|
TextButton(
|
2024-01-12 11:55:29 +00:00
|
|
|
onPressed: () => _close(context),
|
2023-09-17 20:29:02 +00:00
|
|
|
child: Text(S.of(context).cancel),
|
|
|
|
),
|
|
|
|
FilledButton(
|
|
|
|
onPressed: () {
|
2024-01-12 11:55:29 +00:00
|
|
|
_close(context).then((_) => IAPProductsProvider.maybeOf(context)?.buy(IAPProductType.paidFeatures));
|
2023-09-17 20:29:02 +00:00
|
|
|
},
|
2024-01-12 11:55:29 +00:00
|
|
|
child: Text(S.of(context).unlock),
|
2023-09-17 20:29:02 +00:00
|
|
|
),
|
|
|
|
],
|
2024-01-12 11:55:29 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> _close(BuildContext context) async => AnimatedDialog.maybeClose(context) ?? Navigator.of(context).pop();
|
2023-09-17 20:29:02 +00:00
|
|
|
}
|