How To Use Different Color Formats Hex Argb Rgbo In Flutter

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

There are basically 4 types of color formats supported by Flutter which is Hex Color code, ARGB, RGBA and Color constants. App developer can define color in all formats according to his requirement. In this tutorial we would learn about all there colors formats and how to Use Different Color Formats Hex ARGB RGBO in Flutter Dart Android iOS mobile application.

How To Use Different Color Formats Hex Argb Rgbo In Flutter

Use Different Color Formats Hex Argb Rgbo

Complete Code For Use Different Color Formats Hex Argb Rgbo 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(0xFFF9A825),
            title: Text('Use Different Color Formats Hex ARGB RGBO'),
          ),
            body: SafeArea(
                child: Center(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children:[

                        Text('Color Constants',
                            style: TextStyle(fontSize : 26, color: Colors.pink)),

                        Text('Hexadecimal Color',
                            style: TextStyle(fontSize : 26, color: Color(0xFFC0CA33))),

                        Text('ARGB Color',
                            style: TextStyle(fontSize : 26, color: Color.fromARGB(255, 255, 128, 0))),

                        Text('RGBO Color',
                            style: TextStyle(fontSize : 26, color: Color.fromRGBO(0, 155, 0, 1.0)))

                      ],
                    )
                )
            )
        )
    );
  }
}

Related Post