- Changed window size to mobile phone format (400x800) - Removed width condition for ActiveProxyFooter - now always visible - Added run-umbrix.sh launch script with icon copying - Stats cards now display on all screen sizes
23 lines
880 B
Dart
23 lines
880 B
Dart
import 'package:umbrix/features/connection/notifier/connection_notifier.dart';
|
|
import 'package:umbrix/features/stats/data/stats_data_providers.dart';
|
|
import 'package:umbrix/features/stats/model/stats_entity.dart';
|
|
import 'package:umbrix/utils/custom_loggers.dart';
|
|
import 'package:umbrix/utils/riverpod_utils.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
part 'stats_notifier.g.dart';
|
|
|
|
@riverpod
|
|
class StatsNotifier extends _$StatsNotifier with AppLogger {
|
|
@override
|
|
Stream<StatsEntity> build() async* {
|
|
ref.disposeDelay(const Duration(seconds: 60));
|
|
final serviceRunning = await ref.watch(serviceRunningProvider.future);
|
|
if (serviceRunning) {
|
|
yield* ref.watch(statsRepositoryProvider).watchStats().map((event) => event.getOrElse((_) => StatsEntity.empty()));
|
|
} else {
|
|
yield* Stream.value(StatsEntity.empty());
|
|
}
|
|
}
|
|
}
|