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>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
19a79d6126
commit
2dbd1a2ea9
+3
-5
@@ -2,19 +2,17 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
/// Persisted app settings + employee session.
|
||||
class Settings {
|
||||
static const _kBaseUrl = 'base_url';
|
||||
static const _kToken = 'emp_token';
|
||||
static const _kName = 'emp_name';
|
||||
static const _kRole = 'emp_role';
|
||||
|
||||
static const defaultBaseUrl = 'https://api.scalar360.in';
|
||||
/// Scalar360 API. Fixed per build (not shown to or changed by the user); a test build points at demo with
|
||||
/// `--dart-define=API_BASE_URL=https://demo.scalar360.in`.
|
||||
static const baseUrl = String.fromEnvironment('API_BASE_URL', defaultValue: 'https://api.scalar360.com');
|
||||
|
||||
late SharedPreferences _prefs;
|
||||
Future<void> load() async => _prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String get baseUrl => (_prefs.getString(_kBaseUrl) ?? defaultBaseUrl).trim();
|
||||
set baseUrl(String v) => _prefs.setString(_kBaseUrl, v.trim());
|
||||
|
||||
String? get token => _prefs.getString(_kToken);
|
||||
String? get name => _prefs.getString(_kName);
|
||||
String get role => _prefs.getString(_kRole) ?? 'EMPLOYEE';
|
||||
|
||||
Reference in New Issue
Block a user