Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DefaultTextstyle
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