Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
home: Scaffold(
appBar: AppBar(
title: Text("Test"),
body: MyHomePage(),
class MyHomePage extends StatelessWidget {
Widget build(BuildContext context) {
return _buildText();
Widget _buildText() {
String s =
"The Text widget displays a string of text with single style. "
"The string might break across multiple lines or might all "
"be displayed on the same line depending on the layout constraints.";
return Text(
textAlign: TextAlign.left,
overflow: TextOverflow.clip,
maxLines: 10,
textScaleFactor: 1.5,
style: _buildStyle(),
TextStyle _buildStyle() {
return TextStyle(
backgroundColor: Color.fromRGBO(255, 20, 20, 0.5),
fontSize: 15,
fontWeight: FontWeight.bold,
wordSpacing: 3,
letterSpacing: 10,
fontFamily: "DancingScript"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment