cpd_2022_zi/lib/widgets/text_formfield.dart

22 lines
571 B
Dart
Raw Normal View History

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