mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
added onExposurePairTap
callback
This commit is contained in:
parent
985ecaa41e
commit
922824e4c8
6 changed files with 53 additions and 26 deletions
|
@ -18,6 +18,7 @@ class CameraContainerProvider extends StatelessWidget {
|
|||
final ValueChanged<IsoValue> onIsoChanged;
|
||||
final ValueChanged<NdValue> onNdChanged;
|
||||
final List<ExposurePair> exposurePairs;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const CameraContainerProvider({
|
||||
required this.fastest,
|
||||
|
@ -27,6 +28,7 @@ class CameraContainerProvider extends StatelessWidget {
|
|||
required this.onIsoChanged,
|
||||
required this.onNdChanged,
|
||||
required this.exposurePairs,
|
||||
required this.onExposurePairTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
@ -54,6 +56,7 @@ class CameraContainerProvider extends StatelessWidget {
|
|||
onIsoChanged: onIsoChanged,
|
||||
onNdChanged: onNdChanged,
|
||||
exposurePairs: exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class CameraContainer extends StatelessWidget {
|
|||
final ValueChanged<IsoValue> onIsoChanged;
|
||||
final ValueChanged<NdValue> onNdChanged;
|
||||
final List<ExposurePair> exposurePairs;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const CameraContainer({
|
||||
required this.fastest,
|
||||
|
@ -38,6 +39,7 @@ class CameraContainer extends StatelessWidget {
|
|||
required this.onIsoChanged,
|
||||
required this.onNdChanged,
|
||||
required this.exposurePairs,
|
||||
required this.onExposurePairTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
@ -81,7 +83,10 @@ class CameraContainer extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: topBarOverflow >= 0 ? topBarOverflow : 0),
|
||||
child: ExposurePairsList(exposurePairs),
|
||||
child: ExposurePairsList(
|
||||
exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: Dimens.grid8),
|
||||
|
|
|
@ -15,6 +15,7 @@ class LightSensorContainerProvider extends StatelessWidget {
|
|||
final ValueChanged<IsoValue> onIsoChanged;
|
||||
final ValueChanged<NdValue> onNdChanged;
|
||||
final List<ExposurePair> exposurePairs;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const LightSensorContainerProvider({
|
||||
required this.fastest,
|
||||
|
@ -24,6 +25,7 @@ class LightSensorContainerProvider extends StatelessWidget {
|
|||
required this.onIsoChanged,
|
||||
required this.onNdChanged,
|
||||
required this.exposurePairs,
|
||||
required this.onExposurePairTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
@ -43,6 +45,7 @@ class LightSensorContainerProvider extends StatelessWidget {
|
|||
onIsoChanged: onIsoChanged,
|
||||
onNdChanged: onNdChanged,
|
||||
exposurePairs: exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ class LightSensorContainer extends StatelessWidget {
|
|||
final ValueChanged<IsoValue> onIsoChanged;
|
||||
final ValueChanged<NdValue> onNdChanged;
|
||||
final List<ExposurePair> exposurePairs;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const LightSensorContainer({
|
||||
required this.fastest,
|
||||
|
@ -23,6 +24,7 @@ class LightSensorContainer extends StatelessWidget {
|
|||
required this.onIsoChanged,
|
||||
required this.onNdChanged,
|
||||
required this.exposurePairs,
|
||||
required this.onExposurePairTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
|
@ -43,7 +45,12 @@ class LightSensorContainer extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||
child: Center(child: ExposurePairsList(exposurePairs)),
|
||||
child: Center(
|
||||
child: ExposurePairsList(
|
||||
exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -5,11 +5,13 @@ import 'package:lightmeter/providers/films_provider.dart';
|
|||
import 'package:lightmeter/res/dimens.dart';
|
||||
import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart';
|
||||
import 'package:lightmeter/screens/shared/icon_placeholder/widget_icon_placeholder.dart';
|
||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||
|
||||
class ExposurePairsList extends StatelessWidget {
|
||||
final List<ExposurePair> exposurePairs;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const ExposurePairsList(this.exposurePairs, {super.key});
|
||||
const ExposurePairsList(this.exposurePairs, {required this.onExposurePairTap, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -31,7 +33,11 @@ class ExposurePairsList extends StatelessWidget {
|
|||
itemBuilder: (_, index) => Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Row(
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onExposurePairTap(Films.selectedOf(context).reciprocityFailure(exposurePairs[index].shutterSpeed));
|
||||
},
|
||||
child: Row(
|
||||
key: ValueKey(index),
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -48,14 +54,14 @@ class ExposurePairsList extends StatelessWidget {
|
|||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: ExposurePairsListItem(
|
||||
Films.selectedOf(context)
|
||||
.reciprocityFailure(exposurePairs[index].shutterSpeed),
|
||||
Films.selectedOf(context).reciprocityFailure(exposurePairs[index].shutterSpeed),
|
||||
tickOnTheLeft: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
|
@ -63,9 +69,7 @@ class ExposurePairsList extends StatelessWidget {
|
|||
builder: (context, constraints) => Align(
|
||||
alignment: index == 0
|
||||
? Alignment.bottomCenter
|
||||
: (index == exposurePairs.length - 1
|
||||
? Alignment.topCenter
|
||||
: Alignment.center),
|
||||
: (index == exposurePairs.length - 1 ? Alignment.topCenter : Alignment.center),
|
||||
child: SizedBox(
|
||||
height: index == 0 || index == exposurePairs.length - 1
|
||||
? constraints.maxHeight / 2
|
||||
|
|
|
@ -34,6 +34,7 @@ class MeteringScreen extends StatelessWidget {
|
|||
nd: state.nd,
|
||||
onIsoChanged: (value) => context.read<MeteringBloc>().add(IsoChangedEvent(value)),
|
||||
onNdChanged: (value) => context.read<MeteringBloc>().add(NdChangedEvent(value)),
|
||||
onExposurePairTap: (value) => context.read<MeteringBloc>().add(SetTimerEvent(value)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -83,6 +84,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
|||
final NdValue nd;
|
||||
final ValueChanged<IsoValue> onIsoChanged;
|
||||
final ValueChanged<NdValue> onNdChanged;
|
||||
final ValueChanged<ShutterSpeedValue> onExposurePairTap;
|
||||
|
||||
const MeteringContainerBuidler({
|
||||
required this.ev,
|
||||
|
@ -90,6 +92,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
|||
required this.nd,
|
||||
required this.onIsoChanged,
|
||||
required this.onNdChanged,
|
||||
required this.onExposurePairTap,
|
||||
});
|
||||
|
||||
@override
|
||||
|
@ -113,6 +116,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
|||
onIsoChanged: onIsoChanged,
|
||||
onNdChanged: onNdChanged,
|
||||
exposurePairs: exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
)
|
||||
: LightSensorContainerProvider(
|
||||
fastest: fastest,
|
||||
|
@ -122,6 +126,7 @@ class MeteringContainerBuidler extends StatelessWidget {
|
|||
onIsoChanged: onIsoChanged,
|
||||
onNdChanged: onNdChanged,
|
||||
exposurePairs: exposurePairs,
|
||||
onExposurePairTap: onExposurePairTap,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue