How To Create Simple Styled Text Using Flutter Android App

admin_img Posted By Bajarangi soft , Posted On 10-10-2020

we are going to start with an overview of Dart strings and Unicode. Next we'll move on to styling text for your app, first for entire strings and then for spans within a string.

How To Create Simple Styled Text Using Flutter Android App

Styled Text 
Complete Code For Styled Text  In Flutter
main.dart

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.amber,
            title: Text('Styling text')),
        body: Center(
                child: _myWidget(context),
              ),
            ),
    );
  }
}

// modify this widget with the example code below
Widget _myWidget(BuildContext context) {
  String myString = 'I ❤️ Flutter';
  print(myString);
  return Text(
    myString,
    style: TextStyle(fontSize: 30.0),
  );
}

Related Post