feat(metadata): add Jellyfin edit support
This commit is contained in:
@@ -120,6 +120,7 @@ Future<String?> showTextInputDialog(
|
||||
TextInputType? keyboardType,
|
||||
List<TextInputFormatter>? inputFormatters,
|
||||
String? Function(String)? validator,
|
||||
bool allowEmpty = false,
|
||||
}) {
|
||||
return showDialog<String>(
|
||||
context: context,
|
||||
@@ -132,6 +133,7 @@ Future<String?> showTextInputDialog(
|
||||
keyboardType: keyboardType,
|
||||
inputFormatters: inputFormatters,
|
||||
validator: validator,
|
||||
allowEmpty: allowEmpty,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -237,6 +239,7 @@ class _TextInputDialog extends StatefulWidget {
|
||||
final TextInputType? keyboardType;
|
||||
final List<TextInputFormatter>? inputFormatters;
|
||||
final String? Function(String)? validator;
|
||||
final bool allowEmpty;
|
||||
|
||||
const _TextInputDialog({
|
||||
required this.title,
|
||||
@@ -247,6 +250,7 @@ class _TextInputDialog extends StatefulWidget {
|
||||
this.keyboardType,
|
||||
this.inputFormatters,
|
||||
this.validator,
|
||||
this.allowEmpty = false,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -260,7 +264,7 @@ class _TextInputDialogState extends State<_TextInputDialog>
|
||||
|
||||
void _submit() {
|
||||
final text = _controller.text;
|
||||
if (text.isEmpty) return;
|
||||
if (text.isEmpty && !widget.allowEmpty) return;
|
||||
if (widget.validator != null && widget.validator!(text) != null) return;
|
||||
Navigator.pop(context, text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user