app bar & chip
parent
255d189ce1
commit
4d76b34608
@ -1,30 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppColors {
|
||||
static const mainPurple = Color(0xFF7954F7);
|
||||
static const purpleBg = Color(0xFFAEA4FC);
|
||||
static const deepPurple = Color(0xFF7C65E7);
|
||||
static const logoColor = Color(0xFF7C65E7);
|
||||
static const buttonColor = Color(0xFF6A46F5);
|
||||
static const splashBgColor = Color(0xFF3C355D);
|
||||
static const whiteColor = Color(0xFFffffff);
|
||||
static const blackColor = Color(0xFF000000);
|
||||
static const lightGray = Color(0xFFF4F5F7);
|
||||
static const lightPurple = Color(0xFFB7A3E6);
|
||||
static const scaffoldBgColor = Color(0xFFF8F8F8);
|
||||
static const lightGreyEFColor = Color(0xffeaeaff);
|
||||
static const greyF7Color = Color(0xffF7F7F7);
|
||||
static const lightGrayColor = Color(0xff808080);
|
||||
static const buttonGrayColor = Color(0xffF1F1F1);
|
||||
static const lightPurpleAlpha = Color(0x5AB7A3E6);
|
||||
static const mainPurple = Color(0xFF7954F7);
|
||||
static const purpleBg = Color(0xFFAEA4FC);
|
||||
static const deepPurple = Color(0xFF7C65E7);
|
||||
static const logoColor = Color(0xFF7C65E7);
|
||||
static const buttonColor = Color(0xFF6A46F5);
|
||||
static const splashBgColor = Color(0xFF3C355D);
|
||||
|
||||
static const blackColor = Color(0xFF000000);
|
||||
static const lightGray = Color(0xFFF4F5F7);
|
||||
static const lightPurple = Color(0xFFB7A3E6);
|
||||
static const scaffoldBgColor = Color(0xFFF8F8F8);
|
||||
static const lightGreyEFColor = Color(0xffeaeaff);
|
||||
static const greyF7Color = Color(0xffF7F7F7);
|
||||
static const lightGrayColor = Color(0xff808080);
|
||||
static const buttonGrayColor = Color(0xffF1F1F1);
|
||||
static const lightPurpleAlpha = Color(0x5AB7A3E6);
|
||||
|
||||
// New UI Colors
|
||||
static const Color bgRedColor = Color(0xFFED1C2B);
|
||||
static const Color bgRedBorderColor = Color(0xFFED1C2B);
|
||||
static const whiteColor = Color(0xFFffffff);
|
||||
static const Color primaryRedColor = Color(0xFFED1C2B);
|
||||
static const Color primaryRedBorderColor = Color(0xFFED1C2B);
|
||||
static const Color secondaryLightRedColor = Color(0xFFFEE9EA);
|
||||
static const Color secondaryLightRedBorderColor = Color(0xFFFEE9EA);
|
||||
static const Color bgRedLightColor = Color(0xFFFEE9EA);
|
||||
static const Color bgGreenColor = Color(0xFF18C273);
|
||||
static const Color powerdBy = Color(0xFF333C45);
|
||||
}
|
||||
|
||||
static const Color textColor = Color(0xFF2E3039);
|
||||
static const Color borderOnlyColor = Color(0xFF2E3039);
|
||||
|
||||
//Chips
|
||||
static const Color successColor = Color(0xff18C273);
|
||||
static const Color errorColor = Color(0xFFED1C2B);
|
||||
static const Color alertColor = Color(0xFFD48D05);
|
||||
static const Color infoColor = Color(0xFF0B85F7);
|
||||
static const Color warningColor = Color(0xFFFFCC00);
|
||||
static const Color greyColor = Color(0xFFEFEFF0);
|
||||
|
||||
static const Color successLightColor = Color(0xFF18C27326);
|
||||
static const Color errorLightColor = Color(0xFFED1C2B1A);
|
||||
static const Color alertLightColor = Color(0xFFD48D0526);
|
||||
static const Color infoLightColor = Color(0xFF0B85F726);
|
||||
static const Color warningLightColor = Color(0xFFFFCC0026);
|
||||
static const Color greyLightColor = Color(0xFFEFEFF026);
|
||||
}
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/enums.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||
|
||||
class CustomChipWidget extends StatelessWidget {
|
||||
final ChipType chipType;
|
||||
final String chipText;
|
||||
final String? iconAsset;
|
||||
final VoidCallback? onTap;
|
||||
final bool isSelected;
|
||||
final double borderRadius;
|
||||
final EdgeInsetsGeometry padding;
|
||||
|
||||
const CustomChipWidget({
|
||||
Key? key,
|
||||
required this.chipType,
|
||||
required this.chipText,
|
||||
this.iconAsset,
|
||||
this.onTap,
|
||||
this.isSelected = false,
|
||||
this.borderRadius = 12,
|
||||
this.padding = const EdgeInsets.all(8),
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final hasIcon = iconAsset != null;
|
||||
final hasOnTap = onTap != null || hasIcon;
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
color: isSelected ? chipType.color : chipType.backgroundColor,
|
||||
border: Border.all(
|
||||
color: chipType.color,
|
||||
width: isSelected ? 0 : 1,
|
||||
),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: hasOnTap ? onTap : null,
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
child: Container(
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (iconAsset != null) ...[
|
||||
Utils.buildSvgWithAssets(icon: iconAsset!),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
Text(
|
||||
chipText.toUpperCase(),
|
||||
style: context.dynamicTextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: isSelected ? Colors.white : chipType.color,
|
||||
letterSpacing: 0.1,
|
||||
isLanguageSwitcher: true,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue