Skip to content

Instantly share code, notes, and snippets.

@eseidelGoogle
Created January 9, 2020 23:22
Show Gist options
  • Save eseidelGoogle/98f313bae0355b4066963bf537f01608 to your computer and use it in GitHub Desktop.
Save eseidelGoogle/98f313bae0355b4066963bf537f01608 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: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MultilineTextApp()
);
}
}
class MultilineTextApp extends StatelessWidget {
static const TITLE = 'Multiline Test';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: TITLE,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text(TITLE),
),
body: TextFormField(
decoration: InputDecoration(
filled: true,
),
keyboardType: TextInputType.multiline,
style: TextStyle(color: Colors.red.withOpacity(0.6)),
maxLines: null,
// strutStyle: StrutStyle(), // uncomment to fix
)),
builder: (BuildContext context, Widget child) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: 2,
),
child: child,
);
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment