cpd_2022_zi/lib/widgets/text_formfield.dart

24 lines
601 B
Dart
Raw Normal View History

2023-02-15 23:28:19 +01:00
import 'package:flutter/material.dart';
class MyTextFormField extends StatelessWidget {
final String _description;
2023-02-15 23:28:19 +01:00
final Function(String?) onSaveAction;
const MyTextFormField(
this._description,
2023-02-15 23:28:19 +01:00
this.onSaveAction, {
super.key,
});
@override
Widget build(BuildContext context) {
return TextFormField(
onSaved: onSaveAction,
decoration: InputDecoration(hintText: _description),
2023-02-15 23:28:19 +01:00
validator: (String? value) =>
value == null || value.isEmpty ? 'Text eingeben' : null,
keyboardType: TextInputType.multiline,
maxLines: null,
);
}
}