m3_lightmeter/lib/screens/shared/text_field/widget_text_field.dart
Vadim 7ad47c0636
ML-203 Logging EXIF data (#239)
* typos

* added `LogbookPhotosProvider`

* implemented `LogbookScreen`

* implemented `LogbookPhotoEditScreen`

* added photo update

* save geolocation

* added `CameraSettingsSection`

* adjusted logbook grid

* added hero animation

* fixed logbook list updates

* added empty logbook state

* added `saveLogbookPhotos` option

* fixed updating photos

* made `DialogPicker` content scrollable

* added tests for `LogbookPhotosProvider`

* made image preview full-width

* made note field multiline

* wip

* migrated to new iap service

* fixed unit tests

* typo

* fixed arb formatting

* stub logbook photos for tests

* implemented integration test for logbook

* moved date to title

* redundant bottom padding

* added logbook photo screen to screenshots generator

* Update settings.gradle

* aligned iap stub with iap release

* sync

* made logbook iap

* debug screenshots

* Update runner.dart

* fixed dialog picker of optional values

* added bottom padding to logbook edit screen

* fixed tests

* Create camera_stub_image.jpg

* Update films_provider_test.dart

* rename

* Update pubspec.yaml

* added logbook to pro features
2025-07-29 12:38:48 +02:00

77 lines
2 KiB
Dart

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.maxLines = 1,
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 int? maxLines;
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,
maxLines: widget.maxLines,
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();
}
}