Created
July 10, 2020 15:15
-
-
Save erluxman/c28dfee36be252d938054fbc6bb01eb7 to your computer and use it in GitHub Desktop.
DefaultTextstyle
This file contains hidden or 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:flirt/flirt.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
"laxman".isValidEmail; | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar(), | |
body: Center( | |
child: Column( | |
children: <Widget>[ | |
Spacer(flex: 4), | |
Card( | |
margin: EdgeInsets.all(8), | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: DefaultTextStyle( | |
child: Column( | |
children: <Widget>[ | |
Text( | |
"DefaultTextStyle With Green text color", | |
textAlign: TextAlign.center, | |
style: TextStyle(fontSize: 20, color: Colors.black), | |
), | |
Text("Title"), | |
Text("SubTitle", style: TextStyle(fontSize: 25)), | |
Text("Heading", style: TextStyle(fontSize: 20)), | |
Container(height: 16), | |
Image.network("https://pbs.twimg.com/media/EckvFk_UEAE1aTV?format=png&name=medium") | |
], | |
), | |
style: TextStyle(fontSize: 30, color: Colors.green), | |
), | |
), | |
), | |
Spacer(flex: 1), | |
Card( | |
margin: EdgeInsets.all(8), | |
child: Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: DefaultTextStyle( | |
child: Column( | |
children: <Widget>[ | |
Text( | |
"DefaultTextStyle With Red text color", | |
textAlign: TextAlign.center, | |
style: TextStyle(fontSize: 20, color: Colors.black), | |
), | |
Text("Title"), | |
Text("SubTitle", style: TextStyle(fontSize: 25)), | |
Text("Heading", style: TextStyle(fontSize: 20)), | |
Container(height: 16), | |
Image.network("https://pbs.twimg.com/media/EckvUm_UEAEMMIp?format=png&name=medium") | |
], | |
), | |
style: TextStyle(fontSize: 30, color: Colors.red)), | |
), | |
), | |
Spacer(flex: 4), | |
], | |
), | |
), | |
), | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment