Skip to content

Instantly share code, notes, and snippets.

@erluxman
Created July 10, 2020 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erluxman/c28dfee36be252d938054fbc6bb01eb7 to your computer and use it in GitHub Desktop.
Save erluxman/c28dfee36be252d938054fbc6bb01eb7 to your computer and use it in GitHub Desktop.
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