ing connected, makign some features
This commit is contained in:
+15
-12
@@ -13,23 +13,25 @@ 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`
|
||||
/// `flutter run --dart-define=API_BASE_URL=https://ingtrak.satoshinakamoto.win`
|
||||
///
|
||||
/// 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`
|
||||
/// Local defaults (when override omitted):
|
||||
/// - Android emulator → `http://10.0.2.2:8000`
|
||||
/// - Physical device on LAN → `http://192.168.x.x:8000`
|
||||
const String kApiBaseUrl = String.fromEnvironment(
|
||||
'API_BASE_URL',
|
||||
defaultValue: 'http://10.0.2.2:8000',
|
||||
defaultValue: 'https://ingtrak.satoshinakamoto.win',
|
||||
);
|
||||
|
||||
/// 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';
|
||||
|
||||
/// Enable Banking redirect derived from [kApiBaseUrl].
|
||||
/// Must match backend `REDIRECT_URI` and the Control Panel whitelist.
|
||||
/// The app opens auth in a WebView and intercepts this callback path for `code`.
|
||||
String get kEnableBankingRedirectUri {
|
||||
final base = kApiBaseUrl.endsWith('/')
|
||||
? kApiBaseUrl.substring(0, kApiBaseUrl.length - 1)
|
||||
: kApiBaseUrl;
|
||||
return '$base/api/connect/callback';
|
||||
}
|
||||
/// Optional app-scheme bounce used after the http callback (not registered
|
||||
/// with Enable Banking).
|
||||
const String kBankRedirectScheme = 'ingtrak';
|
||||
@@ -42,6 +44,7 @@ abstract final class StorageKeys {
|
||||
static const useRemoteData = 'use_remote_data';
|
||||
static const txMeta = 'tx_meta_v2';
|
||||
static const txMetaLegacy = 'tx_meta_v1';
|
||||
static const bankCache = 'bank_cache_v1';
|
||||
}
|
||||
|
||||
/// Named routes registered on [MaterialApp].
|
||||
|
||||
@@ -12,14 +12,14 @@ class RecurringItem {
|
||||
required this.amount,
|
||||
required this.currency,
|
||||
required this.dayOfMonth,
|
||||
required this.category,
|
||||
this.labelIds = const [],
|
||||
});
|
||||
|
||||
final String description;
|
||||
final double amount;
|
||||
final String currency;
|
||||
final int dayOfMonth;
|
||||
final TxCategory category;
|
||||
final List<String> labelIds;
|
||||
}
|
||||
|
||||
/// Build unique recurring templates from annotated transactions.
|
||||
@@ -51,7 +51,7 @@ List<RecurringItem> recurringItemsFrom({
|
||||
amount: tx.amount,
|
||||
currency: tx.currency,
|
||||
dayOfMonth: (DateTime.tryParse(tx.date)?.day ?? 1).clamp(1, 28),
|
||||
category: metaFor(tx).category,
|
||||
labelIds: List<String>.of(metaFor(tx).labelIds),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user