Files
citypulse/lib/widgets/status_badge.dart
Zahar 6518df8ac1 feat: introduce FixMate Flutter app and React dashboard
- Add Flutter app shell (FixMateApp/MainScreen) with tabs: Report, Map,
  My Reports, Settings
- Implement capture and review flow (image_picker, geolocator, deterministic
  mock AI), and local storage (SharedPreferences + photo files on mobile)
- Build Map screen with flutter_map, marker clustering, filters, legend,
  marker details, and external maps deeplink
- Add My Reports list (view details, cycle status, delete) and Settings
  (language toggle via Provider, diagnostics, clear all data)
- Introduce JSON i18n loader and LocaleProvider; add EN/BM assets
- Define models (Report, enums) and UI badges (severity, status)

- Add static React dashboard (Leaflet map with clustering, heatmap toggle,
  filters incl. date range, queue, detail drawer), i18n (EN/BM), and
  demo data

- Update build/config and platform setup:
  - Extend pubspec with required packages and register i18n assets
  - Android: add CAMERA and location permissions; pin NDK version
  - iOS: add usage descriptions for camera, photo library, location
  - Gradle properties tuned for Windows/UNC stability
  - Register desktop plugins (Linux/macOS/Windows)
  - .gitignore: ignore .kilocode
  - Overhaul README and replace sample widget test
2025-09-25 18:38:18 +08:00

45 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import '../models/enums.dart';
class StatusBadge extends StatelessWidget {
final Status status;
final bool small;
const StatusBadge({Key? key, required this.status, this.small = false}) : super(key: key);
@override
Widget build(BuildContext context) {
final color = status.color;
return Chip(
backgroundColor: color.withOpacity(0.12),
avatar: CircleAvatar(
backgroundColor: color,
radius: small ? 10 : 12,
child: Icon(
_iconForStatus(status),
color: Colors.white,
size: small ? 12 : 14,
),
),
label: Text(
status.displayName,
style: TextStyle(
color: color,
fontSize: small ? 12 : 14,
),
),
padding: EdgeInsets.symmetric(horizontal: small ? 8 : 12, vertical: 0),
);
}
IconData _iconForStatus(Status s) {
switch (s) {
case Status.submitted:
return Icons.send;
case Status.inProgress:
return Icons.autorenew;
case Status.fixed:
return Icons.check;
}
}
}