From 928d3902b6a881724d0987705eb8ef39dfeecf83 Mon Sep 17 00:00:00 2001 From: Tarek Belkahia Date: Mon, 16 Sep 2024 15:07:09 +0100 Subject: [PATCH] Add input test screen (#3) --- lib/input_screen.dart | 33 +++++++++++++++++++++++++++++++++ lib/main.dart | 9 +++++++++ 2 files changed, 42 insertions(+) create mode 100644 lib/input_screen.dart diff --git a/lib/input_screen.dart b/lib/input_screen.dart new file mode 100644 index 0000000..5af97a9 --- /dev/null +++ b/lib/input_screen.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +class InputScreen extends StatefulWidget { + const InputScreen({super.key}); + + @override + State createState() => _InputScreenState(); +} + +class _InputScreenState extends State { + final TextEditingController _inputController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Lorem Ipsum'), + ), + body: Padding( + padding: const EdgeInsets.all(16), + child: SingleChildScrollView( + child: TextField( + controller: _inputController, + maxLines: null, + decoration: const InputDecoration( + labelText: 'Lorem Ipsum', + ), + ), + ), + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 28e4d57..864f91d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:demo_app/defects_screen.dart'; import 'package:demo_app/form_screen.dart'; +import 'package:demo_app/input_screen.dart'; import 'package:demo_app/issue_1619_repro.dart'; import 'package:demo_app/issue_1677_repro.dart'; import 'package:demo_app/nesting_screen.dart'; @@ -107,6 +108,14 @@ class _MyHomePageState extends State { }, child: const Text('Form Test'), ), + ElevatedButton( + onPressed: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (_) => const InputScreen()), + ); + }, + child: const Text('Input Test'), + ), ElevatedButton( onPressed: () { Navigator.of(context).push(