Styled Text Color With Fontsize 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.

Styled Text Color With Fontsize Using Flutter Android App

Styled Text Color With FontSize
Complete Code For Styled Text Color With FontSize 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 color')),
        body: Column(
          children: [
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                  fontSize: 8,
                    color: Colors.lightGreen
                ),
              ),
            ),
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                  fontSize: 12,
                    color: Colors.indigo
                ),
              ),
            ),
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                  fontSize: 16,
                    color: Colors.orange
                ),
              ),
            ),
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                  fontSize: 20,
                    color: Colors.amber
                ),
              ),
            ),
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                  fontSize: 24,
                  color: Colors.pink
                ),
              ),
            ),
            SizedBox(height: 20,),
            Container(
              alignment: Alignment.center,
              child:Text(
                'Styling text in Flutter',
                style: TextStyle(
                    fontSize: 30,
                    color: Colors.blueAccent
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Related Post