Add TextFields for review title and review content

Co-authored-by: Reimar <mail@reim.ar>
This commit is contained in:
Alexandertp 2024-09-05 15:26:21 +02:00
parent 24051c2b73
commit bd9a6dfa03

View File

@ -11,6 +11,9 @@ class CreateReviewPage extends StatefulWidget {
} }
class _CreateReviewState extends State<CreateReviewPage> { class _CreateReviewState extends State<CreateReviewPage> {
final titleInput = TextEditingController();
final contentInput = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final place = ModalRoute.of(context)!.settings.arguments as Place; final place = ModalRoute.of(context)!.settings.arguments as Place;
@ -18,18 +21,45 @@ class _CreateReviewState extends State<CreateReviewPage> {
return SideMenu( return SideMenu(
selectedIndex: -1, selectedIndex: -1,
body: Scaffold( body: Scaffold(
body: SingleChildScrollView(child: Container( backgroundColor: Color(0xFFF9F9F9),
decoration: const BoxDecoration(color: Color(0xFFF9F9F9)), body: SingleChildScrollView(
child: Center(
child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(40),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(children: [ child: Column(children: [
Text(place.name, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24)), Text(place.name, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24)),
Text(place.description, style: const TextStyle(color: Colors.grey)) Text(place.description, style: const TextStyle(color: Colors.grey)),
const SizedBox(height: 50),
TextField(
controller: titleInput,
enableSuggestions: true,
autocorrect: true,
decoration: const InputDecoration(
hintText: 'Review Title',
),
),
const SizedBox(height: 30),
TextField(
controller: contentInput,
minLines: 5,
maxLines: null,
decoration: const InputDecoration(
hintText: 'Write a review...',
)
)
]), ]),
)
)
)) )
) )
); );
} }
@override
void dispose() {
titleInput.dispose();
contentInput.dispose();
}
} }