Colors.dart common file

How to create color file common for all app.

Create common AppColors.dart file in your lib folder.

class AppColors {
static const Color btn_primary_dark_new = Color(0xff214960);
static const Color btn_primary_light_new = Color(0xff56C67D);
static const Color gray = Color(0xffD7D7D7);
static const Color bg_web_link_item_disabled = Color(0xffddddd);
}

and use it wherever you need.
using AppColors.colorName


Container(
margin: const EdgeInsets.all(8.0),
decoration: ShapeDecoration(
color: AppColors.btn_primary_dark_new,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0),
side: BorderSide(width: 1, color: AppColors.gray))),
child: Text("Hello"),
)


Comments

Popular posts from this blog

Flutter Bloc Pattern 8.0.0 Call API

Dynamic and responsive ListView in flutter

Manage Firebase storage using flutter