xxxxxxxxxx
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
backgroundColor: Colors.blue, // Setting the background color
appBar: AppBar(
title: Text('Color Demo'),
backgroundColor: Colors.red, // Setting the app bar color
),
body: Center(
child: Text(
'Hello, Flutter!',
style: TextStyle(
fontSize: 24,
color: Colors.white, // Setting the text color
),
),
),
),
);
}
}
xxxxxxxxxx
Colors.white
Color(0xffA5A4A4)
Color(0xffA5A4A4).withOpacity(.5)
Color.fromRGBO(38, 38, 38, 0.4)
Color.fromARGB(255, 66, 165, 245);
Color.fromARGB(0xFF, 0x42, 0xA5, 0xF5);
xxxxxxxxxx
AnimatedContainer(
width: MediaQuery.of(context).size.width,
alignment: Alignment.bottomCenter,
height: MediaQuery.of(context).size.height,
duration: Duration(milliseconds: 100),
padding: EdgeInsets.fromLTRB(15, 10, 15, 5),
color: Colors.blue, //change to any preset color(ctrl + space)
),
xxxxxxxxxx
Color selection = Colors.green[400]!; // Selects a mid-range green.