Skip to content

Instantly share code, notes, and snippets.

@Nikhil725051
Created April 18, 2022 05:48
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 Nikhil725051/c6ee1f9af465df39918606ac1fbd6a37 to your computer and use it in GitHub Desktop.
Save Nikhil725051/c6ee1f9af465df39918606ac1fbd6a37 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main()
{
runApp(MyApp());
}
class MyApp extends StatelessWidget
{
@override
Widget build(BuildContext context)
{
return MaterialApp(
home: MyHomePage()
);
}
}
class MyHomePage extends StatelessWidget
{
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('RichText Example'),
backgroundColor: Colors.purple,
),
body: Padding(
padding: EdgeInsets.all(10.0),
child: Center(
child: RichText(
text: TextSpan(
text: 'DeveloperXon provides you ',
style: TextStyle(color: Colors.black, fontSize: 20),
children: const <TextSpan>[
TextSpan(text: 'tutorials ', style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(text: 'on '),
TextSpan(text: 'web and mobile ', style: TextStyle(fontWeight: FontWeight.bold,color: Colors.blue)),
TextSpan(text: 'development.'),
],
),
)
),
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment