Files
Scalar360_Attendence/lib/theme.dart
athul rdandClaude Opus 5.5 2dbd1a2ea9 Scalar Presence: brand-panel login (light/dark), Poppins, splash and launcher icons, fixed API base via dart-define, keep-signed-in, Android project
- Login reworked to the Brand panel layout with a dark-theme switch; 'Scalar Presence' two-line wordmark
- Android project now tracked (was gitignored); pins shared_preferences_android 2.4.27 (2.5.0 crashed with a black screen)
- API base URL fixed per build (--dart-define=API_BASE_URL), no in-app server setting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 15:51:09 +05:30

87 lines
2.6 KiB
Dart

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: 'Poppins',
);
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),
),
),
);
}