aba0ca6256
Fetch server-side settings on app launch via new serverSettingsProvider. Hide News from bottom sheet and NavigationRail when RSS is disabled. Skip news card rendering in briefing messages when disabled. Refactor tab navigation to use dynamic tabs list and route-based refresh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
550 B
Dart
23 lines
550 B
Dart
import 'package:dio/dio.dart';
|
|
|
|
class SettingsApi {
|
|
const SettingsApi(this._dio);
|
|
final Dio _dio;
|
|
|
|
Future<void> syncTimezone(String ianaTimezone) async {
|
|
await _dio.put<void>(
|
|
'/api/settings',
|
|
data: {'user_timezone': ianaTimezone},
|
|
);
|
|
}
|
|
|
|
Future<Map<String, dynamic>> getAll() async {
|
|
final response = await _dio.get<Map<String, dynamic>>('/api/settings');
|
|
return response.data ?? {};
|
|
}
|
|
|
|
Future<void> update(Map<String, String> updates) async {
|
|
await _dio.put<void>('/api/settings', data: updates);
|
|
}
|
|
}
|