Skip to content

Instantly share code, notes, and snippets.

@bgetsug
Last active June 27, 2022 08:12
Show Gist options
  • Save bgetsug/3ea6d0076ba33b40c0ef1e792cb4046c to your computer and use it in GitHub Desktop.
Save bgetsug/3ea6d0076ba33b40c0ef1e792cb4046c to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Long Text',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Long Text'),
);
}
}
class MyHomePage extends StatefulWidget {
final String title;
const MyHomePage({
Key? key,
required this.title,
}) : super(key: key);
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: TextFormField(
keyboardType: TextInputType.multiline,
expands: true,
maxLines: null,
textInputAction: TextInputAction.newline,
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment