Compare commits

..

No commits in common. "91f90ae8e825d2d9cbe859e3952e725c8e14e775" and "f0110e0edfd9a6db5a0e39deeadb36654ebefbf0" have entirely different histories.

5 changed files with 42 additions and 87 deletions

View file

@ -1,3 +0,0 @@
- Fixed histogram being affected by spot metering.
- Improved text fields focus handling.
- Added German translation.

View file

@ -109,17 +109,17 @@ void testE2E(String description) {
);
/// Add ND to shoot another scene
// await tester.openPickerAndSelect<NdValuePicker, NdValue>('2');
// await _expectMeteringStateAndMeasure(
// tester,
// equipmentProfile: mockEquipmentProfiles[0],
// film: mockFilms[0],
// fastest: 'f/1.8 - 1/200',
// slowest: 'f/16 - 1/2.5',
// iso: '400',
// nd: '2',
// ev: mockPhotoEv100 + 2 - 1,
// );
await tester.openPickerAndSelect<NdValuePicker, NdValue>('2');
await _expectMeteringStateAndMeasure(
tester,
equipmentProfile: mockEquipmentProfiles[0],
film: mockFilms[0],
fastest: 'f/1.8 - 1/200',
slowest: 'f/16 - 1/2.5',
iso: '400',
nd: '2',
ev: mockPhotoEv100 + 2 - 1,
);
/// Select another lens without ND
await tester.openPickerAndSelect<EquipmentProfilePicker, EquipmentProfile>(mockEquipmentProfiles[1].name);

View file

@ -137,7 +137,6 @@ class _NameFieldBuilder extends StatelessWidget {
bottom: Dimens.paddingS / 2,
),
child: LightmeterTextField(
autofocus: true,
initialValue: state.name,
maxLength: 48,
hintText: S.of(context).name,

View file

@ -1,74 +1,33 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class LightmeterTextField extends StatefulWidget {
const LightmeterTextField({
this.autofocus = false,
this.controller,
this.hintText,
this.initialValue,
this.inputFormatters,
this.leading,
this.maxLength,
this.onChanged,
this.style,
this.textAlign = TextAlign.start,
});
final bool autofocus;
final TextEditingController? controller;
final String? hintText;
final String? initialValue;
final List<TextInputFormatter>? inputFormatters;
final Widget? leading;
final int? maxLength;
final void Function(String)? onChanged;
final TextStyle? style;
final TextAlign textAlign;
@override
State<LightmeterTextField> createState() => _LightmeterTextFieldState();
}
class _LightmeterTextFieldState extends State<LightmeterTextField> {
late final focusNode = FocusNode(debugLabel: widget.hintText);
@override
Widget build(BuildContext context) {
return TextFormField(
autofocus: widget.autofocus,
autovalidateMode: AutovalidateMode.onUserInteraction,
controller: widget.controller,
focusNode: focusNode,
initialValue: widget.initialValue,
inputFormatters: widget.inputFormatters,
maxLength: widget.maxLength,
onChanged: widget.onChanged,
style: widget.style,
textAlign: widget.textAlign,
decoration: InputDecoration(
counter: const SizedBox(),
contentPadding: EdgeInsets.zero,
errorStyle: const TextStyle(fontSize: 0),
icon: widget.leading,
hintText: widget.hintText,
),
onTapOutside: (event) {
focusNode.unfocus();
},
validator: (value) {
if (value == null || value.isEmpty) {
return '';
} else {
return null;
}
},
);
}
@override
void dispose() {
focusNode.dispose();
super.dispose();
}
class LightmeterTextField extends TextFormField {
LightmeterTextField({
super.controller,
super.autofocus,
super.initialValue,
super.inputFormatters,
super.maxLength,
super.onChanged,
super.style,
super.textAlign,
Widget? leading,
String? hintText,
}) : super(
autovalidateMode: AutovalidateMode.onUserInteraction,
maxLines: 1,
decoration: InputDecoration(
counter: const SizedBox(),
contentPadding: EdgeInsets.zero,
errorStyle: const TextStyle(fontSize: 0),
icon: leading,
hintText: hintText,
),
validator: (value) {
if (value == null || value.isEmpty) {
return '';
} else {
return null;
}
},
);
}

View file

@ -1,7 +1,7 @@
name: lightmeter
description: Lightmeter app inspired by Material 3 design system.
publish_to: "none"
version: 1.0.4+59
version: 1.0.3+58
environment:
sdk: ">=3.0.0 <4.0.0"