Skip to content

Instantly share code, notes, and snippets.

@lukepighetti
Last active June 28, 2023 16:26
Show Gist options
  • Save lukepighetti/a33fda4bf2314215cf4ad8127df2925c to your computer and use it in GitHub Desktop.
Save lukepighetti/a33fda4bf2314215cf4ad8127df2925c to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class TextInputComponent extends StatefulWidget {
const TextInputComponent({super.key});
@override
State<TextInputComponent> createState() => _TextInputComponentState();
}
class _TextInputComponentState extends State<TextInputComponent> {
late final _controller = TextEditingController(text: "");
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return TextField(
controller: _controller,
decoration: const InputDecoration(labelText: "Enter text"),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment