63 lines
2.2 KiB
Dart
63 lines
2.2 KiB
Dart
/// Shared string keys, timings, and layout breakpoints used across the app.
|
|
library;
|
|
|
|
/// Human-readable name shown in the splash screen, app bars, and About tile.
|
|
const String kAppName = 'IngTrak';
|
|
|
|
/// Package / Android application id.
|
|
const String kPackageName = 'com.example.myapp';
|
|
|
|
/// How long the splash screen stays visible before navigating to the shell.
|
|
const Duration kSplashDuration = Duration(seconds: 2);
|
|
|
|
/// Base URL for the personal ingtrak FastAPI backend.
|
|
///
|
|
/// Override at build/run time:
|
|
/// `flutter run --dart-define=API_BASE_URL=http://192.168.1.114:8000`
|
|
///
|
|
/// Defaults:
|
|
/// - Android emulator → `http://10.0.2.2:8000` (host loopback)
|
|
/// - iOS Simulator → `http://127.0.0.1:8000`
|
|
/// - Physical device → Mac LAN IP, e.g. `http://192.168.1.114:8000`
|
|
const String kApiBaseUrl = String.fromEnvironment(
|
|
'API_BASE_URL',
|
|
defaultValue: 'http://10.0.2.2:8000',
|
|
);
|
|
|
|
/// Enable Banking only accepts http(s) redirect URLs (not custom schemes).
|
|
/// Keep this exact value in the Control Panel and backend `REDIRECT_URI`.
|
|
/// The app opens auth in a WebView and intercepts this callback to read `code`.
|
|
const String kEnableBankingRedirectUri =
|
|
'http://localhost:8000/api/connect/callback';
|
|
|
|
/// Optional app-scheme bounce used after the http callback (not registered
|
|
/// with Enable Banking).
|
|
const String kBankRedirectScheme = 'ingtrak';
|
|
const String kBankRedirectHost = 'connected';
|
|
const String kBankRedirectUri = '$kBankRedirectScheme://$kBankRedirectHost';
|
|
|
|
/// SharedPreferences keys.
|
|
abstract final class StorageKeys {
|
|
static const themeMode = 'theme_mode';
|
|
static const useRemoteData = 'use_remote_data';
|
|
static const txMeta = 'tx_meta_v2';
|
|
static const txMetaLegacy = 'tx_meta_v1';
|
|
}
|
|
|
|
/// Named routes registered on [MaterialApp].
|
|
abstract final class AppRoutes {
|
|
static const splash = '/';
|
|
static const shell = '/shell';
|
|
static const itemDetail = '/item';
|
|
static const addItem = '/add-item';
|
|
}
|
|
|
|
/// Width thresholds used to adapt padding and card density.
|
|
abstract final class Breakpoints {
|
|
static const compact = 600.0;
|
|
static const medium = 840.0;
|
|
}
|
|
|
|
/// Maximum content width on tablets / large phones so lists stay readable.
|
|
const double kMaxContentWidth = 720.0;
|