How To Set Up Text Color Using Flutter Android App

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

We can pass here color code in different formats like Hex Colo code, Inbuilt color constants and RGB color codes.

How To Set Up Text Color Using Flutter Android App

Set Text Color
Complete Code For Set Text Color 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: Color(0xFF4A148C),
            title: Text('Change Text Color'),
            centerTitle: true,
          ),
            body:SafeArea(
                child: Center(
                    child: Padding(
                      padding: const EdgeInsets.only(top:40.0),
                      child: Column(
                          children: [
                            Text(
                              'Change Text Color',
                              style: TextStyle(fontSize: 20, color: Color(0xFF9CCC65)),
                            ),
                            SizedBox(height: 20,),
                            Text(
                              'Change Text Color',
                              style: TextStyle(fontSize: 20, color: Colors.deepPurple),
                            ),
                            SizedBox(height: 20,),
                            Text(
                              'Change Text Color',
                              style: TextStyle(fontSize: 20, color: Color.fromARGB(255, 68, 170, 245)),
                            ),
                            SizedBox(height: 20,),
                            Text(
                              'Change Text Color',
                              style: TextStyle(fontSize: 20, color: Colors.deepOrange),
                            ),
                            SizedBox(height: 20,),
                            Text(
                              'Change Text Color',
                              style: TextStyle(fontSize: 20, color: Colors.pink),
                            ),
                          ]
                      ),
                    )
                )
            )
        )
    );
  }
}

Related Post