Created
January 9, 2020 23:22
-
-
Save eseidelGoogle/98f313bae0355b4066963bf537f01608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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