This commit is contained in:
athul rd
2026-08-10 17:01:30 +05:30
commit 19a79d6126
16 changed files with 1790 additions and 0 deletions
+86
View File
@@ -0,0 +1,86 @@
import 'package:flutter/material.dart';
/// Scalar360 palette (mirrors the web app tokens).
class AppColors {
static const emerald = Color(0xFF00BE73);
static const navy = Color(0xFF1F2937);
static const muted = Color(0xFF8A94A6);
static const border = Color(0xFFE4E9F0);
static const surface = Color(0xFFF7F9FC);
static const card = Colors.white;
static const danger = Color(0xFFEF4444);
static const gold = Color(0xFFC9A227);
static const navyAccent = Color(0xFF3B82F6);
}
/// Status pill colours.
Color statusColor(String? s) {
switch (s) {
case 'PRESENT':
return AppColors.emerald;
case 'ABSENT':
return AppColors.danger;
case 'HALF_DAY':
return AppColors.gold;
case 'LEAVE':
return AppColors.navyAccent;
default:
return AppColors.muted;
}
}
ThemeData buildTheme() {
final base = ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.fromSeed(
seedColor: AppColors.emerald,
primary: AppColors.emerald,
brightness: Brightness.light,
),
scaffoldBackgroundColor: AppColors.surface,
fontFamily: 'Roboto',
);
return base.copyWith(
appBarTheme: const AppBarTheme(
backgroundColor: AppColors.surface,
foregroundColor: AppColors.navy,
elevation: 0,
centerTitle: false,
),
cardTheme: CardThemeData(
color: AppColors.card,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18),
side: const BorderSide(color: AppColors.border),
),
margin: EdgeInsets.zero,
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: AppColors.card,
contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(color: AppColors.border),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(color: AppColors.border),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
borderSide: const BorderSide(color: AppColors.emerald, width: 1.5),
),
),
filledButtonTheme: FilledButtonThemeData(
style: FilledButton.styleFrom(
backgroundColor: AppColors.emerald,
foregroundColor: Colors.white,
minimumSize: const Size.fromHeight(50),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
textStyle: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
),
),
);
}