cpd_2022_zi/lib/widgets/text_formfield.dart

25 lines
717 B
Dart

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smoke_cess_app/providers/input_provider.dart';
class MyTextFormField extends StatelessWidget {
final String _description;
const MyTextFormField(
this._description, {
super.key,
});
@override
Widget build(BuildContext context) {
var inputProvider = context.watch<InputProvider>();
return TextFormField(
controller: inputProvider.textController,
decoration: InputDecoration(hintText: _description),
validator: (String? value) =>
value == null || value.isEmpty ? 'Text eingeben' : null,
keyboardType: TextInputType.multiline,
maxLines: null,
);
}
}