You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Project
6
+
7
+
DPIP (Disaster Prevention Information Platform) — a Flutter app for Taiwan earthquake early warning and disaster information, integrating TREM-Net and CWA data.
8
+
9
+
## Commands
10
+
11
+
```bash
12
+
# Install dependencies
13
+
flutter pub get --no-example
14
+
15
+
# Format
16
+
dart format .
17
+
18
+
# Lint
19
+
dart analyze .
20
+
21
+
# Code generation (required after editing routes, @JsonSerializable, or @freezed models)
22
+
dart run build_runner build
23
+
24
+
# Update translations
25
+
bash tools/update_translations.sh
26
+
27
+
# Run
28
+
flutter run
29
+
30
+
# Build
31
+
flutter build apk --release
32
+
flutter build ios --release
33
+
```
34
+
35
+
There is no test suite.
36
+
37
+
## Architecture
38
+
39
+
**State management:** Provider (`ChangeNotifier`). Global providers are registered in `lib/core/providers.dart`:
**Routing:** go_router with type-safe routes via `@TypedGoRoute`. Routes are defined in `router.dart` and code-generated into `router.g.dart`. Run `build_runner` after route changes.
44
+
45
+
**Feature modules** live under `lib/app/` (home, map, settings, changelog, debug, welcome). Each is self-contained with its own widgets subfolder.
46
+
47
+
**API layer** (`lib/api/`): Dio HTTP client with caching. Models use `@JsonSerializable` + `@freezed` — regenerate with `build_runner` after changes.
**Assets:** JSON data files are gzip-compressed (`*.json.gz`) and decompressed at runtime. GLSL shaders (`fog.frag`, `thunderstorm.frag`) are used for map effects.
52
+
53
+
## Key Conventions
54
+
55
+
-**Settings naming:** Notification settings use numbered prefixes — `(1.eew)`, `(2.earthquake)`, `(3.weather)`, `(4.tsunami)`, `(5.basic)` — to control display order.
56
+
-**Linting:** Extends `package:lint/strict.yaml`. Line width 100, preserve trailing commas, prefer single quotes.
57
+
-**Documentation:** Every public member must have a doc comment (`///`). Every file must have a top-level library doc comment (`/// ...` before any `library` or first declaration). Follow Effective Dart: document usage and behavior from the caller's perspective, not internal implementation. Use `[...]` for code references, avoid restating the name.
58
+
-**Dot shorthand:** Always use Dart dot shorthand (e.g., `.value` instead of `EnumType.value`) wherever the type can be inferred from context.
59
+
-**Widget extraction:** When a build method nests too deeply, extract the subtree into a private widget class (`_FooWidget`) in the same file rather than keeping it inline.
60
+
-**Class member order** (top to bottom), within each group sort alphabetically `A→Z` then `a→z`:
0 commit comments