mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
use photography values from remote repo
This commit is contained in:
parent
86c7a9c839
commit
bac2fe9135
25 changed files with 40 additions and 392 deletions
|
@ -1,22 +0,0 @@
|
||||||
import 'package:lightmeter/data/models/photography_values/aperture_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart';
|
|
||||||
|
|
||||||
class EquipmentProfileData {
|
|
||||||
final String id;
|
|
||||||
final String name;
|
|
||||||
final List<ApertureValue> apertureValues;
|
|
||||||
final List<NdValue> ndValues;
|
|
||||||
final List<ShutterSpeedValue> shutterSpeedValues;
|
|
||||||
final List<IsoValue> isoValues;
|
|
||||||
|
|
||||||
const EquipmentProfileData({
|
|
||||||
required this.id,
|
|
||||||
required this.name,
|
|
||||||
required this.apertureValues,
|
|
||||||
required this.ndValues,
|
|
||||||
required this.shutterSpeedValues,
|
|
||||||
required this.isoValues,
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'photography_values/aperture_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'photography_values/shutter_speed_value.dart';
|
|
||||||
|
|
||||||
class ExposurePair {
|
class ExposurePair {
|
||||||
final ApertureValue aperture;
|
final ApertureValue aperture;
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
import 'photography_value.dart';
|
|
||||||
|
|
||||||
class ApertureValue extends PhotographyStopValue<double> {
|
|
||||||
const ApertureValue(super.rawValue, super.stopType);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
final buffer = StringBuffer("f/");
|
|
||||||
if (rawValue - rawValue.floor() == 0 && rawValue >= 8) {
|
|
||||||
buffer.write(rawValue.toInt().toString());
|
|
||||||
} else {
|
|
||||||
buffer.write(rawValue.toStringAsFixed(1));
|
|
||||||
}
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const List<ApertureValue> apertureValues = [
|
|
||||||
ApertureValue(1.0, StopType.full),
|
|
||||||
ApertureValue(1.1, StopType.third),
|
|
||||||
ApertureValue(1.2, StopType.half),
|
|
||||||
ApertureValue(1.2, StopType.third),
|
|
||||||
ApertureValue(1.4, StopType.full),
|
|
||||||
ApertureValue(1.6, StopType.third),
|
|
||||||
ApertureValue(1.7, StopType.half),
|
|
||||||
ApertureValue(1.8, StopType.third),
|
|
||||||
ApertureValue(2.0, StopType.full),
|
|
||||||
ApertureValue(2.2, StopType.third),
|
|
||||||
ApertureValue(2.4, StopType.half),
|
|
||||||
ApertureValue(2.4, StopType.third),
|
|
||||||
ApertureValue(2.8, StopType.full),
|
|
||||||
ApertureValue(3.2, StopType.third),
|
|
||||||
ApertureValue(3.3, StopType.half),
|
|
||||||
ApertureValue(3.5, StopType.third),
|
|
||||||
ApertureValue(4.0, StopType.full),
|
|
||||||
ApertureValue(4.5, StopType.third),
|
|
||||||
ApertureValue(4.8, StopType.half),
|
|
||||||
ApertureValue(5.0, StopType.third),
|
|
||||||
ApertureValue(5.6, StopType.full),
|
|
||||||
ApertureValue(6.3, StopType.third),
|
|
||||||
ApertureValue(6.7, StopType.half),
|
|
||||||
ApertureValue(7.1, StopType.third),
|
|
||||||
ApertureValue(8, StopType.full),
|
|
||||||
ApertureValue(9, StopType.third),
|
|
||||||
ApertureValue(9.5, StopType.half),
|
|
||||||
ApertureValue(10, StopType.third),
|
|
||||||
ApertureValue(11, StopType.full),
|
|
||||||
ApertureValue(13, StopType.third),
|
|
||||||
ApertureValue(13, StopType.half),
|
|
||||||
ApertureValue(14, StopType.third),
|
|
||||||
ApertureValue(16, StopType.full),
|
|
||||||
ApertureValue(18, StopType.third),
|
|
||||||
ApertureValue(19, StopType.half),
|
|
||||||
ApertureValue(20, StopType.third),
|
|
||||||
ApertureValue(22, StopType.full),
|
|
||||||
ApertureValue(25, StopType.third),
|
|
||||||
ApertureValue(27, StopType.half),
|
|
||||||
ApertureValue(29, StopType.third),
|
|
||||||
ApertureValue(32, StopType.full),
|
|
||||||
ApertureValue(36, StopType.third),
|
|
||||||
ApertureValue(38, StopType.half),
|
|
||||||
ApertureValue(42, StopType.third),
|
|
||||||
ApertureValue(45, StopType.full),
|
|
||||||
];
|
|
|
@ -1,45 +0,0 @@
|
||||||
import 'photography_value.dart';
|
|
||||||
|
|
||||||
class IsoValue extends PhotographyStopValue<int> {
|
|
||||||
const IsoValue(super.rawValue, super.stopType);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() => value.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
const List<IsoValue> isoValues = [
|
|
||||||
IsoValue(3, StopType.full),
|
|
||||||
IsoValue(4, StopType.third),
|
|
||||||
IsoValue(5, StopType.third),
|
|
||||||
IsoValue(6, StopType.full),
|
|
||||||
IsoValue(8, StopType.third),
|
|
||||||
IsoValue(10, StopType.third),
|
|
||||||
IsoValue(12, StopType.full),
|
|
||||||
IsoValue(16, StopType.third),
|
|
||||||
IsoValue(20, StopType.third),
|
|
||||||
IsoValue(25, StopType.full),
|
|
||||||
IsoValue(32, StopType.third),
|
|
||||||
IsoValue(40, StopType.third),
|
|
||||||
IsoValue(50, StopType.full),
|
|
||||||
IsoValue(64, StopType.third),
|
|
||||||
IsoValue(80, StopType.third),
|
|
||||||
IsoValue(100, StopType.full),
|
|
||||||
IsoValue(125, StopType.third),
|
|
||||||
IsoValue(160, StopType.third),
|
|
||||||
IsoValue(200, StopType.full),
|
|
||||||
IsoValue(250, StopType.third),
|
|
||||||
IsoValue(320, StopType.third),
|
|
||||||
IsoValue(400, StopType.full),
|
|
||||||
IsoValue(500, StopType.third),
|
|
||||||
IsoValue(640, StopType.third),
|
|
||||||
IsoValue(800, StopType.full),
|
|
||||||
IsoValue(1000, StopType.third),
|
|
||||||
IsoValue(1250, StopType.third),
|
|
||||||
IsoValue(1600, StopType.full),
|
|
||||||
IsoValue(2000, StopType.third),
|
|
||||||
IsoValue(2500, StopType.third),
|
|
||||||
IsoValue(3200, StopType.full),
|
|
||||||
IsoValue(4000, StopType.third),
|
|
||||||
IsoValue(5000, StopType.third),
|
|
||||||
IsoValue(6400, StopType.full),
|
|
||||||
];
|
|
|
@ -1,34 +0,0 @@
|
||||||
import 'package:lightmeter/utils/log_2.dart';
|
|
||||||
|
|
||||||
import 'photography_value.dart';
|
|
||||||
|
|
||||||
class NdValue extends PhotographyValue<int> {
|
|
||||||
const NdValue(super.rawValue);
|
|
||||||
|
|
||||||
double get stopReduction => value == 0 ? 0.0 : log2(value);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() => 'ND$value';
|
|
||||||
}
|
|
||||||
|
|
||||||
/// https://shuttermuse.com/neutral-density-filter-numbers-names/
|
|
||||||
const List<NdValue> ndValues = [
|
|
||||||
NdValue(0),
|
|
||||||
NdValue(2),
|
|
||||||
NdValue(4),
|
|
||||||
NdValue(8),
|
|
||||||
NdValue(16),
|
|
||||||
NdValue(32),
|
|
||||||
NdValue(64),
|
|
||||||
NdValue(100),
|
|
||||||
NdValue(128),
|
|
||||||
NdValue(256),
|
|
||||||
NdValue(400),
|
|
||||||
NdValue(512),
|
|
||||||
NdValue(1024),
|
|
||||||
NdValue(2048),
|
|
||||||
NdValue(4096),
|
|
||||||
NdValue(6310),
|
|
||||||
NdValue(8192),
|
|
||||||
NdValue(10000),
|
|
||||||
];
|
|
|
@ -1,51 +0,0 @@
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:lightmeter/utils/log_2.dart';
|
|
||||||
|
|
||||||
enum StopType { full, half, third }
|
|
||||||
|
|
||||||
abstract class PhotographyValue<T extends num> {
|
|
||||||
final T rawValue;
|
|
||||||
|
|
||||||
const PhotographyValue(this.rawValue);
|
|
||||||
|
|
||||||
T get value => rawValue;
|
|
||||||
|
|
||||||
/// EV difference between `this` and `other`
|
|
||||||
double evDifference(PhotographyValue other) => log2(max(1, other.value) / max(1, value));
|
|
||||||
|
|
||||||
String toStringDifference(PhotographyValue other) {
|
|
||||||
final ev = log2(max(1, other.value) / max(1, value));
|
|
||||||
final buffer = StringBuffer();
|
|
||||||
if (ev > 0) {
|
|
||||||
buffer.write('+');
|
|
||||||
}
|
|
||||||
buffer.write(ev.toStringAsFixed(1));
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class PhotographyStopValue<T extends num> extends PhotographyValue<T> {
|
|
||||||
final StopType stopType;
|
|
||||||
|
|
||||||
const PhotographyStopValue(super.rawValue, this.stopType);
|
|
||||||
}
|
|
||||||
|
|
||||||
extension PhotographyStopValues<T extends PhotographyStopValue> on List<T> {
|
|
||||||
List<T> whereStopType(StopType stopType) {
|
|
||||||
switch (stopType) {
|
|
||||||
case StopType.full:
|
|
||||||
return where((e) => e.stopType == StopType.full).toList();
|
|
||||||
case StopType.half:
|
|
||||||
return where((e) => e.stopType == StopType.full || e.stopType == StopType.half).toList();
|
|
||||||
case StopType.third:
|
|
||||||
return where((e) => e.stopType == StopType.full || e.stopType == StopType.third).toList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<T> fullStops() => whereStopType(StopType.full);
|
|
||||||
|
|
||||||
List<T> halfStops() => whereStopType(StopType.half);
|
|
||||||
|
|
||||||
List<T> thirdStops() => whereStopType(StopType.third);
|
|
||||||
}
|
|
|
@ -1,87 +0,0 @@
|
||||||
import 'photography_value.dart';
|
|
||||||
|
|
||||||
class ShutterSpeedValue extends PhotographyStopValue<double> {
|
|
||||||
final bool isFraction;
|
|
||||||
|
|
||||||
const ShutterSpeedValue(super.rawValue, this.isFraction, super.stopType);
|
|
||||||
|
|
||||||
@override
|
|
||||||
double get value => isFraction ? 1 / rawValue : rawValue;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
final buffer = StringBuffer();
|
|
||||||
if (isFraction) buffer.write("1/");
|
|
||||||
if (rawValue - rawValue.floor() == 0) {
|
|
||||||
buffer.write(rawValue.toInt().toString());
|
|
||||||
} else {
|
|
||||||
buffer.write(rawValue.toStringAsFixed(1));
|
|
||||||
}
|
|
||||||
if (!isFraction) buffer.write("\"");
|
|
||||||
return buffer.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const List<ShutterSpeedValue> shutterSpeedValues = [
|
|
||||||
ShutterSpeedValue(2000, true, StopType.full),
|
|
||||||
ShutterSpeedValue(1600, true, StopType.third),
|
|
||||||
ShutterSpeedValue(1500, true, StopType.half),
|
|
||||||
ShutterSpeedValue(1250, true, StopType.third),
|
|
||||||
ShutterSpeedValue(1000, true, StopType.full),
|
|
||||||
ShutterSpeedValue(800, true, StopType.third),
|
|
||||||
ShutterSpeedValue(750, true, StopType.half),
|
|
||||||
ShutterSpeedValue(640, true, StopType.third),
|
|
||||||
ShutterSpeedValue(500, true, StopType.full),
|
|
||||||
ShutterSpeedValue(400, true, StopType.third),
|
|
||||||
ShutterSpeedValue(350, true, StopType.half),
|
|
||||||
ShutterSpeedValue(320, true, StopType.third),
|
|
||||||
ShutterSpeedValue(250, true, StopType.full),
|
|
||||||
ShutterSpeedValue(200, true, StopType.third),
|
|
||||||
ShutterSpeedValue(180, true, StopType.half),
|
|
||||||
ShutterSpeedValue(160, true, StopType.third),
|
|
||||||
ShutterSpeedValue(125, true, StopType.full),
|
|
||||||
ShutterSpeedValue(100, true, StopType.third),
|
|
||||||
ShutterSpeedValue(90, true, StopType.half),
|
|
||||||
ShutterSpeedValue(80, true, StopType.third),
|
|
||||||
ShutterSpeedValue(60, true, StopType.full),
|
|
||||||
ShutterSpeedValue(50, true, StopType.third),
|
|
||||||
ShutterSpeedValue(45, true, StopType.half),
|
|
||||||
ShutterSpeedValue(40, true, StopType.third),
|
|
||||||
ShutterSpeedValue(30, true, StopType.full),
|
|
||||||
ShutterSpeedValue(25, true, StopType.third),
|
|
||||||
ShutterSpeedValue(20, true, StopType.half),
|
|
||||||
ShutterSpeedValue(20, true, StopType.third),
|
|
||||||
ShutterSpeedValue(15, true, StopType.full),
|
|
||||||
ShutterSpeedValue(13, true, StopType.third),
|
|
||||||
ShutterSpeedValue(10, true, StopType.half),
|
|
||||||
ShutterSpeedValue(10, true, StopType.third),
|
|
||||||
ShutterSpeedValue(8, true, StopType.full),
|
|
||||||
ShutterSpeedValue(6, true, StopType.third),
|
|
||||||
ShutterSpeedValue(6, true, StopType.half),
|
|
||||||
ShutterSpeedValue(5, true, StopType.third),
|
|
||||||
ShutterSpeedValue(4, true, StopType.full),
|
|
||||||
ShutterSpeedValue(3, true, StopType.third),
|
|
||||||
ShutterSpeedValue(3, true, StopType.half),
|
|
||||||
ShutterSpeedValue(2.5, true, StopType.third),
|
|
||||||
ShutterSpeedValue(2, true, StopType.full),
|
|
||||||
ShutterSpeedValue(1.6, true, StopType.third),
|
|
||||||
ShutterSpeedValue(1.5, true, StopType.half),
|
|
||||||
ShutterSpeedValue(1.3, true, StopType.third),
|
|
||||||
ShutterSpeedValue(1, false, StopType.full),
|
|
||||||
ShutterSpeedValue(1.3, false, StopType.third),
|
|
||||||
ShutterSpeedValue(1.5, false, StopType.half),
|
|
||||||
ShutterSpeedValue(1.6, false, StopType.third),
|
|
||||||
ShutterSpeedValue(2, false, StopType.full),
|
|
||||||
ShutterSpeedValue(2.5, false, StopType.third),
|
|
||||||
ShutterSpeedValue(3, false, StopType.half),
|
|
||||||
ShutterSpeedValue(3, false, StopType.third),
|
|
||||||
ShutterSpeedValue(4, false, StopType.full),
|
|
||||||
ShutterSpeedValue(5, false, StopType.third),
|
|
||||||
ShutterSpeedValue(6, false, StopType.half),
|
|
||||||
ShutterSpeedValue(6, false, StopType.third),
|
|
||||||
ShutterSpeedValue(8, false, StopType.full),
|
|
||||||
ShutterSpeedValue(10, false, StopType.third),
|
|
||||||
ShutterSpeedValue(12, false, StopType.half),
|
|
||||||
ShutterSpeedValue(13, false, StopType.third),
|
|
||||||
ShutterSpeedValue(16, false, StopType.full),
|
|
||||||
];
|
|
|
@ -1,10 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/supported_locale.dart';
|
import 'package:lightmeter/data/models/supported_locale.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
import 'models/ev_source_type.dart';
|
import 'models/ev_source_type.dart';
|
||||||
import 'models/photography_values/iso_value.dart';
|
|
||||||
import 'models/photography_values/nd_value.dart';
|
|
||||||
import 'models/theme_type.dart';
|
import 'models/theme_type.dart';
|
||||||
|
|
||||||
class UserPreferencesService {
|
class UserPreferencesService {
|
||||||
|
@ -64,13 +63,16 @@ class UserPreferencesService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IsoValue get iso => isoValues.firstWhere((v) => v.value == (_sharedPreferences.getInt(_isoKey) ?? 100));
|
IsoValue get iso =>
|
||||||
|
isoValues.firstWhere((v) => v.value == (_sharedPreferences.getInt(_isoKey) ?? 100));
|
||||||
set iso(IsoValue value) => _sharedPreferences.setInt(_isoKey, value.value);
|
set iso(IsoValue value) => _sharedPreferences.setInt(_isoKey, value.value);
|
||||||
|
|
||||||
NdValue get ndFilter => ndValues.firstWhere((v) => v.value == (_sharedPreferences.getInt(_ndFilterKey) ?? 0));
|
NdValue get ndFilter =>
|
||||||
|
ndValues.firstWhere((v) => v.value == (_sharedPreferences.getInt(_ndFilterKey) ?? 0));
|
||||||
set ndFilter(NdValue value) => _sharedPreferences.setInt(_ndFilterKey, value.value);
|
set ndFilter(NdValue value) => _sharedPreferences.setInt(_ndFilterKey, value.value);
|
||||||
|
|
||||||
EvSourceType get evSourceType => EvSourceType.values[_sharedPreferences.getInt(_evSourceTypeKey) ?? 0];
|
EvSourceType get evSourceType =>
|
||||||
|
EvSourceType.values[_sharedPreferences.getInt(_evSourceTypeKey) ?? 0];
|
||||||
set evSourceType(EvSourceType value) => _sharedPreferences.setInt(_evSourceTypeKey, value.index);
|
set evSourceType(EvSourceType value) => _sharedPreferences.setInt(_evSourceTypeKey, value.index);
|
||||||
|
|
||||||
bool get caffeine => _sharedPreferences.getBool(_caffeineKey) ?? false;
|
bool get caffeine => _sharedPreferences.getBool(_caffeineKey) ?? false;
|
||||||
|
@ -86,10 +88,13 @@ class UserPreferencesService {
|
||||||
set locale(SupportedLocale value) => _sharedPreferences.setString(_localeKey, value.toString());
|
set locale(SupportedLocale value) => _sharedPreferences.setString(_localeKey, value.toString());
|
||||||
|
|
||||||
double get cameraEvCalibration => _sharedPreferences.getDouble(_cameraEvCalibrationKey) ?? 0.0;
|
double get cameraEvCalibration => _sharedPreferences.getDouble(_cameraEvCalibrationKey) ?? 0.0;
|
||||||
set cameraEvCalibration(double value) => _sharedPreferences.setDouble(_cameraEvCalibrationKey, value);
|
set cameraEvCalibration(double value) =>
|
||||||
|
_sharedPreferences.setDouble(_cameraEvCalibrationKey, value);
|
||||||
|
|
||||||
double get lightSensorEvCalibration => _sharedPreferences.getDouble(_lightSensorEvCalibrationKey) ?? 0.0;
|
double get lightSensorEvCalibration =>
|
||||||
set lightSensorEvCalibration(double value) => _sharedPreferences.setDouble(_lightSensorEvCalibrationKey, value);
|
_sharedPreferences.getDouble(_lightSensorEvCalibrationKey) ?? 0.0;
|
||||||
|
set lightSensorEvCalibration(double value) =>
|
||||||
|
_sharedPreferences.setDouble(_lightSensorEvCalibrationKey, value);
|
||||||
|
|
||||||
ThemeType get themeType => ThemeType.values[_sharedPreferences.getInt(_themeTypeKey) ?? 0];
|
ThemeType get themeType => ThemeType.values[_sharedPreferences.getInt(_themeTypeKey) ?? 0];
|
||||||
set themeType(ThemeType value) => _sharedPreferences.setInt(_themeTypeKey, value.index);
|
set themeType(ThemeType value) => _sharedPreferences.setInt(_themeTypeKey, value.index);
|
||||||
|
|
|
@ -2,19 +2,14 @@ import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/aperture_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart';
|
|
||||||
import 'package:lightmeter/data/shared_prefs_service.dart';
|
import 'package:lightmeter/data/shared_prefs_service.dart';
|
||||||
import 'package:lightmeter/interactors/metering_interactor.dart';
|
import 'package:lightmeter/interactors/metering_interactor.dart';
|
||||||
import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart'
|
import 'package:lightmeter/screens/metering/communication/event_communication_metering.dart'
|
||||||
as communication_events;
|
as communication_events;
|
||||||
import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart'
|
import 'package:lightmeter/screens/metering/communication/state_communication_metering.dart'
|
||||||
as communication_states;
|
as communication_states;
|
||||||
import 'package:lightmeter/utils/log_2.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'communication/bloc_communication_metering.dart';
|
import 'communication/bloc_communication_metering.dart';
|
||||||
import 'event_metering.dart';
|
import 'event_metering.dart';
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/interactors/metering_interactor.dart';
|
import 'package:lightmeter/interactors/metering_interactor.dart';
|
||||||
import 'package:lightmeter/providers/equipment_profile_provider.dart';
|
|
||||||
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
|
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
|
||||||
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'bloc_container_camera.dart';
|
import 'bloc_container_camera.dart';
|
||||||
import 'widget_container_camera.dart';
|
import 'widget_container_camera.dart';
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/platform_config.dart';
|
import 'package:lightmeter/platform_config.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
|
||||||
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_view/widget_camera_view.dart';
|
import 'package:lightmeter/screens/metering/components/camera_container/components/camera_view/widget_camera_view.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
|
import 'package:lightmeter/screens/metering/components/camera_container/models/camera_error_type.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart';
|
import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/shared/metering_top_bar/widget_top_bar_metering.dart';
|
import 'package:lightmeter/screens/metering/components/shared/metering_top_bar/widget_top_bar_metering.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/shared/readings_container/widget_container_readings.dart';
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/widget_container_readings.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'bloc_container_camera.dart';
|
import 'bloc_container_camera.dart';
|
||||||
import 'components/camera_controls/widget_camera_controls.dart';
|
import 'components/camera_controls/widget_camera_controls.dart';
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/interactors/metering_interactor.dart';
|
import 'package:lightmeter/interactors/metering_interactor.dart';
|
||||||
import 'package:lightmeter/providers/equipment_profile_provider.dart';
|
|
||||||
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
|
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
|
||||||
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'bloc_container_light_sensor.dart';
|
import 'bloc_container_light_sensor.dart';
|
||||||
import 'widget_container_light_sensor.dart';
|
import 'widget_container_light_sensor.dart';
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
|
||||||
import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart';
|
import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/shared/metering_top_bar/widget_top_bar_metering.dart';
|
import 'package:lightmeter/screens/metering/components/shared/metering_top_bar/widget_top_bar_metering.dart';
|
||||||
import 'package:lightmeter/screens/metering/components/shared/readings_container/widget_container_readings.dart';
|
import 'package:lightmeter/screens/metering/components/shared/readings_container/widget_container_readings.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
class LightSensorContainer extends StatelessWidget {
|
class LightSensorContainer extends StatelessWidget {
|
||||||
final ExposurePair? fastest;
|
final ExposurePair? fastest;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
|
||||||
|
|
||||||
class ExposurePairsListItem<T extends PhotographyStopValue> extends StatelessWidget {
|
class ExposurePairsListItem<T extends PhotographyStopValue> extends StatelessWidget {
|
||||||
final T value;
|
final T value;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
|
||||||
|
|
||||||
typedef DialogPickerItemBuilder<T extends PhotographyValue> = Widget Function(BuildContext, T);
|
typedef DialogPickerItemBuilder<T extends PhotographyValue> = Widget Function(BuildContext, T);
|
||||||
typedef DialogPickerEvDifferenceBuilder<T extends PhotographyValue> = String Function(
|
typedef DialogPickerEvDifferenceBuilder<T extends PhotographyValue> = String Function(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'components/animated_dialog/widget_dialog_animated.dart';
|
import 'components/animated_dialog/widget_dialog_animated.dart';
|
||||||
import 'components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart';
|
import 'components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart';
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'components/animated_dialog_picker/widget_dialog_animated_picker.dart';
|
import 'components/animated_dialog_picker/widget_dialog_animated_picker.dart';
|
||||||
import 'components/reading_value_container/widget_container_reading_value.dart';
|
import 'components/reading_value_container/widget_container_reading_value.dart';
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
|
|
||||||
abstract class MeteringEvent {
|
abstract class MeteringEvent {
|
||||||
const MeteringEvent();
|
const MeteringEvent();
|
||||||
|
|
|
@ -3,10 +3,10 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/caffeine_service.dart';
|
import 'package:lightmeter/data/caffeine_service.dart';
|
||||||
import 'package:lightmeter/data/haptics_service.dart';
|
import 'package:lightmeter/data/haptics_service.dart';
|
||||||
import 'package:lightmeter/data/light_sensor_service.dart';
|
import 'package:lightmeter/data/light_sensor_service.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
import 'package:lightmeter/data/permissions_service.dart';
|
import 'package:lightmeter/data/permissions_service.dart';
|
||||||
import 'package:lightmeter/data/shared_prefs_service.dart';
|
import 'package:lightmeter/data/shared_prefs_service.dart';
|
||||||
import 'package:lightmeter/interactors/metering_interactor.dart';
|
import 'package:lightmeter/interactors/metering_interactor.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import 'bloc_metering.dart';
|
import 'bloc_metering.dart';
|
||||||
|
|
|
@ -2,11 +2,9 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:lightmeter/data/models/ev_source_type.dart';
|
import 'package:lightmeter/data/models/ev_source_type.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
import 'package:lightmeter/environment.dart';
|
import 'package:lightmeter/environment.dart';
|
||||||
import 'package:lightmeter/providers/ev_source_type_provider.dart';
|
import 'package:lightmeter/providers/ev_source_type_provider.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
|
||||||
import 'components/bottom_controls/provider_bottom_controls.dart';
|
import 'components/bottom_controls/provider_bottom_controls.dart';
|
||||||
import 'components/camera_container/provider_container_camera.dart';
|
import 'components/camera_container/provider_container_camera.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/nd_value.dart';
|
|
||||||
|
|
||||||
abstract class MeteringState {
|
abstract class MeteringState {
|
||||||
const MeteringState();
|
const MeteringState();
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/screens/settings/components/shared/dialog_picker.dart/widget_dialog_picker.dart';
|
import 'package:lightmeter/screens/settings/components/shared/dialog_picker.dart/widget_dialog_picker.dart';
|
||||||
import 'package:lightmeter/utils/stop_type_provider.dart';
|
import 'package:lightmeter/utils/stop_type_provider.dart';
|
||||||
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class StopTypeListTile extends StatelessWidget {
|
class StopTypeListTile extends StatelessWidget {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class StopTypeProvider extends StatefulWidget {
|
class StopTypeProvider extends StatefulWidget {
|
||||||
|
|
10
pubspec.yaml
10
pubspec.yaml
|
@ -1,7 +1,7 @@
|
||||||
name: lightmeter
|
name: lightmeter
|
||||||
description: A new Flutter project.
|
description: A new Flutter project.
|
||||||
publish_to: "none"
|
publish_to: "none"
|
||||||
version: 0.8.1+13
|
version: 0.8.2+14
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.18.0 <3.0.0"
|
sdk: ">=2.18.0 <3.0.0"
|
||||||
|
@ -20,6 +20,14 @@ dependencies:
|
||||||
intl_utils: 2.8.1
|
intl_utils: 2.8.1
|
||||||
light_sensor: 2.0.2
|
light_sensor: 2.0.2
|
||||||
material_color_utilities: 0.2.0
|
material_color_utilities: 0.2.0
|
||||||
|
m3_lightmeter_iap:
|
||||||
|
git:
|
||||||
|
url: "https://github.com/vodemn/m3_lightmeter_iap"
|
||||||
|
ref: main
|
||||||
|
m3_lightmeter_resources:
|
||||||
|
git:
|
||||||
|
url: "https://github.com/vodemn/m3_lightmeter_resources"
|
||||||
|
ref: main
|
||||||
package_info_plus: 3.0.2
|
package_info_plus: 3.0.2
|
||||||
permission_handler: 10.2.0
|
permission_handler: 10.2.0
|
||||||
provider: 6.0.4
|
provider: 6.0.4
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
import 'package:lightmeter/data/models/photography_values/aperture_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/iso_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/photography_value.dart';
|
|
||||||
import 'package:lightmeter/data/models/photography_values/shutter_speed_value.dart';
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
// Stringify
|
|
||||||
test('Stringify aperture values', () {
|
|
||||||
expect(apertureValues.first.toString(), "f/1.0");
|
|
||||||
expect(apertureValues.last.toString(), "f/45");
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Stringify iso values', () {
|
|
||||||
expect(isoValues.first.toString(), "3");
|
|
||||||
expect(isoValues.last.toString(), "6400");
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Stringify shutter speed values', () {
|
|
||||||
expect(shutterSpeedValues.first.toString(), "1/2000");
|
|
||||||
expect(shutterSpeedValues.last.toString(), "16\"");
|
|
||||||
});
|
|
||||||
|
|
||||||
// Stops
|
|
||||||
test('Aperture values stops lists', () {
|
|
||||||
expect(apertureValues.fullStops().length, 12);
|
|
||||||
expect(apertureValues.halfStops().length, 12 + 11);
|
|
||||||
expect(apertureValues.thirdStops().length, 12 + 22);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Iso values stops lists', () {
|
|
||||||
expect(isoValues.fullStops().length, 12);
|
|
||||||
expect(isoValues.thirdStops().length, 12 + 22);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Shutter speed values stops lists', () {
|
|
||||||
expect(shutterSpeedValues.fullStops().length, 16);
|
|
||||||
expect(shutterSpeedValues.halfStops().length, 16 + 15);
|
|
||||||
expect(shutterSpeedValues.thirdStops().length, 16 + 30);
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in a new issue