2023-01-29 16:57:47 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
2023-04-05 19:15:11 +00:00
|
|
|
import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
|
2023-10-20 14:12:43 +00:00
|
|
|
import 'package:lightmeter/providers/equipment_profile_provider.dart';
|
2023-01-29 16:57:47 +00:00
|
|
|
import 'package:lightmeter/res/dimens.dart';
|
2023-09-14 14:59:16 +00:00
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/equipment_profile_picker/widget_picker_equipment_profiles.dart';
|
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/extreme_exposure_pairs_container/widget_container_extreme_exposure_pairs.dart';
|
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/film_picker/widget_picker_film.dart';
|
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/iso_picker/widget_picker_iso.dart';
|
2024-01-11 12:10:36 +00:00
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/lightmeter_pro/widget_lightmeter_pro.dart';
|
2023-09-14 14:59:16 +00:00
|
|
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/nd_picker/widget_picker_nd.dart';
|
2024-01-11 12:10:36 +00:00
|
|
|
import 'package:lightmeter/utils/context_utils.dart';
|
|
|
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
2023-03-30 19:24:18 +00:00
|
|
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
2023-01-29 16:57:47 +00:00
|
|
|
|
|
|
|
class ReadingsContainer extends StatelessWidget {
|
|
|
|
final ExposurePair? fastest;
|
|
|
|
final ExposurePair? slowest;
|
|
|
|
final IsoValue iso;
|
|
|
|
final NdValue nd;
|
|
|
|
final ValueChanged<IsoValue> onIsoChanged;
|
|
|
|
final ValueChanged<NdValue> onNdChanged;
|
|
|
|
|
|
|
|
const ReadingsContainer({
|
|
|
|
required this.fastest,
|
|
|
|
required this.slowest,
|
|
|
|
required this.iso,
|
|
|
|
required this.nd,
|
|
|
|
required this.onIsoChanged,
|
|
|
|
required this.onNdChanged,
|
|
|
|
super.key,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-01-11 12:10:36 +00:00
|
|
|
final isPro = IAPProducts.isPurchased(context, IAPProductType.paidFeatures);
|
2023-01-29 16:57:47 +00:00
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
children: [
|
2024-01-11 12:10:36 +00:00
|
|
|
if (!isPro) ...[
|
|
|
|
const LightmeterProAnimatedDialog(),
|
|
|
|
const _InnerPadding(),
|
|
|
|
],
|
|
|
|
if (isPro && context.meteringFeature(MeteringScreenLayoutFeature.equipmentProfiles)) ...[
|
2023-09-14 14:59:16 +00:00
|
|
|
const EquipmentProfilePicker(),
|
2023-03-30 19:24:18 +00:00
|
|
|
const _InnerPadding(),
|
|
|
|
],
|
2024-01-11 12:10:36 +00:00
|
|
|
if (context.meteringFeature(MeteringScreenLayoutFeature.extremeExposurePairs)) ...[
|
2023-09-14 14:59:16 +00:00
|
|
|
ExtremeExposurePairsContainer(
|
|
|
|
fastest: fastest,
|
|
|
|
slowest: slowest,
|
2023-04-05 19:15:11 +00:00
|
|
|
),
|
|
|
|
const _InnerPadding(),
|
|
|
|
],
|
2024-01-11 12:10:36 +00:00
|
|
|
if (isPro && context.meteringFeature(MeteringScreenLayoutFeature.filmPicker)) ...[
|
2023-09-14 14:59:16 +00:00
|
|
|
FilmPicker(selectedIso: iso),
|
2023-04-05 19:15:11 +00:00
|
|
|
const _InnerPadding(),
|
|
|
|
],
|
2023-01-29 16:57:47 +00:00
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
2023-09-14 14:59:16 +00:00
|
|
|
child: IsoValuePicker(
|
2023-03-30 19:24:18 +00:00
|
|
|
selectedValue: iso,
|
2023-08-14 10:25:37 +00:00
|
|
|
values: EquipmentProfiles.selectedOf(context).isoValues,
|
2023-01-29 16:57:47 +00:00
|
|
|
onChanged: onIsoChanged,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const _InnerPadding(),
|
|
|
|
Expanded(
|
2023-09-14 14:59:16 +00:00
|
|
|
child: NdValuePicker(
|
2023-03-30 19:24:18 +00:00
|
|
|
selectedValue: nd,
|
2023-08-14 10:25:37 +00:00
|
|
|
values: EquipmentProfiles.selectedOf(context).ndValues,
|
2023-01-29 16:57:47 +00:00
|
|
|
onChanged: onNdChanged,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
2023-03-30 19:24:18 +00:00
|
|
|
),
|
2023-01-29 16:57:47 +00:00
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class _InnerPadding extends SizedBox {
|
|
|
|
const _InnerPadding() : super(height: Dimens.grid8, width: Dimens.grid8);
|
|
|
|
}
|