2023-02-15 23:28:19 +01:00
|
|
|
import 'package:flutter/material.dart';
|
2023-02-26 16:17:57 +01:00
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:smoke_cess_app/providers/input_provider.dart';
|
2023-02-15 23:28:19 +01:00
|
|
|
|
|
|
|
class MyTextFormField extends StatelessWidget {
|
2023-02-16 12:00:02 +01:00
|
|
|
final String _description;
|
2023-02-15 23:28:19 +01:00
|
|
|
const MyTextFormField(
|
2023-02-26 16:17:57 +01:00
|
|
|
this._description, {
|
2023-02-15 23:28:19 +01:00
|
|
|
super.key,
|
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-02-26 16:17:57 +01:00
|
|
|
var inputProvider = context.watch<InputProvider>();
|
2023-02-15 23:28:19 +01:00
|
|
|
return TextFormField(
|
2023-02-26 16:17:57 +01:00
|
|
|
controller: inputProvider.textController,
|
2023-02-16 12:00:02 +01:00
|
|
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|